The project includes several modules. Run this command to clone the repository with modules:
git clone --recursive https://github.com/epam/DFP.git DFP
All build steps require
Java8or newer for execution. The build was tested onUbuntu 20.04andWindows 10operating systems andamd64platform.
The DFP project has four targets:
- DFP for Java
- DFP-Math for Java
- DFP for .NET
- DFP-Math for .NET
All targets, with the exception of DFP for Java, depend on native libraries. Compile and compress native libraries for all the supported platforms before Java and/or .NET compilation.
In case of DFP for Java, the necessary code was ported from C. To build only DFP for Java and run unit tests, all you need is sources in this repository and JDK.
Let's investigate thoroughly these two build options:
JDK8or newer is required for this compilation step.
Java-only DFP and unit tests are located in the :java:dfp project.
You can execute all targets in this project. For example:
./gradlew :java:dfp:buildAll dependencies are compiled automatically. You do not need anything other than JDK.
Some DFP tests require native libraries. All native-dependent tests and JMH benchmarks are separated to the :java:dfpNativeTests project.
Refer to Complete build, if you want to run all DFP tests or benchmarks.
To run the complete build, follow these steps:
- Native libraries compilation and source wrappers generation
- Native libraries compression
- Java compilation
- .NET compilation
It is assumed, that this step is executed on
Ubuntu 20.04or newer on theamd64platform.
This steps includes the cross-compilation compilation of Linux native libraries for the armv7a, aarch64, i686, amd64 platforms.
-
These packages are required for the compilation:
sudo apt install curl tar build-essential cmake g++-9-arm-linux-gnueabihf g++-9-aarch64-linux-gnu g++-9-i686-linux-gnu musl-tools
-
clangcross-compilers are also required:mkdir ../llvm cd ../llvm curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz tar -xf clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz tar -xf clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz tar -xf clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz cd ../DFP/
-
Perform the compilation:
./gradlew makeNativeLinux
All the compiled this step libraries are placed in these folders:
native/bin/Release/linux— contains Linux native libraries for DFP.native/binmath/Release/linux— contains Linux native libraries for DFP-Math.native/binDemo/Release/linux— contains Linux executable console programs to test the built programs on different environments.
It is assumed, that this step is executed on
Windows 10or newer on theamd64platform.
This steps includes the compilation of Windows native libraries for the i686 and amd64 platforms.
-
This software is required for the compilation:
- Microsoft Visual C++ 2019 Build Tools (as a separate package or as a part of Visual Studio 2019) with
ClangCLplatform toolkit. - CMake 3.20 or newer.
- Microsoft Visual C++ 2019 Build Tools (as a separate package or as a part of Visual Studio 2019) with
-
Run the compilation from the Developer Command Prompt when all dependencies are met:
gradlew makeNativeWindows
All the compiled this step libraries are placed in these folders:
native/bin/Release/windows— contains Windows native libraries for DFP.native/binmath/Release/windows— contains Windows native libraries for DFP-Math.native/binDemo/Release/windows— contains Windows executable console programs to test the built programs on different environments.
It is assumed, that the
macOSnative libraries are built via cross-compilation onUbuntu 20.04or newer on theamd64platform.
-
These packages are required for the compilation:
sudo apt install clang make libssl-dev liblzma-dev libz-dev libxml2-dev fuse wget cmake
-
Run this script to install
macOS SDK:cd ./osxcross/tarballs/ wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz cd ..
-
Run this command to build the cross-compiler:
UNATTENDED=yes OSX_VERSION_MIN=10.7 JOBS=4 ./build.sh cd .. -
Run this command to compile libraries:
./gradlew makeNativeDarwin
All the compiled this step libraries are placed in these folders:
native/bin/Release/darwin— contains macOS native libraries for DFP.native/binmath/Release/darwin— contains macOS native libraries for DFP-Math.native/binDemo/Release/darwin— contains macOS executable console programs to test the built programs on different environments.
Note: The native libraries for the
aarch64platform are not signed and do not work on ARM-based platforms from Apple. If you know how to fix this issue with the CI integration, please notify us. The native libraries for theamd64platform work well.
This step requires the compiler
clang 10or newer.
The execution of this step was tested on
Ubuntu 20.04.
-
To install
clangcompiler, run this command:sudo apt install clang
-
Run this command to generate native wrappers:
./gradlew makeNativeWrappers
All native libraries compiled in previous steps for Linux, Windows, and macOS operating systems must be
copied to one build host and compressed with the Zstandard compressor.
-
Install version 1.34 or newer of the
zstd:sudo apt install zstd
-
Run this command to perform the compression:
zstd -19 --rm -r ./native/bin zstd -19 --rm -r ./native/binmath
-
Run this command to create Java libraries when all previous steps are completed:
./gradlew :java:dfp:jar :java:dfp-math:jar
-
Execute
checkto run unit tests:./gradlew check
-
Execute
jmhto run JMH tests:./gradlew jmh
Note: Due to the large quantity of JMH tests, it takes a significant amount of time to run them all. We suggest to choose just the ones you need and locally remove the rest.
We use Cake build system to compile .NET libraries, but
Java8or newer can be required for some compilation steps.
-
This software is required for the compilation:
- Build Tools for MS Visual Studio 2019 (as a separate package or as a part of Visual Studio 2019). Note, that MS Visual Studio 2022 does not support the .NET Framework 4.0. We recommend using MS Visual Studio 2019 or tweaking your version of MS Visual Studio by hand.
- .NET SDK with the support of
.NET Framework 4.0,.NET Standard 2.0and.NET Core 3.1.
-
Run the compilation of .NET libraries:
./csharp/build --target=Build
-
Execute this command to run unit tests:
./csharp/build --target=Run-Unit-Tests
-
Run this command to invoke the compiled Benchmarks by
Buildtarget:dotnet ./csharp/EPAM.Deltix.DFP.Benchmark/bin/Release/netcoreapp3.1/EPAM.Deltix.DFP.Benchmark.dll