Compiling TURBOMOLE

Set up of the environment

It is stronlgy recommended that you use the machine billund to compile with an up to date version of ifort or gfortran. On this machine we maintain the compilers and config files that are needed to compile the TURBOMOLE package.

Copy the following section into your own ~/.bash_profile:

  # ensure that short version of the host name is exported in $HOSTNAME
  export HOSTNAME=`hostname -s`

  #######################################################################################
  # special settings only active on billund
  #######################################################################################
  if [ "$HOSTNAME" == "billund" ]; then 

    ###################################################################################
    # load settings for version 19 of the intel compilers
    ###################################################################################
    module load TM-compile/ifort19

    ###################################################################################
    # load settings for version 9 of the Gnu compilers 
    # (needed for some C and C++ code, but also if you want to compile with gfortran)
    ###################################################################################
    source /opt/rh/gcc-toolset-9/enable
   
     ###############################################################################
     # TURBOMOLE settings
     ###############################################################################
     # set path to your TURBOMOLE development copy
     export TURBODIR=<my_turbomole_directory>
     # include your own TURBOMOLE copy as default binaries into $PATH 
     export PATH=$TURBODIR/scripts:$PATH
     export PATH=$TURBODIR/bin/`sysname`:$PATH
  
     # store machine architecture in $TURBO_ARCH to speed up compilation
     export TURBO_ARCH=`sysname`
     export TURBOMOLE_SYSNAME=$TURBO_ARCH
  fi
  

Replace <my_turbomole_directory> by the name of the directory with your copy of the TURBOMOLE source code.

Compiling TURBOMOLE

To configure the software run:

    make config
This will create subdirectories that are used to store compiled binaries and create dependency files (stored in subdirectories named ``depend'') that tell make on which other files the compiled version of a source code file depends.

In order to build the libraries (with -j option in order to compile in parallel) run:

    make -j 12 lib

Finally, in order to build the executable programs run:

    make -j 12

Compiling with gfortran

To compile TURBOMOLE with gfortran set $TURBOMOLE_SYSNAME as:

   export TURBOMOLE_SYSNAME=linux-gfortran

If set correctly the command sysname should return linux-gfortran.

Distributed memory (MPI) parallization

Adapt your environment with:

     unset TURBOMOLE_SYSNAME
     export PARA_ARCH=MPI

Go to the top-level of your local copy and invoke make as follows:

     make dir
     make

You will find the parallel binaries in bin/<arch>_mpi that are termed with the name of the serial binaries extended by _mpi, e. g. ricc2_mpi or dscf_mpi, together with the shell scipts that launch them in an parallel environment (if PARA_ARCH=MPI), e. g. ricc2 or dscf.

Bringing your own TURBOMOLE binaries from ertholmene to other machines (Not yet updated for billund)

The sequential binaries (which with our setup include the OpenMP parallelization) should be statically linked, i.e. ldd <my own ricc2> should return the message 'not a dynamic executable. Such binaries can without further complications copied to other 65 bit linux machines. It is recommended to place them in 'bin' directory under your home directory, /home/$USER/bin. To use them in place of the standard TURBOMOLE programs add your bin directory to $PATH AFTER the standard TURBOMOLE program were added to $PATH with

     export PATH=/home/$USER/bin:$PATH

The MPI parallel binaries can not be statically linked and need at run time access to a number of shared object libraries (*.so files), which are expected to be located under $TURBODIR. Thus, you need to provide for these binaries a consistent environment. The recommended procedure to install your own TURBOMOLE version with parallel binaries on a different machine than ertholmene is as follows:

  1. compile the sequential and MPI parallel TURBOMOLE version on ertholmene
  2. make sure that you have set $TURBODIR to the directory with this TURBOMOLE version
  3. in /home/turbomole/bin you find a script named mkturbodist. Invoke is as:
    mkturbodist my_own_dist_dir
  4. copy the directory my_own_dist_dir e.g. with scp to the machine and place where you want to have your own MPI paralle TURBOMOLE version installed

Compiling the proper program with 3D graphic (S2) (Not yet updated for billund)

Set your environment:

  module load TM-compile/s2plot
  module load TM-compile/pgplot

Then compile the TURBOMOLE code as usual.

If you want to re-use the object modules in a TURBMOLE directory that you compiled before without that these modules were loaded, do before the following in the TURBOMOLE directory:

   cd plotlib
   make clean 
   cd -

to enforce recompilation of the routines in plotlib that depend on the settings in the above module files.

Note: if 3D and 2D graphics are enabled, the proper binary depends on a number of graphics libraries which can not be linked statically. Thus, a dynamically linked binary will be produced. It can only be used on other machines if the required dynamic graphics libraries are on these machines available. This might require changes of the environment variable $LD_LIBRARY_PATH.

Compiling the proper program with 3D graphic (S2) on and for CentOS systems (e.g. the desktop machines) on desktop machines

Set your environment (e.g. in .bash_profile):

  1. for the ifort compiler and the MKL libraries include:
       if [ "$MY_OS" == "CentOS" ]; then
         module add ifort/2017.4.196
         module add mkl/2017.4.196
    
    li>for the plotting libraries include:
       if [ "$MY_OS" == "CentOS" ]; then
         export S2PATH=/home/turbomole/centos/S2PLOT
       else
         export S2PATH=/home/turbomole/S2PLOT
       fi
       export PGPLOT=yes
       export S2PLOT=yes
       export PGPLOT_DIR=/home/turbomole/pgplot
       export HARU_DIR=/home/turbomole/Haru/lib
       export S2ARCH=linux-gnu-x86_64
       export S2PLOT_PRCDRIVER=s2prcwriter
       export S2FREEGLUT=yes
       export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HARU_DIR        
    

These settings are very similar to those needed on ertholmene (intel1) apart from the different path for the S2PLOT library and different versions for ifort and MKL.

To finally compile the code do the following:

  1. download the code from the SVN repository
  2. adapt the proper/Makefile the section with the link option to
           ifeq ($(PGPLOT), yes)
              ...
              libs+= -Bstatic -L$(PGPLOT_DIR) -lpgplot  -Bdynamic -lpng -lz -lX11 -lxcb -lXau -l:libXdmcp.so.6 -lutilib
           endif
           ifeq ($(S2PLOT), yes)
              ...
              libs+= -Bstatic -L$(S2PLOT_DIR) -ls2plot -ls2dispfg -ls2meshstub  -ls2winglut -Bdynamic -L$(HARU_DIR) -lhpdf -lglut -lGLU -lGL -lm -lutilib -lstdc++
           endif
  3. run make config
  4. run make
/body>