# 2.1. Installation¶

The present installation guide describes the necessary steps for installing and tailoring Molcas. It also describes the steps for applying updates whenever necessary.

The installation procedure can be reduced to a few simple steps:

1. Extract the contents of the tar

2. Configure the package

3. Build the package

4. Build GUI and documentation (optional)

5. Make the package generally available

## 2.1.1. Prerequisites¶

### 2.1.1.1. Prerequisite hardware¶

In general, Molcas can be built on any hardware that runs under a UNIX operating system. Some of these variants of hardware and software have been tested by us, and you should not have any problems to install Molcas on any of these. For other platforms you will most likely need to put some extra effort into the installation. In many cases the only effort on your part is setting some compiler flags, paths to system software etc. For a list of the platforms where we have successfully installed Molcas see our homepage: http://www.molcas.org.

To load the executables resident, sufficient memory is required. In addition, the programs are enabled to allocate work space dynamically. To avoid excessive paging we recommend that your machine should be equipped with at least 2 GB of memory per running application. Note, that Molcas will run faster with more memory.

To build Molcas you may need up to 2 GB of free disk space depending on what you choose to install and how (e.g. CMake keeps the object files around). The actual size of a Molcas installation is around 300-600 MB. To run the verification tests of Molcas you should have a scratch disk with up to 1 GB of free disk space, depending on the suite you run. For the “small” set about 400 MB will suffice. To perform larger calculations, ample amount of scratch disk space is necessary. The exact amount varies with the type of systems studied, but a general recommendation is at least 4 GB of disk space, per production run.

### 2.1.1.2. Prerequisite software¶

If you obtain the source code of Molcas, then you need to make certain that the necessary software is available to build Molcas. The minimum requirements are:

Also, you can benefit from following optional dependencies:

• CMake (version 2.8.11 or higher, recommendeded for easier configuration)

• an optimized BLAS/LAPACK library (alternative for the slow built-in library based on Netlib)

• MPI-2 (to enable parallelization features of Molcas)

• Global Arrays (version 5 or higher, an alternative to the built-in DGA library)

Warning

The DGA library is not available in OpenMolcas.

The Graphical User Interface codes in Molcas require additional software, including OpenGL and glut library. However, in most of the cases there is no need to install these libraries, since executables for GUI are included into the distribution, or they can be downloaded from Molcas webpage (http://www.molcas.org).

In order to get TaskFarm working, the following packages should be installed on your system:

• Debian/Ubuntu: libipc-shareable-perl, libparallel-forkmanager-perl

• RedHat/CentOS: perl-IPC-Shareable, perl-Parallel-ForkManager

cd $HOME/molcas /sw/molcas_dist/configure -speed safe  The list all the options for configure, run ./configure -help  ### 2.1.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.1.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 2.2). • 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.1.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 -j4  Any other configurations can be easily derived from the above by simply removing the unneeded optional stuff. #### 2.1.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_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 -j4


## 2.1.3. Building Molcas¶

When the configuration step (Section 2.1.2) is completed successfully, you can build Molcas. This is simply done by typing make in the Molcas root directory. It is recommended that you save the output from make in a log file for tracing of potential problems.

make > make.log 2>&1


In order to speed up the build process, you can perform a parallel compilation. When you configure Molcas with CMake, a simple

make -jN


will suffice, while if you configured Molcas with the configure script, you need to build in two steps:

make -jN build
make install


In the above commands, N should be replaced with the number of threads you wish to use for building. Typically, a number equal to the number of cores will be fine.

When Molcas is being compiled some compilers give a lot of warnings. These are not serious in most cases. We are working on eliminating them, but the job is not yet completely finished.

After Molcas has been built correctly, you should absolutely run a basic verification to ensure that the installation is sane. See the next section for details on verification.

### 2.1.3.1. Verifying the Molcas installation¶

After a successful build of Molcas you should verify that the various modules run correctly. Directory test/ contains various subdirectories with test inputs for Molcas. Use the command molcas verify [parameters] to start verification. Running this command without parameters will check the main modules and features of Molcas and we recommend this default for verifying the installation. You can also specify a keyword as argument that translates into a sequence of test jobs, or you can specify a list of test jobs yourself. The script has extended documentation, just run molcas verify –help.

To generate a report after performance tests you should execute a command molcas timing. The report is then located in the file test/timing/user.timing. The results of benchmark tests for some machines are collected on our webpage http://www.molcas.org/benchmark.html At the completion of the test suite a log of the results is generated in the file test/results. If installation was performed by another user (e.g. root), you can redefine the location of output files by adding the flag -path PATH. Each test job is signaled as either ok of failed. If there are any failed jobs, the outputs are saved in Test/Failed_Tests. Each test job tests for a resulting checksum for the modules tested. This checksum is typically the energy for a wavefunction program such as RASSCF, whereas other types of codes use other checksums.

The checksums will not match exactly with our reference values since different machines use different arithmetics. We have tried to make the acceptable tolerances as small as possible and at the same time make all tests pass successfully. It might be the case that your particular platform will produce one or more results that are just outside our tolerances, and in such a case the test is most likely ok.

## 2.1.4. GUI and documentation¶

Normally, there is no need to build the GUI used in Molcas, since we provide executables for most common platforms. You can download executables for the GUI from the Molcas webpage (http://www.molcas.org).

In order to build documentation in various formats, use the command make doc. Alternatively the documentation is also available no the web page (http://www.molcas.org).