-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-gmx.sh
executable file
·50 lines (43 loc) · 1.03 KB
/
build-gmx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -- $(getopt j:a:s:rd "$@")
SRC=.
DOUBLE=OFF
GPU=CUDA
RDTSCP=OFF
ARCH=SSE2
JOBS=8
while test "$1" != --; do case $1 in
-r) RDTSCP=ON;;
-d) DOUBLE=ON; GPU=OFF;;
-a) ARCH=$2; shift;;
-j) JOBS=$2; shift;;
-s) SRC=$2; shift;;
esac; shift; done
ARCHDIR=$ARCH
[ $DOUBLE = 'ON' ] && ARCHDIR=${ARCHDIR}_d
[ $RDTSCP = 'ON' ] && ARCHDIR=${ARCHDIR}_ts
BUILDIR=gromacs_build_$ARCHDIR
set -x
mkdir -p $BUILDIR || exit 1
SRC=$(realpath $SRC)
cd $BUILDIR
CC=gcc CXX=g++ cmake $SRC \
-DGMX_OPENMP=ON \
-DGMX_GPU=$GPU \
-DGMX_MPI=ON \
-DGMX_DOUBLE=$DOUBLE \
-DGMX_BUILD_OWN_FFTW=ON \
-DGMX_DEFAULT_SUFFIX=OFF \
-DCMAKE_INSTALL_PREFIX=/gromacs/$ARCHDIR \
-DGMX_USE_RDTSCP=$RDTSCP \
-DGMX_SIMD=$ARCH \
&& make -j $JOBS \
&& make install
if [ "$ARCH" = AVX_512 ]; then
g++ -O3 -mavx512f -std=c++11 \
-DGMX_IDENTIFY_AVX512_FMA_UNITS_STANDALONE=1 \
-DGMX_X86_GCC_INLINE_ASM=1 \
-DSIMD_AVX_512_CXX_SUPPORTED=1 \
-o /gromacs/$ARCHDIR/bin/identifyavx512fmaunits \
$SRC/src/gromacs/hardware/identifyavx512fmaunits.cpp
fi