El Capitan drinks Quantum Espresso

To compile a slow version of quantum espresso for an iMac: i) Download last version, and extract somewhere. ii), use this script, "qe_conf.sh":

FL="-L/opt/local/lib -lfftw3"
LAPACK_LIBS="-L/lapack-folder -llapack -lrefblas"
BLAS_LIBS="-L/lapack-folder -lrefblas"

./configure CC=$CC F77=$F77 LAPACK_LIBS="$LAPACK_LIBS" \
  BLAS_LIBS="$BLAS_LIBS" FFT_LIBS="$FL" --enable-openmp

If you don't have fftw libs type in a terminal "sudo port install fftw-3". Follow the steps from previous post to get consistent mpi commands. iii), Build your module typing "make X", where X = pw, ph, pwcond, etc. Note: There is an ATLAS package that can be installed with port, but I don't know yet how much it will speed up the computations. 

NWChem in El Capitan

I installed it in a mid 2011 iMac, and used gcc compilers. First, get the right compilers (or make sure gcc5, or alike, is installed). 

sudo port install gcc5 +gfortran+universal 

(I needed to make symbolic links in /opt/local/bin for gfortran, gcc, g++, and cpp. Port installs them as gsomething-mp-5). Also make sure you have mpich. If not, type 

sudo port install mpich-gcc5


sudo port select --set mpi mpich-gcc5-fortran

This last step is to use the mpi commands linked to gcc, instead of clang.

Download nwchem-6.6 from here, and extract the .tar.gz file into some folder. The environmental variables are:

export NWCHEM_TOP=`pwd`
export NWCHEM_MODULES="all"
export USE_MPI="y"
export USE_MPIF="y"
export USE_MPIF4="y"
export LIBMPI=" -lmpifort -lmpi -lpmpi -lpthread"
export BLASOPT=" "
export FC=gfortran
export CC=gcc

To compile:

cd $NWCHEM_TOP/src
make nwchem_config


All these variables and make commands can be written into a my_comp.sh file and just be run as "sh my_comp.sh". I ran some QA tests and they looked fine. Finally, note that blasopt is empty. NWChem uses its internal BLAS. I tried to compile ATLAS to get optimize libraries but failed in the attempt :_(   Apparently, ATLAS has some issues working with Apple machines from Hell.

Deleting Native Apps in Mac OS X

I like to keep my mac laptop with minimal number of apps. El Capitan comes with an additional protection feature that does not let you delete native apps. The solution is to reboot the computer, while the screen is dark hold command+r to enter recovery mode. Once there open a terminal and type "csrutil disable". Then restart, find the app, change its permissions, and delete; you could also do this by entering the applications folder and typing "rm -rf /Applications/dying.app". Then go back to recovery mode, open a terminal and type "csrutil enable" to reactivate the feature.

Finding Cutoffs for Quantum Espresso Calculations

Critical numbers to check before running plane-wave calculations are the kinetic energy and density cut-offs. I found a useful guide to check these cutoffs, http://larrucea.eu/checking-optimum-cutoff-qe/. I uploaded a copy here. The script needs the location of the pseudopotential file and the executable, pw.x, location. One can modify the script, for example changing the numbers in the list of trial cutoffs to search for the best numbers. For ultrasoft potentials I guess one has to make sure the density cutoffs are high enough so the calculations for the last values in the list of kinetic energy cutoffs are reliable enough. [Update: the new QE library based on rrkjus pseudopotentials includes the cut-offs]