nextuppreviouscontentsindex
MOLCAS manual:

Next: 2.3 Building MOLCAS Up: 2. Installation Previous: 2.1 Prerequisites

Subsections



2.2 Configuring MOLCAS

Before you can build MOLCAS you have to configure it. Most common platforms have been setup by the MOLCAS developers, so for a serial installation with default settings for compiler and compiler flags configuration of MOLCAS can be done without specifying any special extra options.

There are two ways to configure MOLCAS: using the configure script (alternative 1) or using cmake (alternative 2). The latter is more recent and does not support all the original platforms, but it supports most commonly used environments and is easier as it is usually able to autodetect the necessary libraries. The CMake alternative also makes it easier to synchronize different installations based on the same source. Therefore, we recommend you to use alternative 2. If you are already familiar with building MOLCAS 8.0 or an earlier version, it might be easier to keep using alternative 1, as you can then port your exisiting configuration options. Note that for certain external software (e.g. DMRG), CMake is mandatory, and thus alternative 2 is needed.

For new users, use of the setup script is recommended.

2.2.1 Simple configuration with the setup script

If you are new to building MOLCAS, it is recommended that you use the setup script to configure MOLCAS. Advanced users and/or users that need further customization should skip this section and use one of the alternatives in the next sections to configure MOLCAS.

The setup script will prompt you interactively about the most important settings. To get started, first unpack the MOLCAS source and then run:

./setup
in the main MOLCAS directory. Answer the questions and then proceed to section [*] to build MOLCAS.

2.2.2 Advanced configuration with the configure script (alternative 1)

You can start the configuration by running the configure script:

./configure

To know which flags can be used, run ./configure -h. The above command (without any flags) will use a default configuration, i.e. a serial MOLCAS installation using built-in BLAS/LAPACK.

When configuration is finished, you should review the log file configure.log to see if everything is ok. There is no harm in running the configuration script even if it should fail, you simply rerun it with correct parameters.

If the configuration step was not successful, you probably are missing some prerequisite software, or this software is located in an unusual location on the disk. In the later case you might need to update your PATH, or use flag -path in configure.

MOLCAS supports out-of-source installation. If for some reason, you would like to install molcas under a separate tree, you can create a directory, and call configure with appropriate flags, e.g.

mkdir $HOME/molcas
cd $HOME/molcas
/sw/molcas_dist/configure -speed safe

The list all the options for configure, run

./configure -help

2.2.3 Advanced configuration with CMake (alternative 2)

Start configuration by creating a build directory and then running the cmake program with the location of the MOLCAS source. You can create the build directory as a subdirectory of the MOLCAS root directory, but we recommend you create it outside. For example, suppose the MOLCAS root is located at molcas in your home directory and you want to build it at molcas-build:

mkdir ~/molcas-build
cd ~/molcas-build/
cmake ~/molcas/

After the first run, CMake keeps a cache of the configuration around as a file CMakeCache.txt. If you want to change certain options (e.g. use a different compiler), you need to remove this file first. As an example, if we wish to reconfigure with the intel compilers instead we do:

rm CMakeCache.txt
CC=icc FC=ifort cmake ~/molcas/

Once the cache file is there, subsequent additional options do not require pointing to the MOLCAS source, just to the build directory itself. Here we add an option to build parallel MOLCAS:

cmake -DMPI=ON .

When using MPI, CMake will pick up the correct compiler and MPI library from the wrappers. So if you configure with MPI or you later wish to use a different MPI library/compiler wrapper, it is better to remove the cache file first, then (re)configure pointing to the wrappers:

rm CMakeCache.txt
CC=mpicc FC=mpifort cmake -DMPI=ON ~/molcas/

2.2.3.1 Summary of main options for CMake

To see all the CMake options, you can run the ccmake command to interactively select the options and their values. The following is a list of some of the most important options.

  • BUILD_SHARED_LIBS -- (ON/OFF): Enable building shared libraries (reduced disk space).

  • CMAKE_BUILD_TYPE -- (Debug/Garble/RelWithDebInfo/Release/Fast): Normally use Release. RelWithDebInfo may be useful for reporting a problem. Fast in unsupported and may give wrong results in some cases.

  • CMAKE_INSTALL_PREFIX -- Specify the directory where MOLCAS will be installed when running make install.

  • GA -- (ON/OFF): Enable interface with Global Arrays (see section [*]).

  • HDF5 -- (ON/OFF): Enable HDF5 files (portable binary format) in some programs.

  • LINALG -- (Internal/Runtime/MKL/ACML/OpenBLAS): Select the linear algebra library (BLAS + LAPACK) against which to link MOLCAS. Internal uses the default (and slow) Netlib version included with MOLCAS. Runtime (experimental) offers the possibility of choosing the library at run time.

  • MPI -- (ON/OFF): Enable multi-process parallelization.

  • OPENMP -- (ON/OFF): Enable multi-thread parallelization (usually restricted to using a multi-threaded version of linear algebra libraries.

  • TOOLS -- (ON/OFF): Compile the tools that have CMake support.

2.2.3.2 Example 1: GCC C/Fortran compilers with GA/OpenMPI and OpenBLAS

  • 64-bit Linux OS
  • MPI preinstalled (install OpenMPI or MPICH with package manager)

    # OpenBLAS
    tar zxvf OpenBLAS-v0.2.15.tar.gz
    cd OpenBLAS-0.2.15/
    make USE_OPENMP=1 NO_LAPACK=0 INTERFACE64=1 BINARY=64 DYNAMIC_ARCH=1 \
          libs netlib shared
    [sudo] make PREFIX=/opt/openblas-lapack-ilp64 install
    # GA
    tar zxvf /path/to/ga-5-4b.tgz
    cd ga-5-4b/
    ./configure --enable-i8 --with-blas8 --with-lapack8 --with-scalapack8 \
          --prefix=/opt/ga54b-ilp64.OpenMPI
    make
    [sudo] make install
    # Molcas
    tar zxvf molcas.tgz
    cd molcas
    mkdir build && cd build/
    export GA=/opt/ga54b-ilp64.OpenMPI
    export OPENBLASROOT=/opt/openblas-lapack-ilp64
    CC=mpicc FC=mpifort cmake -DMPI=ON -DGA=ON -DLINALG=OpenBLAS ../
    make

Any other configurations can be easily derived from the above by simply removing the unneeded optional stuff.

2.2.3.3 Example 2: Intel C/Fortran compilers with GA/IntelMPI and MKL

  • 64-bit Linux OS
  • Intel Compilers/MPI preinstalled (usually on a cluster as a module)
  • Infiniband (OpenIB)

    # make sure Intel compilers/MPI are loaded
    module load ...
    # check compilers/environment
    type mpiicc
    type mpiifort
    echo $MKLROOT
    # GA
    tar zxvf /path/to/ga-5-4b.tgz
    cd ga-5-4b/
    ./configure --prefix=/opt/ga54b-ilp64.IntelMPI --enable-i8     \
                --with-openib --with-blas8="-L$MKLROOT/lib/intel64 \
                -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core    \
                -liomp5 -lpthread -lm"                             \
                --with-scalapack8="-L$MKLROOT/lib/intel64          \
                -lmkl_scalapack_ilp64 -lmkl_intel_ilp64            \
                -lmkl_intel_thread -lmkl_core                      \
                -lmkl_blacs_intelmpi_ilp64 -liomp5 -lpthread -lm"
    make
    [sudo]make install
    # Molcas
    tar zxvf molcas.tgz
    cd molcas
    mkdir build && cd build/
    export GA=/opt/ga54b-ilp64.IntelMPI
    CC=mpiicc FC=mpiifort cmake -DMPI=ON -DGA=ON -DLINALG=MKL ../
    make


next up previous contents index
Next: 2.3 Building MOLCAS Up: 2. Installation Previous: 2.1 Prerequisites