Install Yambo on Ubuntu/LinuxMint with Intel compiler: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
No edit summary
No edit summary
 
(26 intermediate revisions by the same user not shown)
Line 6: Line 6:
* [https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html#inpage-nav-11-5 Intel MKL libraries].
* [https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html#inpage-nav-11-5 Intel MKL libraries].


Now that you have installed all packages necessary to compile yambo, you can setup the Intel environment.
If you use the bash/sh shell just do:


source /opt/intel/oneapi/setvars.sh


  source /opt/intel/oneapi/setvars.sh
now all intel compilers and libraries will be in your path, you are ready to install Yambo.
export MKL_LIBS="-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl"
The Yambo configure automatically recognize BLAS, LAPACK and FFT from MKL, you have just to specify
export MKL_INCLUDE="-I${MKLROOT}/include"
to use MKL also for BLACS and SCALAPACK.
export MKL_SCALAPACK=" ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a
 
  ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl"
  ./configure CC=icx MPICC=mpiicx MPIFC=mpiifort MPIF77=mpiifort FC=ifort F77=ifort --enable-open-mp --enable-par-linalg --with-scalapack-libs=mkl --with-blacs-libs=mkl --enable-slepc-linalg
 
finally compile the code with:
make core
 
<span style="color:red">Nota bene</span>: every time you compile or use yambo, you have to load the Intel variables with the command: '''source /opt/intel/oneapi/setvars.sh'''
 
If you have problems compiling PetSC and Slepc inside Yambo you can download them separately, configure and compile them and the link the libraries with Yambo.<br><br>
'''for PetSC:'''
  Download last version, for example:
 
  wget https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.21.2.tar.gz
  tar zxvf petsc-3.21.2.tar.gz
  cd petsc-3.21.2
  export PETSC_DIR=$PWD
  export PETSC_ARCH=linux-opt
  <span style="color:blue">export INSTALL_DIR=/home/attacc/local_single</span>  # where you want to install the libraries
  ./configure --prefix=${INSTALL_DIR} CC=mpiicx CXX=mpiicx FC=mpiifx --with-blas-lapack-dir=${MKLROOT} --with-scalapack-dir=${MKLROOT} --with-precision=single
  make  
  make install
 
Notice that if you use Yambo_nl you have to compile the libraries in double-precision
 
'''for the SlePC:'''
  wget https://slepc.upv.es/download/distrib/slepc-3.21.1.tar.gz
  cd slepc-3.21.1/
  export SLEPC_DIR=$PWD
  ./configure --prefix=${INSTALL_DIR}
  make
  make install


'''and then use them in Yambo:'''


  ./configure FC=mpiifort F77=mpiifort  --enable-open-mp --enable-par-linalg --enable-hdf5-par-io \
  ./configure CC=icx MPICC=mpiicx MPIFC=mpiifort MPIF77=mpiifort FC=ifort F77=ifort --enable-open-mp --enable-par-linalg --with-scalapack-libs=mkl --with-blacs-libs=mkl \
--with-blas-libs="$MKL_LIBS" --with-lapack-libs="$MKL_LAPACK" \
  --enable-slepc-linalg --with-petsc-path="${INSTALL_DIR}" --with-slepc-path="${INSTALL_DIR}"
--with-fft-libs="$MKL_LIBS" --with-fft-includedir="$MKL_INCLUDE" \
--with-scalapack-libs="$MKL_SCALAPACK" --with-blacs-libs="$MKL_SCALAPACK" \
--enable-slepc-linalg

Latest revision as of 12:13, 11 June 2024

The Intel compiler are freely available on Linux machines.
From the Intel oneAPI page, download and install:

Now that you have installed all packages necessary to compile yambo, you can setup the Intel environment. If you use the bash/sh shell just do:

source /opt/intel/oneapi/setvars.sh

now all intel compilers and libraries will be in your path, you are ready to install Yambo. The Yambo configure automatically recognize BLAS, LAPACK and FFT from MKL, you have just to specify to use MKL also for BLACS and SCALAPACK.

./configure CC=icx MPICC=mpiicx MPIFC=mpiifort MPIF77=mpiifort FC=ifort F77=ifort --enable-open-mp --enable-par-linalg --with-scalapack-libs=mkl --with-blacs-libs=mkl --enable-slepc-linalg

finally compile the code with:

make core

Nota bene: every time you compile or use yambo, you have to load the Intel variables with the command: source /opt/intel/oneapi/setvars.sh

If you have problems compiling PetSC and Slepc inside Yambo you can download them separately, configure and compile them and the link the libraries with Yambo.

for PetSC:

 Download last version, for example:
 wget https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.21.2.tar.gz
 tar zxvf petsc-3.21.2.tar.gz
 cd petsc-3.21.2
 export PETSC_DIR=$PWD
 export PETSC_ARCH=linux-opt
 export INSTALL_DIR=/home/attacc/local_single   # where you want to install the libraries
 ./configure --prefix=${INSTALL_DIR} CC=mpiicx CXX=mpiicx FC=mpiifx --with-blas-lapack-dir=${MKLROOT} --with-scalapack-dir=${MKLROOT} --with-precision=single 
 make  
 make install

Notice that if you use Yambo_nl you have to compile the libraries in double-precision

for the SlePC:

 wget https://slepc.upv.es/download/distrib/slepc-3.21.1.tar.gz
 cd slepc-3.21.1/
 export SLEPC_DIR=$PWD
 ./configure --prefix=${INSTALL_DIR} 
 make 
 make install 

and then use them in Yambo:

./configure CC=icx MPICC=mpiicx MPIFC=mpiifort MPIF77=mpiifort FC=ifort F77=ifort --enable-open-mp --enable-par-linalg --with-scalapack-libs=mkl --with-blacs-libs=mkl \
 --enable-slepc-linalg --with-petsc-path="${INSTALL_DIR}" --with-slepc-path="${INSTALL_DIR}"