Wednesday, June 26, 2013

Gamess (US) frequently asked questions Part 2: Installation in Linux boxes


This is a guest post by Kirill Berezovsky (Petrozavodsk State university), based on instructions he posted some time ago in the Gamess (US) list



First, you need to get some software!
• Fortran compiler: gfortran or Intel Fortran (ifort);
• Math library's: ACML (for AMD CPU’s), ATLAS or MKL (Intel Math Kernel Library);
• (optionally) MPI: Intel MPI, OpenMPI, MVAPICH2, ... (if you using MPI);
(bold is better)

  • I’m not recommending the use of OpenMPI because it’s really slower than Intel MPI.
    But, if you want to try use it, go to this site. This is a very short and informative solution for building 64-bit OpenMPI.

This software for non-commercial using you can get on
http://software.intel.com/en-us/non-commercial-software-development
(Intel Fortran and MKL places in Intel® Fortran Composer XE 2013 for Linux)

As GAMESS (US) developers, I’m using:
• ifort 12.0.4 (places in Intel Fortran Composer XE 2011 update 4, “l_fcompxe_2011.4.191.tgz”)
• MKL 11.0 (places in Intel Fortran Composer XE 2013 initial release, “l_fcompxe_2013.0.079.tgz”).

Be aware, ifort 13.0.0 can’t compile some GAMESS (US) objects!

Anyway, you can install separate software from these archives – look hard when installing. It will safe HDD space and protect from some mistakes, maybe.




Great, when you have these packages, let’s start to configure your system!
You should be root, as I think that is better.

And before starting, configure memory by terminal commands. First, answer the question – how many RAM does your PC have? For example, my PC has 4 GB RAM, so in bytes it will be:

4 GB = 4*1024 MB = 4*1024*1024 KB = 4*1024*1024*1024 bytes = 4294967296 bytes.

And go on: 4294967296 bytes / 2 = 2147483648 bytes.
This number shows maximum size of 1 segment of shared memory.

Next, total size of shared memory in pages will be: 2147483648 / 4096 = 524288 pages.

This numbers you need to write in /etc/sysctl.conf:
echo “kernel.shmmax=2147483648” >> /etc/sysctl.conf
echo “kernel.shmall=524288” >> /etc/sysctl.conf
And restart your machine.

Install the packages!
1. It's better to use 64-bit Linux, whatever you like. I’m using Debian 6.0.7;

2. In terminal, install these packages (just in case):
apt-get install tcsh gcc g++ gfortran build-essential dpkg-dev binutils zlib1g-dev

3. Install Intel Fortan Composer XE 2011;
1. Unpack downloaded archive by: tar xvf l_fcompxe_2011.4.191.tar
2. Goto unpacked folder by: cd l_fcompxe_2011.4.191
3. Install by run: ./install.sh
4. ...And follow the instructions

4. Install GAMESS (US);
1. Get the GAMESS-archive;
2. Unpack it (default in /usr/local/);
3. Go to the GAMESS-folder and run script: ./config
4. Answer the questions:
1. Target machine name: linux64
2. GAMESS location: /usr/local/gamess
3. Build location: /usr/local/gamess
4. GAMESS executable version name (any name you want. In this example, we will use "cpu" as the name): cpu
5. Fortran compiler (choose what you use):
  •  ifort --> version : 12
  • gfortran --> version (like 4.4) you can get if you run in other terminal by: gfortran -v
6. Math library: mkl
7. Math library location: /opt/intel/composerxe_2011/mkl (verify it for your installation!)
8. When it shows string which contains 'bin' and 'lib' then type: skip
9. If you are not using MPI then type: sockets and you'll finish configuration;

10. Else, if you are using MPI type: mpi
1. Next, choose MPI-program: impi
2. Select MPI location directory, and go on.

11. Answer “no” for “LIBCCHEM”-question. If you are using NVIDIA GPU for calculations, anyway answer “no” at this first configuration time go on and don’t forget to read important note after these steps.

5. Goto ddi folder by: cd ddi
6. Edit 'compddi'-script by: gedit compddi
7. Find and change strings:
1. set MAXCPUS=4 (number of cores, is it 4 in your machine?)
2. set MAXNODES=1 (for single node)
8. Run 'compddi'-script by: ./compddi
• If you're NOT using MPI, there will be file ddikick.x - move in by: mv ddikick.x .. (two dots means upper folder)

9. Go upper folder: cd ..
10. Then compile GAMESS (US) by: ./compall

11. Link by: ./lked gamess cpu which creates gamess.cpu.x file. Of course, you can name it as you want, not only 'cpu'


12. Edit 'rungms'-script:
  • See here the rungms-script rewritten by Kirill.

Next you should create folders:
  • mkdir /scr
  • mkdir /scr/root
  • mkdir /root/scr

Add system variables into the ~/.bashrc file:

# iFort
export PATH=/opt/intel/composerxe-2011.4.191/bin/intel64:$PATH
export LD_LIBRARY_PATH=/opt/intel/composerxe-2011.4.191/compiler/lib/intel64:$LD_LIBRARY_PATH

# iMPI
export PATH=/opt/intel/impi/4.0.2.003/intel64/bin:$PATH
export LD_LIBRARY_PATH=/opt/intel/impi/4.0.2.003/intel64/lib:$LD_LIBRARY_PATH

# MKL
export LD_LIBRARY_PATH=/opt/intel/composer_xe_2013.1.117/mkl/lib/intel64:$LD_LIBRARY_PATH


To run GAMESS (US) just type:

/usr/local/gamess/rungms [input file] [optionally,  the 'version name' of your gamess file ("cpu" in this example)]
just like this:

/usr/loca/gamess/rungms BSi85H95.inp
/usr/loca/gamess/rungms BSi85H95.inp cpu   will run exactly the same.

For simple run edit ~/.bashrc like:
gedit ~/.bashrc
• add line alias gamess=’/usr/local/gamess/rungms’
• apply changes by source ~/.bashrc
• and now you can run it by:

gamess BSi85H95.inp cpu

END!

9 comments:

  1. This is a nice write-up.

    Note that if you give a gfortran version higher than 4.7 the GAMESS configure script will exit. It does, however, compile with gfortran 4.7 -- with one exception:
    In order for exam44.inp to run successfully when GAMESS has been compiled with gfortran 4.7 you need to change the optimization level to 0 in comp.

    Also, note that /usr/local has been written /usr/loca/ in the post above a couple of times.

    Nice post!

    ReplyDelete
  2. Thanks for the extra info!

    I have now also corrected the usr/loca/ typos

    ReplyDelete
  3. thanks a lot for the informative post.
    since impi is rather expensive could you show how to compile using openmpi?

    ReplyDelete
  4. I have updated the link to the hints for openmpi. I am afraid I cannot be of more help as I have not installed it under openMPI myself.

    http://diracprogram.org/doc/release-12/installation/int64/mpi.html

    ReplyDelete
  5. I've got these errors :
    Linker messages (if any) follow...
    /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lmpi
    /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lmpigf
    /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lmpigi
    collect2: ld returned 1 exit status

    Unfortunately, there was an error while linking GAMESS.
    0.271u 0.113s 0:00.39 97.4% 0+0k 0+8io 0pf+0w

    ReplyDelete
  6. The linkwer messages seem to related to the location of your MPI implementation. Are you sure you have the proper mpi installed in your machine?

    ReplyDelete
  7. Thx Pedro for answering, I'm new and I'm using super computer so I have no idea how to find what mpi is available

    ReplyDelete
  8. I used this command "ompi_info -a | grep 'Fort integer size"
    and it gave me this " Fort integer size: 4

    ReplyDelete
  9. This comment has been removed by a blog administrator.

    ReplyDelete