Skip to content

Instantly share code, notes, and snippets.

@mtesseracted
Last active July 20, 2018 21:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtesseracted/88d058b606fb52c325fe946f29256e5f to your computer and use it in GitHub Desktop.
Save mtesseracted/88d058b606fb52c325fe946f29256e5f to your computer and use it in GitHub Desktop.
Configuration for quantum espresso
#!/bin/bash
THISDIR=$(pwd)
if [ -z "$1" ]; then
mode='s' #serial
else
mode='p' #parallel
fi
if [ $mode = "s" ]; then
echo "Running serial mode"
export FC=ifort
export CC=icc
export DFLAGS="-D__WANLIB -D__INTEL -D__FFTW3 -D_Float128=__float128"
else
echo "Running parallel mode"
export FC=mpiifort
export MPIF90=$FC
export CC=mpiicc
export DFLAGS="-D__WANLIB -D__INTEL -D__FFTW3 -D__MPI -D__PARA -D__SCALAPACK -D__OPENMP -D_Float128=__float128"
fi
export F90=ifort
export F77=ifort
export FCFLAGS="-O3 -xAVX -fno-alias -ansi-alias -g -mkl -I$MKLROOT/include/fftw"
export FFLAGS=$FCFLAGS
export CPP="icc -E"
export CFLAGS=$FCFLAGS
export AR=xiar
export BLAS_LIBS=""
export LAPACK_LIBS="-lmkl_intel_lp64"
export FFT_LIBS="-L$MKLROOT/lib/intel64_lin"
if [ $mode = "s" ]; then
./configure
else
./configure --save --enable-openmp --enable-parallel --with-scalapack=intel
fi
#Add wannier90 support to make.inc
#for this to work, after running this config, before anthing else:
#:> make w90
#:> cd W90
#:> make lib
sed -i -e "/^LIBOBJS/a WANLIB = -L$THISDIR/W90 -lwannier" make.inc
l1=$(grep "LIBS =" make.inc)
l2="$l1 \$(WANLIB)"
sed -i -e "s/$l1/$l2/g" make.inc
#make -j3 w90
#cd W90
#make -j3 lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment