installation - Open-Quantum-Platform/openqp GitHub Wiki
OpenQP relies on several external libraries, including TagArray, BLAS, LAPACK, nlOPT, libXC, SciPy, NumPy, libDLfind, and cffi. Some of these libraries are automatically downloaded and installed during the compilation and installation process, so a network connection is required.
However, there are some prerequisites and considerations:
- CMake: Version 3.25 or higher must be installed before starting the compilation process.
- BLAS/LAPACK: The appropriate variants of these libraries should be pre-installed to ensure compatibility with your preferred setups.
- cffi: This is a package interconnecting C and Python, which should be pre-installed.
- DFT-D4 Dispersion Correction: Its successful installation is subjective to the particular OS versions. Therefore, it is optional.
Note: OpenQP currently supports only the GCC compiler due to the specific features it utilizes. While using Ninja is optional, it can be beneficial for faster compilation, though OpenQP can be compiled without it.
For installation guides specific to MacOS, Ubuntu, and CentOS, including Real Site Installation Examples, please refer to the provided links.
Required Libraries and Tools:
- GCC (Version >= 8)
- SciPy (Version >= 1.10)
- NumPy (Version >= 1.20)
- CMake (Version >= 3.25)
- libDLfind (Version >= 0.0.3)
- cffi
- Ninja (Optional)
To download the source files for OpenQP, use the following command:
git clone ssh://[email protected]:Open-Quantum-Platform/openqp.gitor
git clone https://github.com/Open-Quantum-Platform/openqp.git
To compile OpenQP with Ninja and enable OpenMP parallelization, follow these steps:
cd openqp
cmake -B build -G Ninja -DUSE_LIBINT=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=. -DENABLE_OPENMP=ON -DLINALG_LIB_INT64=OFF
ninja -C build install
pip install pyoqp/.
bash pyoqp/patch.shIf you prefer to compile OpenQP without using Ninja and without OpenMP support, use the following commands:
cd openqp
cmake -B build -DUSE_LIBINT=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=. -DENABLE_OPENMP=ON -DLINALG_LIB_INT64=OFF
make -C build install
pip install pyoqp/.
bash pyoqp/patch.shCompilation Options:
-
Sequential Execution without OpenMP: To run OpenQP sequentially, without OpenMP, include
-DENABLE_OPENMP=OFFin the CMake command. -
Use of libint: Including
-DUSE_LIBINT=ONwill replace the default ERI (based on Rys Quadrature) with libint. - Use
-DLINALG_LIB_INT64=OFFto ensure compatibility with third-party software like libdlfind compiled of BLAS index arrays with the 32-bit integer type.
Set the necessary environment variables as follows:
export OPENQP_ROOT=/path/to/openqp
export OMP_NUM_THREADS=4
export LD_LIBRARY_PATH=$OPENQP_ROOT/lib:$LD_LIBRARY_PATHSpecial Environmental Settings for MKL Math Library:
export MKL_INTERFACE_LAYER="LP64" # Due to -DLINALG_LIB_INT64=OFF
export MKL_THREADING_LAYER=SEQUENTIALAfter installation, you can run tests using the following commands:
openqp --run_tests other # Run tests from the 'other' folder in examples
openqp --run_tests all # Run all tests from all folders in examples
openqp --run_tests path_to_folder # Run tests from a specific folder