- Get the latest version of your C and C++ compilers.
- Check that you have CMake version 2.8.8 or later.
- Get and unpack the latest version of the GROMACS tarball.
- Make a separate build directory and change to it.
- Run cmake with the path to the source as an argument
- Run make, make check, and make install
- Source GMXRC to get access to GROMACS
以下就是在Fedora25上面編譯GROMACS-2016.2的過程。
可以比較在這之前安裝的在Ubuntu14.04上GROMACS-5.12的步驟
可以比較在這之前安裝的在Ubuntu14.04上GROMACS-5.12的步驟
步驟1:安裝最新的C與C++編譯器
- gcc --version
gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
步驟2:確認機器上面的CMake版本大於2.8.8
- dnf install cmake
- cmake --version
cmake version 3.6.2
步驟3:抓最新的原始碼
- wet ftp://ftp.gromacs.org/pub/gromacs/gromacs-2016.2.tar.gz
- md5sum gromacs-2016.2.tar.gz 48579f78ffef13689d15b48ac0a8a9a1 gromacs-2016.2.tar.gz
步驟4:做一個編譯專用的資料夾
- tar zxf gromacs-2016.2.tar.gz
- mkdir -p gromacs-2016.2/build
- cd gromacs-2016.2/build
步驟5:執行CMake,設定安裝的路徑與一些參數
- cmake .. -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/pkg/gromacs-2016.2 -DGMX_GPU=OFF
- -DGMX_BUILD_OWN_FFTW=ON使用內建的FFTW
- -DCMAKE_INSTALL_PREFIX 想要安裝的位置
- -DGMX_GPU=OFF 關閉GPU支援
步驟6:編譯程式
- make -j 4 2>&1 | tee make.log
- make check
- sudo make install
- du -h -d 0 /pkg/gromacs-2016.2
27M /pkg/gromacs-2016.2
步驟7:使用前必須要source後,才能夠開始跑
- source /pkg/gromacs-2016.2/bin/GMXRC
- alias gmx='gmx -quiet'
- gmx --version
:-) GROMACS - gmx, 2016.2 (-:
Executable: /pkg/gromacs-2016.2/bin/gmx
Data prefix: /pkg/gromacs-2016.2
Working dir: /home/你的工作目錄
Command line:
gmx -quiet --version
GROMACS version: 2016.2
Precision: single
Memory model: 64 bit
MPI library: thread_mpi
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 32)
GPU support: disabled
SIMD instructions: SSE4.1
FFT library: fftw-3.3.5-sse2
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
Built on: 編譯的日期
Built by: 編譯的使用者@編譯的機器 [CMAKE]
Build OS/arch: Linux 4.9.8-201.fc25.x86_64 x86_64
Build CPU vendor: Intel
Build CPU brand: Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz
Build CPU family: 6 Model: 26 Stepping: 5
Build CPU features: apic clfsh cmov cx8 cx16 htt lahf mmx msr nonstop_tsc pdcm popcnt pse rdtscp sse2 sse3 sse4.1 sse4.2 ssse3
C compiler: /usr/bin/cc GNU 6.3.1
C compiler flags: -msse4.1 -O2 -DNDEBUG -funroll-all-loops -fexcess-precision=fast
C++ compiler: /usr/bin/c++ GNU 6.3.1
C++ compiler flags: -msse4.1 -std=c++0x -O2 -DNDEBUG -funroll-all-loops -fexcess-precision=fast
沒有留言:
張貼留言