-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
executable file
·40 lines (31 loc) · 959 Bytes
/
build.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
#!/bin/bash
# Reproduce the behavior of "readlink -f", in a manner compatible with MacOS
readlink_f() {
filename=$1
cd `dirname $filename`
filename=`basename $filename`
while [ -L "$filename" ]
do
cd `dirname $filename`
filename=`basename $filename`
done
real_path=`pwd -P`
echo $real_path/$filename
}
# Enable building shared libraries on Cray systems
export CRAYPE_LINK_TYPE=dynamic
# If the C compiler has been set, ensure that its value propagates to any other scripts
[[ ! -z "${CC}" ]] && export CC=${CC}
# If the Fortran compiler has been set, ensure that its value propagates to any other scripts
[[ ! -z "${FC}" ]] && export FC=${FC}
# Compile the Tinker submodule
cd modules/Tinker/dev
./full_build.sh
cd ../build/tinker/source
readlink_f dynamic.x > ../../../../../test/locations/Tinker_ELECTRIC
cd ../../../../../
# Compile ELECTRIC
cmake .
make
cd ELECTRIC
readlink_f ELECTRIC.py > ../test/locations/ELECTRIC