-
Notifications
You must be signed in to change notification settings - Fork 56
Compiling
- JDK7+
- C++
-
Linux:
gcc,clangor equivalent - macOS: XCode with Command Line Utilities
- Windows: Microsoft Visual C++ or mingw-w64
-
Linux:
- Maven, CMake
-
Linux:
sudo apt install maven cmake g++ -
macOS:
brew install maven cmake -
Windows:
- Manually install Maven from https://maven.apache.org/, adding
mvn.batdirectory to your%PATH% - Manually install CMake from https://cmake.org/download/, adding
cmake.exedirectory to your%PATH% - Please note that if using Visual Studio 2019 (Full IDE) or Build Tools for Visual Studio 2019 (Command Line Only) you will need to add the
'MSVC v142 - VS 2019 C++ ARM64 build tool for ARM64 binary compilation in Windows - preferably the latest version (currently compiled with
v14.28-16.8 as of wiki update)
- Manually install Maven from https://maven.apache.org/, adding
-
Linux:
mvn # compile for current system
mvn -P mingw64 # cross-compile using mingw-w64 for Windows
mvn -P m32 # cross-compile using multi-lib for 32-bit Linux/Unix
mvn -P armmac # cross-compile using Xcode tools
mvn -P winaarch64 # cross-compile using MVSC for Arm64 Windows -
Important: Call
mvn cleanbetween different compiler profiles. -
Note: For other cross-compilation profiles or platforms search for
CMAKE_TOOLCHAIN_FILEinpom.xml. Each has a respective CMake toolchain file. - Prefer to skip maven? The project is configured to allow calling
cmake -DCMAKE_TOOLCHAIN_FILE=<...>directly but thejavahgenerated header file must be present.
Without recompiling native libraries
mvn -P package,jar-with-dependenciesThe build will output two .jar files in the target/ directory. One archive, which is build by the maven-jar-plugin, has a classifier which maches the machine's classifier (unless you are doing a cross-compile). This one will contain a freshly compiled library, like libjssc.so for Linux or a jssc.dll if you are on Windows. They go into a directory /natives/os_bitness.
The other .jar artifact which is generated by the build doesn't use the library compiled by cmake. It uses the checked-in libraries form the directory src/main/resources-precompiled/natives/. This jar is the artefact we are going to publish to maven central.
It will contain a broader varieties of OSes and architectures in just one .jar file, but the libraries checked in into this git repository need to stay updated.
If you do not need a freshly compiled library, you can just execute mvn package -P package to skip the cmake compilation and the unit tests.