Rate This Document
Findability
Accuracy
Completeness
Readability

Compilation and Installation

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Set the environment variables.
    export MPI_HOME=/path/to/HMPI
    export CPPFLAGS=" -I/path/to/HDF5/include -I/path/to/PNETCDF/include -I/path/to/NETCDF/include -I$MPI_HOME/include"
    export CFLAGS=" -I/path/to/HDF5/include -I/path/to/PNETCDF/include -I/path/to/NETCDF/include -I$MPI_HOME/include "
    export CXXFLAGS=" -I/path/to/HDF5/include -I/path/to/PNETCDF/include -I/path-to/NETCDF/include -I$MPI_HOME/include "
    export FCFLAGS=" -I/path/to/HDF5/include -I/path/to/PNETCDF/include"
    export FFLAGS=" -I/path/to/HDF5/include -I/path/to/PNETCDF/include"
    export LDFLAGS=" -L/path/to/HDF5/lib -L/path/to/PNETCDF/lib -L/path/to/PNETCDF/lib"
  3. Create an extral directory for storing third-party math libraries.
    cd /path/to/ABINIT
    mkdir extral
  4. Download the AtomPAW, BigDFT, LibXC, and Wannier90 installation packages.

    https://www.abinit.org/fallbacks

    • AtomPAW: atompaw-4.0.1.0.tar.gz
    • BigDFT: bigdft-1.7.1.25.tar.gz
    • LibXC: libxc-3.0.0.tar.gz
    • Wannier90: wannier90-2.0.1.1.tar.gz
  5. Use an SFTP tool to upload the downloaded installation packages to the extral directory.
  6. Decompress the installation packages.
    cd extral
    tar -xzvf atompaw-4.0.1.0.tar.gz
    tar -xzvf bigdft-1.7.1.25.tar.gz
    tar -xzvf libxc-3.0.0.tar.gz
    tar -xzvf wannier90-2.0.1.1.tar.gz
  7. Return to /path/to/ABINIT and decompress the ABINIT installation package.
    cd /path/to/ABINIT
    tar -zxvf abinit-8.10.3.tar.gz
  8. Go to the directory generated after the decompression.
    cd abinit-8.10.3
  9. Create and access the directory for compiling the ABINIT software.
    mkdir build
    cd build
  10. Perform the configuration.
    ../configure FC=mpif90 --with-mpi-prefix=/path/to/HMPI/ --with-dft-flavor="libxc+atompaw" --with-trio-flavor="netcdf" --with-tardir=/path/to/ABINIT/extral --with-netcdf-incs="-I/path/to/NETCDF/include" --withnetcdf-libs="-L/path/to/NETCDF/lib -lnetcdf -L/path/to/NETCDF/lib -lnetcdff" FCFLAGS="-g -O2 -ffree-line-length-none" --with-linalg-libs="-L/path/to/OPENBLAS/ -lopenblas" CFLAGS="-O2"
  11. Modify the configuration file.
    sed -i -e "s/shiftr/rshift/g" src/78_effpot/m_random_xoroshiro128plus.F90
    sed -i -e "s/shiftl/lshift/g" src/78_effpot/m_random_xoroshiro128plus.F90
  12. Go to the ABINIT directory.
    cd /path/to/ABINIT/abinit-8.10.3
  13. Modify the configuration file.
    sed -i 's/#define HAVE_FC_INT_QUAD 1/#undef HAVE_FC_INT_QUAD/' config.h
    sed -i 's/#define HAVE_FC_LONG_LINES 1/#undef HAVE_FC_LONG_LINES/' config.h
    sed -i 's/#define atomic_mass_units/at_mass_units/' src/77_ddb/m_phonons.F90
    sed -i 's/#define number_of_atom_species/n_atom_species/' src/77_ddb/m_phonons.F90
    sed -i 's/alpha = 0.2/!alpha = 0.2/' src/78_eph/m_phgamma.F90
  14. Modify the src/56_io_mpi/m_hdr.F90 file.
    1. Open the src/56_io_mpi/m_hdr.F90 file.
      vi src/56_io_mpi/m_hdr.F90
    2. Press i to enter the edit mode and change integer,public,parameter :: HDR_LATEST_HEADFORM = HDR_KNOWN_HEADFORMS(size(HDR_KNOWN_HEADFORMS)) to the following content:
      integer,private,parameter :: HDR_KNOWN_HEADFORMS(1) = [123]
      integer,public,parameter :: size_hdr_known_headforms = size(HDR_KNOWN_HEADFORMS)
      integer,public,parameter :: HDR_LATEST_HEADFORM = HDR_KNOWN_HEADFORMS(size_hdr_known_headforms)
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  15. Modify the src/62_iowfdenpot/m_io_screening.F90 file.
    1. Open the src/62_iowfdenpot/m_io_screening.F90 file.
      vi src/62_iowfdenpot/m_io_screening.F90
    2. Press i to enter the edit mode and change integer,private,parameter :: HSCR_KNOWN_HEADFORMS(1) = [80] to the following content:
      integer,private,parameter :: HSCR_KNOWN_HEADFORMS(1) = [123]
      integer,private,parameter :: size_hscr_known_headforms = size(HSCR_KNOWN_HEADFORMS)
      integer,public,parameter :: HSCR_LATEST_HEADFORM = HSCR_KNOWN_HEADFORMS(size_hscr_known_headforms)
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  16. Perform the compilation and installation.
    FC=mpif90 CC=mpicc CXX=mpicxx make multi multi_nprocs=32

    The multi_nprocs parameter indicates the number of cores for concurrent compilation. You can set this parameter based on the number of cores and application requirements. You are advised not to perform concurrent compilation for the initial compilation.

    When you run compilation commands, the "unable to open MODULE file *.mod" error may be reported due to the path problem. Resolve this problem as follows:

    Copy the .mod file to the incs directory, and then perform the compilation and installation. The .mod file is continuously generated during the compilation. Therefore, the .mod file needs to be copied for multiple times. If you do not want to perform the copy operation for multiple times, create a script. For example:
    1. Create a script.
      vi cp.sh
    2. Press i to enter the edit mode and edit the file as follows:
      #!/bin/bash
       
      for i in `find -name *.mod`
      do
               cp $i src/incs
      done
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Execute the script.
      ./cp.sh
  17. Add the environment variables.
    export ABI_TESTS=/path/to/ABINIT/abinit-8.10.3/tests/
    export ABI_TUTORIAL=$ABI_TESTS/tutorial/
    export ABI_TUTORESPFN=$ABI_TESTS/tutorespfn/
    export ABI_TUTOPARAL=$ABI_TESTS/tutoparal/
    export ABI_TUTOPLUGS=$ABI_TESTS/tutoplugs/
    export ABI_PSPDIR=$ABI_TESTS/Psps_for_tests/
    export PATH=/path/to/ABINIT/abinit-8.10.3/build/src/98_main/:$PATH