Skip to content

Libxc with CUDA support installation guide

Eduardo Andres Perez Leale edited this page Jul 2, 2018 · 7 revisions

Instalation guide

The purpose of this document is to provide a guide to successfully install the version of the Libxc library wich has support for CUDA devices. Once the install is complete, you can then compile Lio with Libxc support.

Requirements

  1. Cuda Toolkit v8.0 or above download page.
  2. CMake v3.9.0 or above download page.

Libxc installation

  1. Clone the library from gitlab (you'll need to have an account).
git clone git@gitlab.com:eduarditoperez/libxc.git
  1. Switch to the libxc-gpu branch
git checkout cuda-integration
  1. Create the install folder by typping the following command
cmake -H. -Bobjdir
  1. Go to the objdir folder that was created in step 3.
cd objdir
  1. Create the libxc_cuda.so shared library by typping the make command from the objdir folder
make
  1. Copy the xc_version.h file located in objdir to the parent folder. This file is generated as the result of the step 5 and is needed to run the test.

  2. Install the libxc_cuda.so in you libraries folder.

  3. Create and export two environment variables in LD_LIBRARY_PATH,

LIBXC_LIBS=points to the path where the libxc libaries where installed in the file system.
LIBXC_INCLUDES=points to the path where the libxc include files where installed in the file system.
  1. To run the test, go to the unit-test folder located in libxc/testsuite/unit_test and run the command make. After the script has finished you should see the test results.
Running gpu test...
work_gga_c test:  0
work_gga_x test:  0
work_lda test:  0
work_mgga_c test:  0
work_mgga_x test:  0

The 0 after each test means that the test is ok.

Compile Lio with Libxc

Once Libxc is successfuly installed, you can compile Lio with Libxc support. Here are all the possible compilations modes for Lio with Libxc,

  • make cuda=0 cpu=1 libxc=0 - Lio cpu version without Libxc.
  • make cuda=0 cpu=1 libxc=1 - Lio cpu version with Libxc cpu version.
  • make cuda=1 cpu=0 libxc=0 - Lio gpu version without Libxc.
  • make cuda=1 cpu=0 libxc=1 - Lio gpu version with Libxc cpu version.
  • make cuda=1 cpu=0 libxc=2 - Lio gpu version with Libxc gpu version.