---
# System prepended metadata

title: 2號 hpcx with mkl
tags: [gromacs]

---

# 2號 hpcx with mkl

## problem fix  libuv & librhash
gromacs 的cmake那邊的問題解決
```
## libuv 
wget https://dist.libuv.org/dist/v1.34.1/libuv-v1.34.1.tar.gz
tar xvf libuv-v1.34.1.tar.gz
mkdir uv
cd libuv-v1.34.1/
sh autogen.sh
./configure --prefix=/home/nckuhpclab08/libuv/uv
make -j $(nproc)
make check
make install
export LD_LIBRARY_PATH=/home/nckuhpclab08/libuv/uv/lib:$LD_LIBRARY_PATH

## librash
wget https://github.com/rhash/RHash/archive/refs/tags/v1.4.2.tar.gz
tar xvf v1.4.2.tar.gz
mkdir RHASH
cd RHash-1.4.2/
./configure --prefix=/home/nckuhpclab08/rhash/RHASH && make install
export LD_LIBRARY_PATH=/home/nckuhpclab08/rhash/RHASH/lib:$LD_LIBRARY_PATH
```
## oneapi 
```
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/17912/l_HPCKit_p_2021.3.0.3230_offline.sh
bash l_HPCKit_p_2021.3.0.3230_offline.sh
## 不要勾 mpi
mv intel lib src
cd intel/oneapi/
source setvars.sh

## MKL 
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/17977/l_BaseKit_p_2021.3.0.3219_offline.sh
bash l_BaseKit_p_2021.3.0.3219_offline.sh
mkdir mkl
mv intel lib l_BaseKit_p_2021.3.0.3219_offline.sh mkl
cd /home/nckuhpclab08/mkl/intel/oneapi/mkl/2021.3.0/env
source vars.sh

```
## hpcx
```
cd hpcx/
cd hpcx-v2.4.0-gcc-MLNX_OFED_LINUX-4.4-2.0.7.0-redhat7.5-x86_64/
cd modulefiles/
module use $PWD
module load hpcx-ompi
## mpicc setting
export OMPI_CC=~/src/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/icc
export OMPI_CXX=~/src/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/icpc

```
## module load 
```
module load gcc9/9.3.1
module load cmake/3.15.4
```
## gromacs
```
wget https://ftp.gromacs.org/gromacs/gromacs-2020.5.tar.gz
tar xvf gromacs-2020.5.tar.gz
cd gromacs-2020.5/
mkdir build
cd build
cmake -DGMX_FFT_LIBRARY=mkl -DMKL_LIBRARIES=$MKLROOT/lib/intel64/libmkl_rt.so -DMKL_INCLUDE_DIR=$MKLROOT/include -DGMX_SIMD=AVX2_256 -DGMX_MPI=ON -DGMX_OPENMP=ON -DGMX_BUILD_MDRUN_ONLY=ON -DBUILD_SHARED_LIBS=ON -DGMX_DOUBLE=OFF -DGMX_GPU=OFF -DGMX_HWLOC=OFF -DCMAKE_INSTALL_PREFIX=/home/nckuhpclab08/gromacs_mkl -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_VERBOSE_MAKEFILE=TRUE ..
make -j $(nproc)
make install
export PATH=/home/nckuhpclab08/gromacs_mkl/bin:$PATH
```
## RUN

```
cd /$INPUT
~/hpcx/hpcx-v2.4.0-gcc-MLNX_OFED_LINUX-4.4-2.0.7.0-redhat7.5-x86_64/ompi/bin/mpirun -x LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/nckuhpclab08/mkl/intel/oneapi/mkl/2021.3.0/lib/intel64:/home/nckuhpclab08/src/intel/oneapi/compiler/2021.3.0/linux/compiler/lib/intel64 -np 20 mdrun_mpi -s /home/nckuhpclab08/test_input/run/lignocellulose-rf.tpr -v -noconfout -maxh 0.1 -resethway -nsteps 1000
```
/home/nckuhpclab08/env/oneapi_mkl_hpcx
###### tags: `gromacs`