-
Notifications
You must be signed in to change notification settings - Fork 6
Compiling and Build Time Configuration
Note that the library should respect most common changes when using CMake e.g. setting the CMAKE_C_FLAGS or CMAKE_CXX_FLAGS variables etc.
There are a variety of build configuration flags available, but here I will go over only the major ones that should be utilised/changed:
-
USE_SYSTEM_EIGEN: if this isONthen cmake will find theEigen3library via system paths, otherwise it will be downloaded usingCPM. If you already have a compatible version ofEigen3installed, set this toON. -
USE_SYSTEM_LIBXC: if this isONthen cmake will find theLibXClibrary via system paths, otherwise it will be downloaded usingCPM. If you already have a compatible version ofLibXCinstalled, set this toON. -
USE_SYSTEM_BLAS: if this isONthen cmake will find theBLASandLAPACKlibraries via system paths and link them, also specifying to e.g.Eigen3that it should useBLASoperations etc. Generally this will improve performance (particularly for DFT calculations) but it can cause issues with e.g. multithreading as OpenBLAS for example is not thread-safe. So be careful turning this on. -
USE_QCINT: there is a SIMD optimized varient oflibcint, and setting this toONwill use that instead of the (slightly slower) libcint. This performance change may be platform specific, but in general if speed is the goal you should try to set thisON. -
WITH_PYTHON_BINDINGS: Some python bindings forocchave been written, but the documentation for building the library with CMake and making it usable with a python installation remains to be written. So in general, if you're not compiling it via a python build process, just ignore this flag and leave itOFF.
Assuming you have a working C and C++ compiler and the ninja build program, a basic build can be achieved via:
# from the root directory of this repository, but you can of course put the build directory
# wherever you wish
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_EIGEN=OFF -DUSE_SYSTEM_LIBXC=OFF -G Ninja
ninja
Then you can run the tests via:
export OCC_BASIS_PATH=/path/to/occ/repository
ninja test
Note: some of the tests will fail if you don't set the OCC_BASIS_PATH variable correctly.
scnlib expects <Windows.h> but only <windows.h> exists, just need to copy/link it so it can locate it.
The posix thread model is required - probably due to library expectations. This can be achieved by updating alternatives and selecting the posix thread model, or modifying the toolchain file.
sudo update-alternatives --config x86_64-w64-mingw32-g++
sudo update-alternatives --config x86_64-w64-mingw32-gcc
gau2grid uses aligned_alloc as it detects GNUC. Need to set CMAKE_C_FLAGS (and maybe CMAKE_CXX_FLAGS) to include
-D__GG_NO_PRAGMA.