The recommended system to build this project is CMake. Compilation of the C++ tests requires a C++ compiler that supports the C++20 standard. In order to build the MEX interface, MATLAB must be installed and available on the search path.
The MEX interface can be compiled with:
cmake -S. -Bbuild
cmake --build buildIf the compilation is successful, these commands will produce the the MEX file build/gemmi.$(mexext), where $(mexext) is mexa64 on Linux, mexmaci64 or mexmaca64 on MacOS , and mexw64 on Windows. The file build/gemmi.m contains the documentation for the MATLAB gemmi function.
Building the interface can be disabled by setting the CMake variable BUILD_MEX to false:
cmake -S. -Bbuild -DBUILD_MEX=FalseThe project comes with a suite of Catch2 C++ tests. By default, the tests are disabled, and can be enabled by setting the CMake variable BUILD_TEST to true:
cmake -S. -Bbuild -DBUILD_TESTS=TrueAdditional options can be passed to CMake during the configuration stage. To use a compiler other than the default one, for example, one can use:
cmake -S. -Bbuild -DCMAKE_CXX_COMPILER=<preferred_compiler>Here, <preferred_compiler> must be either an executable on the search path or the path to the chosen compiler.
Systems without CMake can use the function mex/compile_mex.m to compile the MEX interface. In MATLAB, this can be achieved by using the following commands:
cd mex
compile_mexThe MEX interface and the corresponding documentation will be in the local directory (mex/).