Building SimEng¶
Prerequisites¶
Building SimEng requires CMake and a compiler that supports C++17.
Building¶
Obtain the source code using git:
git clone https://github.com/UoB-HPC/SimEng.git
Configure with CMake, specifying the path to your desired installation directory if necessary:
cd SimEng
cmake -B build -S .
-DCMAKE_BUILD_TYPE={Release, Debug, RelWithDebInfo, MinSizeRel}
-DCMAKE_INSTALL_PREFIX=<simeng_install_directory>
-DSIMENG_ENABLE_TESTS={ON, OFF} #Defaults to OFF
With this configuration, the build files will be generated in a directory called “build”.
The SimEng test suites depend on a selection of LLVM libraries. Building this dependency can take a while, therefore, the use of prebuilt LLVM libraries is supported. The following CMake configuration flags should be set to enable this:
-DSIMENG_USE_EXTERNAL_LLVM=ON -DLLVM_DIR=<llvm_library_directory> # directory of LLVM libraries as CMake targetsNote
More information about the LLVM_DIR value can be found here.
Note
LLVM versions greater than 14 or less than 8 are not supported. We’d recommend using LLVM 14.0.5 where possible as this has been verified by us to work correctly.
Two additional flags are available when building SimEng. Firstly is
-DSIMENG_SANITIZE={ON, OFF}
which adds a selection of sanitisation compilation flags (primarily used during the development of the framework). Secondly is-SIMENG_OPTIMIZE={ON, OFF}
which attempts to optimise the framework’s compilation for the host machine through a set of compiler flags and options.
We recommend using the Ninja build system for faster builds, especially if not using pre-built LLVM libraries. After installation, it can be enabled through the addition of the -GNinja
flag in the above CMake build command.
Once configured, use
cmake --build build
or whichever generator you have selected for CMake to build. Append the-j{Num_Cores}
flag to build in parallel, keep in mind that building without a linked external LLVM library usually has very high (1.5GB per core) memory requirements.(Optional) Run
cmake --build build --target test
to run the SimEng regression tests and unit tests. Please report any test failures as a GitHub issue.Finally, run
cmake --build build --target install
to install SimEng to the directory specified with CMake.