Skip to content

LIO installation

Federico N. Pedron edited this page Jul 1, 2020 · 19 revisions

Thank you for using LIO! The following installation guide is meant to be as comprehensible as possible. For a quick reference just run the following line in the LIO folder, replacing XX with the appropriate compute capability (see below for further explanations):

make -j smXX=1


Installation Requirements

The bare minimum requirements for LIO include:

  • A LINUX installation (frequently Ubuntu or CentOS).
  • A FORTRAN/C++ compiler supporting OpenMP (usually GNU or intel).
  • BLAS and LAPACK libraries (liblapack-dev liblas-dev packages).
  • NVIDIA CUDA libraries for a GPU installation.

Optional packages (that enable the full range of XC functionals) are:

  • LIBXC, an exchange-correlation library. Their GPU version is not currently supported by LIO, but we provide our own LIBXC GPU version
  • LIBINT, an electron gaussian integrals library.

Installing LIO

You must first download LIO from the MALBECC repo, then go to the downloaded LIO folder (extract first if downloaded as tar.gz).

If you want access to new and experimental features, you can change to the develop branch using the following git command within the LIO folder: git checkout develop

For a CPU-only installation, you need only run make within the main LIO folder, using the following options:

make cuda=0

For a GPU installation, please verify first that CUDA is already installed, and that the CUDA_HOME environment variable is properly set (usually pointing to /usr/local/cuda). Then, run make with the following options:

make smXX=1

Where XX should be replaced with the appropriate compute capability for a given GPU. See the Wikpedia chart in order to know which compute capability is available for said GPU. In case more than one type of GPU is present (for example, in HPC cluster installations), it is possible to specify multiple architectures. For example, if GForce GTX 980, 1080 and 1660 GPUs are present, the following line makes code compatible with all of them:

make sm52=1 sm61=1 sm75=1

After everything is successfully compiled, it is advisable to add the following line to your /home/USER/.bashrc, replacing /PATH/TO/LIO to the current LIO folder. This will configure all of the LIO-specific environment variables:

source PATH_TO_LIO/liohome.sh

As a side note, other relevant compilation options are:

  • intel=2 - when using Intel FORTRAN/C++ compilers.
  • analytics=3 - enables debug information at compilation and runtime levels.
  • precision=1 - enable double precision throughout whole code (by default, XC calculations are done in single precision).

So congratulations, you have your LIO sucessfully installed. If you want to be sure everything is in order, go to the /tests folder in LIO and run new_tests.py.


Installing LIO with LIBXC and LIBINT

A LIO with LIBXC+LIBINT compilation allows you to use several different XC functionals (both pure and hybrid). This is currently supported only in the develop branch, but it will be available as a main feature in future releases. As a prerrequisite for this installation, you must of course install first LIBINT and LIBXC. A fair warning, this installation is very time consuming (mostly due to libint), so expect to spend a few hours compiling LIBINT and another few minutes when compiling LIO.

Before installation

Check whether the following packages are installed (if not, all of them can be easily installed via apt/yum): cmake, autoconf, eigen3 (libeigen3-dev) and boost (libboost-dev). In case you intend to run the GPU code, you also need a newer version of CMake (at least 3.8), which can be downloaded here. After download, extract the tar file and go to the new cmake folder, then run ./bootstrap && make && make install. You may need sudo for the make install step; please refer to the CMake included readme for more options. Downloaded files may be deleted after installation.

Installing LIBINT

You can get the latest version of libint from here. The latest version (2.6) is currently supported. Extract the downloaded package, and within the extracted folder run the provided autogen.sh. Then create a "build" directory outside the libint folder, and change to that directory. Then execute the following lines:

export CXXFLAGS='-std=c++11'
../LIBINTFOLDER/configure --enable-eri2=1 --enable-eri=1 --enable-1body=1 --with-gnu-ld --enable-shared=yes --enable-static=no
make
make install

More expert users may know about the --with-cartgauss-ordering option for LIBINT. Avoid this option with LIO, and leave it as standard.

Where LIBINTFOLDER is the downloaded libint folder (extracted or otherwise). You may need sudo for the make install step, or change the installation prefix (check ../LIBINTFOLDER/configure --help for more options).

Installing LIBXC CPU version

You can get the latest version of LIBXC here. At the time of writing, version 5.0 works well with LIO. You should also create a destination folder for LIBXC installation files other than the standard, since for the GPU version you need both LIBXC in CPU and GPU. Extract the downloaded files, and go to the downloaded libxc folder. Then execute the following lines:

cmake -H. -Bobjdir -DCMAKE_INSTALL_PREFIX=/PATH/TO/LIBXC
cd objdir && make
make install

Where PATH/TO/LIBXC refers to the folder which will contain the compiled files, libraries and such. If this is different from the downloaded folder, you may delete the downloaded files after installation.

Installing LIBXC GPU version

This is the last step before attempting a LIO compilation, and it is only necessary if you are going to run the GPU version of LIO. You must use our own version of the GPU LIBXC library, which can be found here. Afterwards, follow the same steps as with the CPU version, keeping in mind that the CUDA_HOME environment should be set accordingly and that compilation may fail for older versions of CMAKE (see above on how to install a newer version).

Compiling LIO

This final step is identical to a normal LIO compilation, but additional flags should be added and more environment variables are needed. Remember that, for now, this functionality is only available in the develop branch, so before attempting anything do not forget to git checkout develop. Be aware that only a full-double precision compilation is possible for these cases (precision=1). For a CPU-only compilation, execute the following lines:

export LIBINT_HOME=PATH/TO/LIBINT
export LIBXC_HOME_CPU=PATH/TO/LIBXC_CPU
export _D_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBINT_HOME/lib
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:PATH/TO/EIGEN3

make cuda=0 precision=1 libint=1 libxc=1

Where PATH/TO/LIBINT is the installation path for LIBINT (the default for 2.6 is /usr/local/libint/2.6.0), PATH/TO/LIBXC_CPU is the installation path of LIBXC CPU version (as specified in the previous steps), and PATH/TO/EIGEN3 is the location of the Eigen3 include files (usually /usr/include/eigen3).

For a GPU compilation, the process is similar, with PATH/TO/LIBXC_GPU pointing to the LIBXC GPU installation:

export LIBINT_HOME=PATH/TO/LIBINT
export LIBXC_HOME_CPU=PATH/TO/LIBXC_CPU
export LIBXC_HOME_GPU=PATH/TO/LIBXC_GPU
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBINT_HOME/lib
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:PATH/TO/EIGEN3

make smXX=1 precision=1 libint=1 libxc=2

Don't forget to source liohome.sh or add it to .bashrc, and congratulations!