From Jiahao's lab notebook
Jump to: navigation, search



Official website

Compiling and installing from scratch

Compiling Molpro from source is a rather intricate process. Here's what worked for me. Last tested: Molpro 2012.1, Intel 13.0 compilers (Composer 2013), OpenMPI 1.4.2, Global Arrays 5.1.1

1. Compile Global Arrays

If you need to compile Global Arrays, it is quite important to check that the configure script picked up exactly the BLAS, LAPACK, ScaLAPACK libraries you want and the compilers you want. http

Intel compiler hints

1. If you are compiling with MPICH2, check which compilers ./configure picks up! It doesn't always pick up the correct MPI compiler, so you may wish to set them manually:

export MPICH_CC=icc
export MPICH_CXX=icc
export MPICH_F77=ifort
export MPICH_F90=ifort

2. Make sure you set the environment! For example, run the environment variable script in, say:


3. Get a valid link line for the Math Kernel Library (MKL) from the Link Line Advisor.

4. Run configure with the link line specified manually. For example:

#This comes from the MKL Link Line Advisor
MKL_LINK_LINE="-L$MKLROOT/lib/intel64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 \
    -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_ilp64 -lpthread -lm"
./configure --enable-cxx --enable-shared --with-pic \
    --with-blas8="$MKL_LINK_LINE" \
    --with-lapack="$MKL_LINK_LINE" \

5. Make sure that configure finds the MKL BLAS library. The BLAS_LIB flag should be set to $MKL_LINK_LINE or something similar. If not, it has either latched on to some other BLAS library or (worse) is planning to compile its internal version. I have found that NOT all valid link lines work with Global Arrays.

2. Compile Molpro

1. If you are compiling Molpro from a tarball, it is easier to retry when you do an out-of-place build, especially on a slow filesystem. To set this up, run:

tar zxf molpro-nightly.tar.gz
mkdir Molpro-build
cp -alr Molpro{,-build}

This will create a build directory, Molpro-build, that contains hard symlinks to every existing file in the Molpro directory tree. You can then proceed to compile Molpro in the Molpro-build directory. If you mess up and need to start again, you can simply create a new build directory and try again.

2. If you had to compile Global Arrays manually, don't forget to specify where you compiled it with the -mppbase <dir> option to configure.

3. For best performance, run make on a compile node, make tuning on a compute node, then finally install on the head node with make install.

Intel compiler hints

1. Molpro's configure doesn't always detect MKL correctly, particularly the new versions. You can make sure this is done by specifying the MKL Line Line in BLASLIB and LAPACKLIB, e.g.


2. Molpro 2012.1 does not quite compile correctly with Intel 13.0 compilers. I have found success in reducing the optimization level for files that segfault when you compile them. In the CONFIF file, add the files that don't compile on -O3 to one of the files hard-coded to use lower-level optimization levels and try again, e.g.

OPT1=... ri_utils.F ri_utils_sapt.F giao_utils.F
Personal tools