GAMESS のインストールガイド(Ubuntu 24.04 向け)

このノートでは、代表的な量子化学計算プログラムパッケージの GAMESS をインストールする手順をまとめています。

前提

  • OS: Ubuntu 24.04
  • GAMESS: version July 15, 2024 R2 Patch 1

方針

  • /usr/local/gamessにインストールする

必要なツールの準備

GAMESSをインストールするには、いくつかの基本ツールが必要です。まず、Ubuntuを最新の状態に更新します。

sudo apt update && sudo apt upgrade

その後、依存するツール(csh / make / gfortran)をインストールします。

sudo apt install -y csh make gfortran

Intel MKL (Math Kernel Library) のインストールについては、 このノート を参照してください。

GAMESS のインストール

ソースコードのダウンロード

GAMESSの公式サイト から、GAMESS のソースコードを取得します。ダウンロード後、次のコマンドで解凍します。

tar xvfz gamess-current.tar.gz -C /usr/local

GAMESS をインストールするディレクトリに移動します。

cd /usr/local/gamess

設定ファイルの準備

GAMESSのインストールは、configスクリプトによる対話形式でおこないます。この設定では、スクリプトの質問に答えながら、GAMESS が使うコンパイラやライブラリなどを指定します。

sh ./config

以下は、Ubuntu 24.04 環境での設定例です。

This script asks a few questions, depending on your computer system,
to set up compiler names, libraries, message passing libraries,
and so forth.
 
You can quit at any time by pressing control-C, and then <ENTER>.
 
Please open a second window by logging into your target machine,
in case this script asks you to 'type' a command to learn something
about your system software situation.  All such extra questions will
use the word 'type' to indicate it is a command for the other window.
 
After the new window is open, please hit <ENTER> to go on.
   GAMESS can compile on the following 64 bit machines:
hpe-apollo   - HPE Apollo Gen10 Plus architecture (e.g., polaris)
hpe-cray-ex  - HPE Cray's EX architecture (e.g., narwhal, perlmutter, crusher, frontier)
cray-xt      - Cray's XT massively parallel system, running CNL
cray-xc      - Cray's XC massively parallel system (e.g., DoE Theta, DoD Onyx, NERSC Cori)
fj-a64fx     - Fujitsu PRIMEHPC with A64FX cpus and Fujitsu Compilers (e.g., FX1000, FX700)
ibm64        - IBM, Power8 chip or newer, running AIX or Linux (e.g., DoE Summit, DoD Hokulea)
linux64      - Linux (any 64 bit distribution), for x86_64, ia64, or arm64 chips,
               using gfortran, ifort, or perhaps PGI compilers.
mac64        - Apple Mac, any chip, running OS X 10.5 or newer
win64        - Windows 64-bit (Windows 10)
singularity  - GAMESS Singularity container image
 
    type 'uname -a' to partially clarify your computer's flavor.
 
please enter your target machine name: 
linux64
Where is the GAMESS software located on your system?
 
GAMESS directory? [/usr/local/gamess] 
/usr/local/gamess
Setting up GAMESS compile and link for GMS_TARGET=linux64
GAMESS software is located at GMS_PATH=/home/yamnor/apl/gamess
 
Please provide the name of the build location.
This may be the same location as the GAMESS directory.
 
GAMESS build directory? [/usr/local/gamess] 
/usr/local/gamess
Please provide a version number for the GAMESS executable.
This will be used as the middle part of the binary name,
for example: gamess.00.x

Version? [00] 
00
Are you building for a specific HPC system?
 
Options:
    nautilus     - DoD Penguin system at Navy DSCR w/ AMD EPYC (Milan), NVIDIA A100 GPGPUs, and HDR-200 Infiniband
    grace-hopper - NVIDIA Grace-Hopper Superchip System
    <ENTER>      - none
 
HPC system target for 64-bit Linux system: 
<ENTER>
Linux FORTRAN Compiler Selection
--------------------------------

aocc          - AMD Fortran compiler                  (minimum support v. 3.2.0)
gfortran      - GNU Fortran compiler                  (minimum support v. GCC-5)
ifort         - Intel Fortran compiler                (minimum support v. 2018.3)
oneapi-ifort  - Intel OneAPI Classic Fortran compiler (minimum support v. 2022.1.2)
oneapi-ifx    - Intel OneAPI Beta Fortran compiler    (minimum support v. 2022.1.2)
pgfortran     - NVIDIA PGI Fortran compiler           (minimum support v. 19.10 Community)
nvfortran     - NVIDIA HPC SDK Fortran compiler       (minimum support v. 22.1)
flang-new     - LLVM (new) Fortran compiler

Please enter your choice of FORTRAN: 
gfortran
gfortran is very robust, so this is a wise choice.
 
Please type 'gfortran -dumpversion' or else 'gfortran -v' to
detect the version number of your gfortran.
This reply should be a string with at least two decimal points,
such as 8.3.0 or 11.2.0.
The reply may be labeled as a 'gcc' version,
but it is really your gfortran version.
 
Please enter only the first decimal place, such as 8.2 or 11.2: 
13.2
Good, the newest gfortran version number 13.2 can compile REAL*16 data type.
Please report any numerical issues you encounter.

Hit <ENTER> to continue to the math library setup.
<ENTER>
Math Library Selection
----------------------

Linux distributions do not include a standard math library.
 
There are several reasonable add-on library choices,
       MKL from Intel           for 64 bit Linux (free)
      AOCL from AMD             for 64 bit Linux (free)
and one very unreasonable option, namely 'none', which will use
some slow FORTRAN routines supplied with GAMESS.  Choosing 'none'
will run MP2 jobs 2x slower, or CCSD(T) jobs 5x slower.
 
Some typical places (but not the only ones) to find math libraries are
Type 'echo $MKLROOT'                     to look for MKL
Type 'echo $ARMPL_DIR'                   to look for ArmPL
 
Enter your math library choice from one of the options below:
 
'acml', 'aocl', 'atlas', 'mkl', 'openblas', 'nvblas', 'armpl', 'nvpl', 'none'
mkl
 Math library selection: mkl
 
The exact MKL libraries needed depend on its version number.
First, where is your MKL software installed?  For example
             /opt/intel/oneapi/mkl/2023.1.0
             /opt/intel/oneapi/mkl/latest
 
Found:       Nothing.
 
This is sometimes referred to as the MKL ROOT folder.
MKL pathname? 
/opt/intel/oneapi/mkl/latest
Math library 'mkl' will be taken from /opt/intel/oneapi/mkl/latest/lib/intel64
 
Hit <ENTER> to continue to the GAMESS DDI communications setup.
<ENTER>
Communication Library Selection
-------------------------------
 
             Choose a communication library
 
---- sockets (small private cluster oriented) ---- 
 
    If you want to use Gigabit Ethernet, 10 GbE, or Infiniband with IPoIB,
    if you can ssh to each compute node,
    if you do not want to adapt rungms script to use MPI,
        choose 'sockets'.
 
---- mpi (public cluster oriented) ---- 
 
    If you want to use a network that does not allow TCP and/or ssh,
        for example, Infiniband without IPoIB,
    if you are able to do C-shell scripting to edit rungms,
    if you have an MPI library correctly installed,
        choose 'mpi'.
 
---- mixed ---- 
 
    If you wish to use a combination of TCP/IP networking for small
    messages and MPI for large messages in a 'mixed' fashion,
        choose 'mixed'.
 
communication library ('serial','sockets' or 'mpi' or 'mixed')? 
sockets
Hit <ENTER> to continue through the GAMESS build options.
 
Note: You can just <ENTER> through the next series of questions
      if you want to accept the default answer of 'no'.
<ENTER>
LibXC Option
============

GAMESS-US now supports LibXC.
LibXC is a library of exchange-correlation functionals for density-functional
theory (DFT). It adds many new DFT functionals that are enabled with the
$LIBXC input group. This feature requires modern Fortran 2003 but not all
compilers support it. For gfortran, the minimal tested version is gfortran 5.5.
If your gfortran is older than this, you can try to use the LibXC interface
but it may not work. The IBM XL Fortran compiler is not fully supported!

This option can be manually changed later by modifying install.info

Optional: Build LibXC interface?  (yes/no): 
no
The Molecular Science Software Institute (MolSSI) Driver Interface (MDI)
========================================================================

GAMESS-US now supports the MolSSI Driver Interface (MDI).
MDI enables GAMESS to interoperate with other codes via a standardized
interface. More information about MDI can be found here:

https://molssi-mdi.github.io/MDI_Library/html/index.html

This feature requires modern Fortran 2003 but not all compilers support it

This option can be manually changed later by modifying install.info

Optional: Build MDI support?  (yes/no): 
no
MSU CCSDt, CC(t;3), ACP, and DEA/DIP-EOMCC Option
================================================================

Users have the option of compiling the beta version of the
active-space CCSDt and CC(t;3), ACP, and DEA/DIP-EOMCC codes
developed at Michigan State University (CCTYP = CCSD3A, CCT3,
ACCSD, ACC23, ACCSD3A, ACCT3, DEAEOMx and DIPEOMx, respectively).

These builds take a considerable amount of time and memory for
compilation due to the amount of machine generated source code.
We recommend that users interested in installing these codes
compile GAMESS in parallel using the Makefile generated during
the initial configuration ('make -j [number of cores]').

This option can be manually changed later by modifying install.info

Optional: Build MSU CCT3, CCSD3A, ACP & DEA/DIP-EOMCC methods?  (yes/no):
no
LIBCCHEM 2.0 Option
===============

64 bit Linux, IBM, and Cray builds can attach the C++/CUDA/HIP 
LibCChem library for fast, GPU accelerated code through the CUDA, 
and HIP programming models for NVIDIA or AMD GPUs. 
This is the new, improved version of the original LibCChem which 
includes a full SCF with capability up to d functions, and an independent
Fock build algorithm. At the moment only 
energies are available. 
Usage of LibCChem 2.0 requires a CUDA/ROCM installation and MPI.
 
Do you want to use LIBCCHEM 2.0?  (yes/no): 
no
VeraChem VM2 Option
=======================

Users have the option of linking in the VeraChem VM2 statistical
mechanics package binary when building GAMESS. The resulting
GAMESS-VM2 package provides a mining minima free energy calculation
capability. Dual energy potential (MM and QM) based molecular
conformational searching and subsequent processing of these conformers
for temperature effects, e.g. entropic terms, result in a Boltzmann
weighted conformer ensemble and an associated free energy.
Note that linking VM2 package requires using intel compilers (ifort) 
DATA SERVER will be turned off automatically and  
dynamic linking of math libray is required, so  change  GMS_MKL_VERNO to 12-so

The VeraChem binary package can be licensed for commercial use,
and free licensing is also available for purely academic use.
Send requests for the package binary by email to vc@verachem.com or
through the VeraChem website www.verachem.com.

Optional: Build GAMESS with VeraChem's VM2 library? (yes/no): 
no
Tinker Option
=============

Optional: Build GAMESS with TINKER plug-in? (yes/no): 
no
VB2000 Option
=============

Optional: Build GAMESS with VB2000 plug-in? (yes/no): 
no
XMVB Option
===========

Optional: Build GAMESS with XMVB plug-in? (yes/no): 
no
NEO Option
==========

The NEO approach is designed to incorporate nuclear quantum effects into
electronic structure calculations by treating specified nuclei quantum
mechanically on the same level as the electrons.

An advantage of the NEO approach is that nuclear quantum effects such as
delocalization, anharmonicity, and zero-point energy, as well as
non-Born-Oppenheimer effects, are inherently included during geometry
optimizations, reaction paths, and dynamics.

Optional: Build GAMESS with NEO plug-in? (yes/no): 
no
NBO Option
==========

Optional: Build GAMESS with NBO plug-in? (yes/no): 
no
RISM-SCF-cSED option
====================

Optional: Build GAMESS with RISM-SCF-cSED plug-in? (yes/no): 
no
********************************************************
*             End of GAMESS Configuration              *
********************************************************
 
Your configuration for GAMESS compilation is in
     /home/yamnor/apl/gamess/install.info
 
Now, you are ready to compile GAMESS by running:
 
 make 
 
or
 
 make -j4
 
If you run into any issues have a look at README.md or
post your question in the GAMESS Google Group:
     http://groups.google.com/group/gamess

コンパイルとリンク

configスクリプトによる設定が完了したら、以下のコマンドで GAMESS をコンパイル(プログラムのビルド)します。

make -j4

コンパイルが終わると、gamess.00.xという GAMESS の実行ファイルが生成されます。

:
:
The linking of GAMESS to binary gamess.00.x was successful.
0.5u 0.2s 0:01.00 83.0% 0+0k 8+198560io 0pf+0w

実行スクリプトの編集

計算中に生成される一時ファイルを保存するためのディレクトリを作成します。今回は、一時ファイルの保存先として、~/scrディレクトリを準備しました。

mkdir ~/scr

GAMESS の実行スクリプトrungmsの一部(96〜100行目)を、環境に合わせて編集します。具体的には、一時ファイルの保存先と、GAMESS のインストール先などの情報を修正します。

  set TARGET=sockets
- set SCR=~/gamess/restart
+ set SCR=~/scr
- set USERSCR=~/gamess/restart
+ set USERSCR=~/scr
- set GMSPATH=~/gamess
+ set GMSPATH=/usr/local/gamess
  set DEL_OLD=yes

テスト計算の実行

テスト計算で、GAMESS が正常に動作するかを確認します。以下のような、水分子の構造最適化をおこなう入力ファイル(water.inp)を作成します。

water.inp
 $CONTRL SCFTYP= RHF RUNTYP=OPTIMIZE DFTTYP=B3LYP 
       ICHARG=0 MULT=1 COORD=CART $END
 $STATPT NSTEP=100 $END
 $SYSTEM MWORDS=128 $END
 $BASIS GBASIS=N31 NGAUSS=6 NDFUNC=1 $END
 $DATA
H2O
C1 1
O 8  0.00000000 0.00000000 0.00000000
H 1  0.76537259 0.61188894 0.00000000
H 1 -0.76537250 0.61188892 0.00000000
 $END

rungmsスクリプトを使って、GAMESS を実行します。

rungms water >& water.log

エラーへの対処

下記のような表示でエラー終了する場合、rungmsスクリプトを修正する必要があります。

1 : water
Illegal variable name.

rungmsの一部(164〜166行)を下記のように修正します。

- if($# > 5) then
+ if($#argv > 5) then
    if($6 > 0) setenv OMP_NUM_THREADS $6 # number of threads
  endif

上記の修正をおこない、再度rungmsを実行してみます。GAMESS を用いた量子化学計算が正常に終了すると、water.logの最後に、以下のような情報が出力されます。

 ----------------------------------------
 CPU timing information for all processes
 ========================================
 0: 2.972 + 0.23 = 2.996
 ----------------------------------------
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
 ddikick.x: exited gracefully.

以上で、GAMESS のインストールが完了です。

GAMESS
Posted :