Skip to content

JDFTx

PREREQS:

JDFTx depends on the following other software libraries.

  • FFTW3
  • GSL - GNU Scientific Lib.
  • LAPACK - Linear Algebra Lib.
  • LibXC - specialized function library used by DFT codes.

Modules to Load Prior to Building Any Software:

Execute the following Linux command to setup the software modules being used:

module load cmake xl_r spectrum-mpi cuda/11.2

Enable Web Proxy to Get to Some of the Remote Download Sites

Execute the following Linux command to setup the Web Proxy:

export http_proxy=http://proxy:8888 export https_proxy=$http_proxy

Overall Directory Structure:

For my builds, top level directory of JDFTx under my AiMOS "barn" filesystem and inside I have:

[XXXXyyyy@dcsfen01 JDFTx]$ ls FFTW3 GSL jdftx-build jdftx-git LAPACK LibXC [XXXXyyyy@dcsfen01 JDFTx]$

For each of FFTW3, GSL, LAPACK and LibXC, there is "install" subdirectory where any include files, libs or binary programs would reside. This approach allows you to remove and upgrade any library without impacting other library installs for the JDFTx setup.

Build Instructions for FFTW3.

Download URL: https://www.fftw.org/fftw-3.3.10.tar.gz

Copy tarball onto AiMOS from external system and place in "tars" subdirectory inside of FFTW3. You cannot directly download due to CCI firewall.

Untar command: zcat tars/fftw-3.3.10.tar.gz | tar -x

Change directory to fftw-3.3.10: cd fftw-3.3.10

Autoconf command: ./configure --prefix=/gpfs/u/home/XXXX/XXXXyyyy/barn/JDFTx/FFTW3/install --enable-shared --enable-threads --enable-mpi --enable-vsx

Note, make sure you change your "--prefix" install directory to you project's account path.

Build command: make -j 16

This will spawn a 16-way build and speedup the build process.

Install command: make install

Once complete, all include files, libs and binary programs should be under the FFTW3/install subdirectory.

Build Instructions for GSL.

Download: https://mirror.ibcp.fr/pub/gnu/gsl/gsl-latest.tar.gz

Copy tarball onto AiMOS from external system and place in "tars" subdirectory inside of GSL. You cannot directly download due to CCI firewall.

Untar command: zcat tars/gsl-latest.tar.gz | tar -x

Change directory to gsl-2.7.1: cd gsl-2.7.1

Autoconf command: ./configure --prefix=/gpfs/u/home/XXXX/XXXXyyyy/barn/JDFTx/GSL/install --enable-shared

Note, make sure you change your "--prefix" install directory to you project's account path.

Build command: make -j 16

This will spawn a 16-way build and speedup the build process.

Install command: make install

Once complete, all include files, libs and binary programs should be under the GSL/install subdirectory.

Build Instructions for LAPACK.

Download from AiMOS directly: git clone https://github.com/Reference-LAPACK/lapack-release.git

Place your local git repo inside the LAPACK subdirectory. Next create a "lapack-build" sub-directory inside of LAPACK. Note, you will see a "lapack-release" subdirectory which is the git repo.

Change directory to "lapack-build"

Execute CMake Configure: ccmake ../lapack-release/

A terminal menu will come up. Type the "c" character which will start the cmake configure process. Next, edit the options to look like the set below. In particular, edit your CMAKE_INSTALL_PREFIX for your project's path and turn on the BULD_SHARED_LIBS options.

 BLAS++                           OFF
 BUILD_COMPLEX                    ON
 BUILD_COMPLEX16                  ON
 BUILD_DEPRECATED                 OFF
 BUILD_DOUBLE                     ON
 BUILD_HTML_DOCUMENTATION         OFF
 BUILD_INDEX64                    OFF
 BUILD_MAN_DOCUMENTATION          OFF
 BUILD_SHARED_LIBS                ON
 BUILD_SINGLE                     ON
 BUILD_TESTING                    OFF
 CBLAS                            OFF
 CMAKE_BUILD_TYPE                 Release
 CMAKE_INSTALL_PREFIX             /gpfs/u/home/XXXX/XXXXyyyy/barn/JDFTx/LAPACK/install
 LAPACK++                         OFF
 LAPACKE                          OFF
 LAPACKE_WITH_TMG                 OFF
 USE_OPTIMIZED_BLAS               OFF
 USE_OPTIMIZED_LAPACK             OFF
 USE_XBLAS                        OFF

Once you are done with edits, hit the "c" one more time and then "g" to Generate your build configuration. Then hit "q" to leave.

CMake build command: make -j 16

CMake install command: make install

Once complete, all include files, libs and binary programs should be under the LAPACK/install subdirectory

Build Instructions for LibXC.

Download: https://www.tddft.org/programs/libxc/download/ and then click on "libxc-5.1.7.tar.gz"

Copy tarball onto AiMOS from external system and place in "tars" subdirectory inside of LibXC. You cannot directly download due to CCI firewall.

Untar command: zcat tars/libxc-5.1.7.tar.gz | tar -x

Change directory to libxc-5.1.7: cd libxc-5.1.7

Autoconf command: ./configure --prefix=/gpfs/u/home/XXXX/XXXXyyyy/barn/JDFTx/LibXC/install --enable-shared

Note, make sure you change your "--prefix" install directory to you project's account path.

Build command: make -j 16

This will spawn a 16-way build and speedup the build process.

Install command: make install

Once complete, all include files, libs and binary programs should be under the LibXC/install subdirectory.

Build Instructions for JDTFx.

Download from AiMOS directly: git clone https://github.com/shankar1729/jdftx.git jdftx-git

Creates the "jdftx-git" sub-directory in the top-level JDFTX directory.

Create and change to "jdftx-build" sub-directory: mkdir jdftx-build; cd jdftx-build

Cmake config command: Keep command below on a single line but edit for your lib paths.

cmake -D CMAKE_CXX_FLAGS="-O2 -qstrict -std=c++11" -D GSL_PATH=$HOME/barn/JDFTx/GSL/install -D FFTW3_PATH=$HOME/barn/JDFTx/FFTW3/install -D CBLAS_LIBRARY="$HOME/barn/JDFTx/GSL/install/lib/libgslcblas.so" -D LAPACK_LIBRARIES="$HOME/barn/JDFTx/LAPACK/install/lib64/liblapack.so;/usr/lib64/libblas.so" -D ThreadedBLAS=no -D EnableProfiling=yes -D EnableCUDA=yes -D EnableLibXC=yes -D LIBXC_PATH=$HOME/barn/JDFTx/LibXC/install -D CUDA_ARCH=compute_70 -D CUDA_CODE=sm_70 -D PinnedHostMemory=yes -D CudaAwareMPI=yes -D EnableCuSolver=yes  ../jdftx-git/jdftx
make -j 12

Both "jdftx" and "jdftx_gpu" and other executables are created in the "jdftx-build" subdirectory.

Run JDTFx - allocate a compute node on AiMOS and see: https://jdftx.org/FirstCalc.html for example inputs.