cmakeを使ったバージョン4.6.1のインストール方法

分子動力学計算ソフトウェアGromacsのバージョン4.6から、従来のconfigure&makeではなくて、cmakeのみの対応となったようです。

ここに僕のやり方を残しておきます。
参考:GROMACS 4.6 Installation Guide
Installation Instructions - Gromacs

Gromacsダウンロード:Downloads - Gromacs

※CMakeは2.8以上がインストールされていないと警告が出ます。

CMake Error at CMakeLists.txt:35 (cmake_minimum_required):
  CMake 2.8 or higher is required.  You are running version 2.6.4

-- Configuring incomplete, errors occurred!

CMmakeをソースからインストールする方法

Scientific Linux 6.3では、CMakeはyumでインストールすることができなかったので、ソースからインストールしました。


コンパイルの手順は以下のようになります。

wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.1.tar.gz
tar xzvf gromacs-4.6.1.tar.gz
cd gromacs-4.6.1
mkdir build
cd build
CC=icc CXX=icpc cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-4.6.1 -DGMX_DEFAULT_SUFFIX=OFF -DGMX_THREAD_MPI=ON -DGMX_MPI=ON -DGMX_OPENMP=ON -DGMX_DOUBLE=ON -DGMX_FFT_LIBRARY=fftw3 -DFFTW_INCLUDE_DIR=/usr/local/fftw/include -DFFTW_LIBRARY=/usr/local/fftw/lib/libfftw3.so

自分の場合、何故かWarningが。しかし一応、makefileは容易できた模様。

CMake Warning at CMakeLists.txt:928 (message):
  The fftw library found is compiled without SIMD support, which makes it
  slow.  Consider recompiling it or contact your admin
(省略)
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/gromacs-4.6.1/build

つづき。

make
make install
cd /usr/local/
ln -sfn gromacs-4.6.1 gromacs
vi /etc/bashrc

例によって/usr/localにリンクを貼ってバージョン管理しています。もし新規インストールの場合は/etc/bashrcに以下のコードを追加して終わり。

# gromacs
source /usr/local/gromacs/bin/GMXRC.bash