Skip to content

How to use Arithmos ?

Scrappers Team edited this page Jan 9, 2022 · 8 revisions

Welcome to the Arithmos wiki!

This section would show you how to build Arithmos from sources and add your arithmetic and algorithmic code. ENJOY !

1) Fork and Clone :

  • Fork from github fork.
  • Navigate to your desired directory of project cd your-directory.
  • Clone from command line using :
gh repo clone Scrappers-glitch/Arithmos

2) Do your changes :

  • To add your java-code use the code/java/src/ directory and add only one package then your code inside.
  • To add your native code C/C++ use the code/natives/includes for headers .h files and /libs for .c .cxx and .cpp files.
  • Find the books in readme for Algorithms/Data Structures, Java, Natives and Bash.

3) Do a PR :

  • Use these commands :
# create a new branch
git checkout -b alpha-update
# add some files to the upcoming commit
git add .
# commit to the branch
git commit -m 'Your commit message !'
# push the commit to the branch
git push --set-upstream https://github.com/**?username=**/Arithmos.git alpha-update
Username for 'https://github.com': 
Password for 'https://[email protected]@github.com': **ACCESS_TOCKEN**

Notes : -> Make sure to replace **?username=** with your github user name and **ACCESS_TOCKEN** with your git access tocken.

4)Scala, Kotlin and Groovy :

  • You can use them as a replacement for Java and the sources got included as jar dependencies for the final jar (you cannot call your java class in scala/kotlin/groovy for now, they are just dependencies for now).
  • To install kt/groovy/scala use SDKMAN sdk manager on gnu linux :
sdk install kotlin
sdk install groovy
sdk install scala

5) Clojure is still --WIP--

6) Assemble a jar :

┌─[twisted@parrot]─[~/GradleProjects/Arithmos/build/assemble]
└──╼ $./assembleJAR.sh 
Compiling the project

--------Script start--------

---MajorTask@Build Scala : Scala build started
 Task@Build Compile Scala : Succeeded
---MajorTask@Build Scala : Scala build finished

---MajorTask@Build Kotlin : Kotlin build started
 Task@Build Compile Kotlin : Succeeded
---MajorTask@Build Kotlin : Kotlin build finished

---MajorTask@Build Groovy : Groovy build started
 Task@Build Compile Groovy : Succeeded
---MajorTask@Build Groovy : Groovy build finished

---MajorTask@Build Java Sources : Java build started
 Task@Build Compile Java : Succeeded
---MajorTask@Build Java Sources : Java build finished

---MajorTask@Build Native Sources : Native build started
---MajorTask@Build Native Sources : Found native sources---
 Task@Build Linux-x86-x64 : Succeeded
 Task@Build Android-Arm-64 : Succeeded
 Task@Build Android-Arm-32 : Succeeded
 Task@Build Android-Intel-64 : Succeeded
 Task@Build Android-Intel-32 : Succeeded
---MajorTask@Build Native Sources : Succeeded---
---MajorTask@Build Native Sources : Native build finished

--------Script end--------
Assemble JAR

--------Script start--------
 Task@Clean : Completed

 Task@MakeOutputDirectory : Completed

 Task@CreateJarManifest : Completed

 Task@MakeDependenciesDirectory : Completed

 Task@AddJavaDependencies : Completed

 Task@AddLinuxNativeDependencies : Completed

script.sh: line 86: [[: adding: lib/ (stored 0%)
  adding: lib/armeabi-v7a/ (stored 0%)
  adding: lib/armeabi-v7a/libc++_shared.so (deflated 72%)
  adding: lib/armeabi-v7a/libArithmosNatives.so (deflated 66%)
  adding: lib/arm64-v8a/ (stored 0%)
  adding: lib/arm64-v8a/libc++_shared.so (deflated 76%)
  adding: lib/arm64-v8a/libArithmosNatives.so (deflated 63%)
  adding: lib/x86_64/ (stored 0%)
  adding: lib/x86_64/libc++_shared.so (deflated 75%)
  adding: lib/x86_64/libArithmosNatives.so (deflated 62%)
  adding: lib/x86/ (stored 0%)
  adding: lib/x86/libc++_shared.so (deflated 72%)
  adding: lib/x86/libArithmosNatives.so (deflated 55%): syntax error in expression (error token is ": lib/ (stored 0%)
  adding: lib/armeabi-v7a/ (stored 0%)
  adding: lib/armeabi-v7a/libc++_shared.so (deflated 72%)
  adding: lib/armeabi-v7a/libArithmosNatives.so (deflated 66%)
  adding: lib/arm64-v8a/ (stored 0%)
  adding: lib/arm64-v8a/libc++_shared.so (deflated 76%)
  adding: lib/arm64-v8a/libArithmosNatives.so (deflated 63%)
  adding: lib/x86_64/ (stored 0%)
  adding: lib/x86_64/libc++_shared.so (deflated 75%)
  adding: lib/x86_64/libArithmosNatives.so (deflated 62%)
  adding: lib/x86/ (stored 0%)
  adding: lib/x86/libc++_shared.so (deflated 72%)
  adding: lib/x86/libArithmosNatives.so (deflated 55%)")
 Task@AddNativeDependencies : Completed

 Task@AddAssets : Completed

 Task@CreateJar : Completed

--------Script end--------

7) Using mvn besides Ccoffee :

  • List the project :
┌─[twisted@parrot]─[~/GradleProjects/Arithmos]
└──╼ $tree
.
├── build
│   ├── assemble
│   │   ├── assembleJAR.sh
│   │   ├── clean.sh
│   │   ├── script.sh
│   │   └── variables.sh
│   └── compile
│       ├── buildGroovy.sh
│       ├── buildJava.sh
│       ├── buildKotlin.sh
│       ├── buildNatives.sh
│       ├── buildScala.sh
│       ├── compile.sh
│       └── variables.sh
├── code
│   ├── clojure
│   ├── groovy
│   │   └── src
│   │       └── testGroovy
│   │           └── TestGroovy.groovy
│   ├── java
│   │   ├── assets
│   │   ├── dependencies
│   │   │   ├── groovy-2.4.7.jar
│   │   │   ├── groovy.jar
│   │   │   ├── kotlin.jar
│   │   │   ├── scala.jar
│   │   │   └── scala-library-2.13.7.jar
│   │   └── src
│   │       ├── main
│   │       │   └── TestCase.java
│   │       ├── math
│   │       │   └── statistics
│   │       │       ├── Quartile.java
│   │       │       └── Statistics.java
│   │       ├── number
│   │       │   └── NumberFormat.java
│   │       ├── patternMatching
│   │       │   └── PatternMatching.java
│   │       ├── physics
│   │       │   └── Units.java
│   │       ├── sorting
│   │       │   ├── ItemsSorting.java
│   │       │   └── SortUtils.java
│   │       ├── time
│   │       │   └── TimeFormat.java
│   │       └── utils
│   │           └── Chronograph.java
│   ├── kotlin
│   │   └── src
│   │       └── testKotlin
│   │           └── Test.kt
│   ├── natives
│   │   ├── includes
│   │   │   ├── main_TestCase.h
│   │   │   └── Test.h
│   │   ├── libs
│   │   │   ├── NativeTest.cxx
│   │   │   └── Test.cpp
│   │   └── main
│   └── scala
│       └── src
│           └── testScala
│               └── ScalaTest.scala
├── CommonVariables.sh
├── JAVAHOME.sh
├── NDKPATH.sh
├── output
│   ├── Arithmos
│   │   ├── Arithmos.jar
│   │   ├── dependencies
│   │   │   ├── android-natives-21.jar
│   │   │   ├── groovy-2.4.7.jar
│   │   │   ├── groovy.jar
│   │   │   ├── kotlin.jar
│   │   │   ├── scala.jar
│   │   │   └── scala-library-2.13.7.jar
│   │   └── linux-x86-x64
│   │       └── libArithmosNatives.so
│   └── run
│       ├── run.sh
│       ├── script.sh
│       └── variables.sh
├── README.md
├── references
│   ├── ansi_escape_sequences.pdf
│   ├── BashNotesForProfessionals.pdf
│   └── gcc.pdf
└── shared
    ├── lib
    │   ├── arm64-v8a
    │   │   ├── libArithmosNatives.so
    │   │   └── libc++_shared.so
    │   ├── armeabi-v7a
    │   │   ├── libArithmosNatives.so
    │   │   └── libc++_shared.so
    │   ├── x86
    │   │   ├── libArithmosNatives.so
    │   │   └── libc++_shared.so
    │   └── x86_64
    │       ├── libArithmosNatives.so
    │       └── libc++_shared.so
    └── linux-x86-x64
        └── libArithmosNatives.so

44 directories, 60 files