2018年5月2日 星期三

安裝GROMACS-2018.1在Debian 7.7

將GROAMCS-2018.1安裝在Debian 7.7,而且把gmx執行檔做成fully static executable。在編譯的時候要注意兩點:
  • Debian 7.7預設的GCC是4.7.2,但是GROMACS所需的gcc必須要4.8.1以上,而且必須要支援c++11 implementation,在這邊用的GCC是自行編譯的6.4.0
  • Debian 7.7預設的cmake是2.8.9,但GROMACS必須要3.4.3以上,在這邊用的是CMAKE 3.10.2

步驟一:設定環境變數
export PATH=/pkg1/local/gcc-6.4.0/bin:$PATH
export LD_LIBRARY_PATH=/pkg1/local/gcc-6.4.0/lib:/pkg1/local/lib
export LDFLAGS="-static-libgcc -static-libstdc++"
export CFLAGS=-static 
export CXXFLAGS=-static

步驟二:下載原始碼、編譯、安裝
$ wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-2018.1.tar.gz
$ md5sum gromacs-2018.1.tar.gz 
7ee393fa3c6b7ae351d47eae2adf980e  gromacs-2018.1.tar.gz

$ tar zxf gromacs-2018.1.tar.gz && cd gromacs-2018.1
$ mkdir build && cd build
$ /pkg1/chem/GROMACS/cmake-3.10.2-Linux-x86_64/bin/cmake .. \
-DCMAKE_INSTALL_PREFIX=/pkg1/chem/GROMACS/2018.1-double-gcc640 \
-DCMAKE_C_COMPILER=/pkg1/local/gcc-6.4.0/bin/gcc \
-DCMAKE_CXX_COMPILER=/pkg1/local/gcc-6.4.0/bin/g++ \
-DGMX_BUILD_OWN_FFTW=ON \
-DGMX_GPU=OFF \
-DGMX_SIMD=SSE4.1 \
-DGMX_DOUBLE=ON \
-DGMX_DEFAULT_SUFFIX=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DGMX_PREFER_STATIC_LIBS=ON \
-DGMX_BUILD_SHARED_EXE=OFF \
-DCMAKE_SKIP_RPATH=ON \
-DREGRESSIONTEST_DOWNLOAD=OFF

$ make -j 20
...
[100%] Linking CXX static library ../../lib/libgromacs.a
[100%] Built target libgromacs
Scanning dependencies of target template
Scanning dependencies of target gmx
[100%] Building CXX object src/programs/CMakeFiles/gmx.dir/legacymodules.cpp.o
[100%] Building CXX object src/programs/CMakeFiles/gmx.dir/gmx.cpp.o
[100%] Building CXX object share/template/CMakeFiles/template.dir/template.cpp.o
[100%] Linking CXX executable ../../bin/gmx
[100%] Linking CXX executable ../../bin/template
[100%] Built target gmx
[100%] Built target template
$ ldd bin/gmx
    not a dynamic executable

$ make install
[  0%] Built target fftwBuild
[  2%] Built target tng_io_obj
[  2%] Built target tng_io_zlib
[100%] Built target libgromacs
[100%] Built target template
[100%] Built target view_objlib
[100%] Built target mdrun_objlib
[100%] Built target gmx
[100%] Built target mdrun_test_objlib
Install the project...
...
-- Up-to-date: /pkg1/chem/GROMACS/2018.1-double-gcc640/bin
-- Installing: /pkg1/chem/GROMACS/2018.1-double-gcc640/bin/gmx-completion.bash
-- Installing: /pkg1/chem/GROMACS/2018.1-double-gcc640/bin/gmx-completion-gmx.bash

步驟三:下載測試包,測試程式執行的正確性
$ wget http://gerrit.gromacs.org/download/regressiontests-2018.1.tar.gz
$ md5sum regressiontests-2018.1.tar.gz 
1a94916e2cf90e34fddb3514a65e0154  regressiontests-2018.1.tar.gz

$ tar zxf regressiontests-2018.1.tar.gz && cd regressiontests-2018.1
$ source /pkg1/chem/GROMACS/2018.1-double-gcc640/bin/GMXRC
$ ./gmxtest.pl -nosuffix -double all >& gmxtest.log &

$ cat gmxtest.log | grep PASS | grep -v ^PASSED
All 16 simple tests PASSED
All 51 complex tests PASSED
All 142 kernel tests PASSED
All 10 freeenergy tests PASSED
All 12 rotation tests PASSED
All 0 extra tests PASSED
All 48 pdb2gmx tests PASSED
All 7 essential dynamics tests PASSED

$ cat gmxtest.log | grep FAIL -c
0
_EOF_

沒有留言:

張貼留言