This requires a bit of hacking. Not all of the following may be necessary, or even the right thing to do (you’re supposed to fiddle with some preliminary files in the install directory) but this is a recipe that
worked for me.

module load scalapack

cd ~/espresso

./configure

This will create ~/espresso/make.sys, in which you should change the
following things (again, these may not all be necessary but I couldn’t be bothered to check):MPIF90 = mpixlf90
#F90 = /opt/ibmcmp/xlf/bg/14.1/bin/bgxlf90_r
CC = /opt/ibmcmp/vacpp/bg/12.1/bin/bgxlc_r
F77 = /opt/ibmcmp/xlf/bg/14.1/bin/bgxlf_rtoMPIF90 = mpixlf90_r
CC = mpixlc_r
F77 = mpixlf77_rLD = /opt/ibmcmp/vacpp/bg/12.1/bin/bgxlc_r -qarch=qp -qtune=qptoLD = mpixlf90_r -qarch=qp -qtune=qpLD_LIBS =toLDLIBS = -L/opt/ibmcmp/xlf/bg/14.1/lib64 -lxlopt -lxl -lxlf90_r -lxlfmath– and the Blas/Lapack libs should be changed from whatever they are toBLAS_LIBS = -L/bgsys/ibm_essl/prod/opt/ibmmath/essl/5.1/lib64/ -lesslbg
BLAS_LIBS_SWITCH = externalLAPACK_LIBS = -L/bgsys/ibm_essl/prod/opt/ibmmath/essl/5.1/lib64/ \
-L/gpfs/packages/ibm/lapack/3.4.2/lib -lesslbg -llapack
LAPACK_LIBS_SWITCH = externalNote that the 3.4.2 version of the lapack directory might have changed by the time you come to read this – check this exists and has liblapack.a in it.