Elk FP-LAPW on Ubuntu

Last modified by Xwiki VePa on 2024/02/07 07:36

This guide will help the user understand how to compile, install, and use ELK on their own Ubuntu workstation. If you are using another platform, please refer to the appropriate documentation or contact Benjamin Alldritt for assistance.

Step-by-step guide

Requirements

To compile Elk, you will need the following software:

  • Fortran compiler (gfortran)
  • C compiler (gcc)
  • MPI
  • FFTW
  • LAPACK
  • BLAS
  • Libxc

Instructions

Ubuntu 12.04 (64 bit)

  1. Install the required packages:

    sudo apt-get install gfortran libmpich2-dev liblapack-dev libblas-dev libfftw3-dev
  2. Download the latest version of the Elk source code and unpack into a new directory.

    mkdir ${HOME}/software
    mkdir ${HOME}/software/elk
    cd ${HOME}/software/elk
    wget -O elk-2.3.22.tgz http://sourceforge.net/projects/elk/files/elk-2.3.22.tgz/download
    tar -xvzf elk-2.3.22.tgz
  3. Download the latest version of the Libxc source code and unpack into a new directory.

    mkdir ${HOME}/software/libxc
    cd ${HOME}/software/libxc
    wget libxc-2.2.0.tar.gz http://www.tddft.org/programs/octopus/download/libxc/libxc-2.2.0.tar.gz
    tar -xvzf libxc-2.2.0.tar.gz
    cd libxc-2.2.0
  4. Configure, build, and install Libxc.

    ./configure --prefix=${HOME}/software/libxc LIBS=-lm
    make 
    make install 
  5. Create a file with the name make.inc and copy the following into the empty file

    cd ${HOME}/software/elk/elk-2.3.22
    nano make.inc 
    # make.inc - Ubuntu 12.04 64 bit
    # Compiler Flags
    MAKE = make
    F90 = mpif90
    F90_OPTS = -O3 -m64 -ffast-math -funroll-loops -fopenmp
    F77 = mpif90
    F77_OPTS = -O3 -m64 -ffast-math -funroll-loops -fopenmp
    AR = ar
    LIB_SYS =

    # LAPACK and BLAS library locations
    LIB_LPK = lapack.a blas.a

    # MPI Settings
    SRC_MPI =

    # FFTW Settings
    SRC_FFT = zfftifc_fftw.f90
    LIB_FFT = -L/usr/lib -lfftw3_threads -lfftw3

    # LibXC Settings
    LIB_libxc = ${HOME}/software/libxc/lib/libxcf90.a ${HOME}/software/libxc/lib/libxc.a
    SRC_libxc = libxc_funcs.f90 libxc.f90 libxcifc.f90
  6. Compile, test, and run Elk.

    make
    make test
    ./src/elk <input file> 

Ubuntu 14.04 (64 bit)

  1. Install the required packages:

    sudo apt-get install gfortran libmpich2-dev liblapack-dev libblas-dev libfftw3-dev libxc-dev
  2. Download the latest version of the Elk source code and unpack into a new directory.

    mkdir ${HOME}/software
    mkdir ${HOME}/software/elk
    cd ${HOME}/software/elk
    wget -O elk-2.3.22.tgz http://sourceforge.net/projects/elk/files/elk-2.3.22.tgz/download
    tar -xvzf elk-2.3.22.tgz
  3. Download the latest version of the Libxc source code and unpack into a new directory.

    mkdir ${HOME}/software/libxc
    cd ${HOME}/software/libxc
    wget libxc-2.2.0.tar.gz http://www.tddft.org/programs/octopus/download/libxc/libxc-2.2.0.tar.gz
    tar -xvzf libxc-2.2.0.tar.gz
    cd libxc-2.2.0
  4. Configure, build, and install Libxc.

    ./configure prefix=${HOME}/software/libxc LIBS=-lm
    make 
    make install 
  5. Create a file with the name make.inc and copy the following into the empty file

    cd ${HOME}/software/elk/elk-2.3.22
    nano make.inc 
    # make.inc - Ubuntu 14.04 64-bit
    # Compiler Flags
    MAKE = make
    F90 = mpif90
    F90_OPTS = -O3 -m64 -ffast-math -funroll-loops -fopenmp
    F77 = mpif90
    F77_OPTS = -O3 -m64 -ffast-math -funroll-loops -fopenmp
    AR = ar
    LIB_SYS =
    # LAPACK and BLAS library locations
    LIB_LPK = lapack.a blas.a
    # MPI Settings
    SRC_MPI =
    # FFTW Settings
    SRC_FFT = zfftifc_fftw.f90
    LIB_FFT = -L/usr/lib/x86_64-linux-gnu -lfftw3_threads -lfftw3
    # LibXC Settings
    LIB_libxc = ${HOME}/software/libxc/lib/libxcf90.a ${HOME}/software/libxc/lib/libxc.a
    SRC_libxc = libxc_funcs.f90 libxc.f90 libxcifc.f90 
  6. Compile, test, and run Elk.

    make
    make test
    ./src/elk <input file> 

 

Elk does not appear to like directory references when handling input files. You can copy Elk to a different location and run the files together or Elk can be run from another location if you are in the same directory of the program. At the moment, it is not clear why the program behaves this way.

On Ubuntu 14.04, Test 13 fails completely, but all other tests pass. This information is being communicated to the developers.

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.

Unknown macro: contentbylabel. Click on this message for details.