-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_moab.sh
executable file
·77 lines (68 loc) · 2.15 KB
/
install_moab.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -e
build_prefix=${build_dir}/moab-${moab_version}
install_prefix=${install_dir}/moab-${moab_version}
if [ "${compiler}" == "intel" ]; then
build_prefix+=-intel
install_prefix+=-intel
fi
if [ "${install_pymoab}" == "true" ] && [ "${custom_python}" == "true" ]; then
load_python3
fi
eigen_dir=${install_dir}/eigen-${eigen_version}
hdf5_dir=${install_dir}/hdf5-${hdf5_version}
if [ "${compiler}" == "intel" ]; then
hdf5_dir+=-intel
fi
rm -rfv ${build_prefix}
mkdir -pv ${build_prefix}/bld
cd ${build_prefix}
tarball=moab-${moab_version}.tar.gz
url=https://bitbucket.org/fathomteam/moab/get/${moab_version}.tar.gz
if [ ! -f ${dist_dir}/sigma/${tarball} ]; then
wget ${url} -P ${dist_dir}/sigma/
mv -v ${dist_dir}/sigma/${moab_version}.tar.gz ${dist_dir}/sigma/${tarball}
fi
tar -xzvf ~/dist/sigma/${tarball}
mv fathomteam-moab-* moab-${moab_version}
ln -sv moab-${moab_version} src
cd moab-${moab_version}
autoreconf -fi
if [[ "${moab_version}" == "4"* ]]; then
sed -i "s/HUGE/HUGE_VAL/" src/LocalDiscretization/LinearTet.cpp
sed -i "s/HUGE/HUGE_VAL/" src/LocalDiscretization/LinearTri.cpp
fi
cd ../bld
if [[ "${moab_version}" == "5"* ]] && [ "$(basename $FC)" != "ifort" ]; then
install_pymoab=true
else
install_pymoab=false
fi
rpath_dirs=${hdf5_dir}/lib
if [ -n "${compiler_rpath_dirs}" ]; then
rpath_dirs=${compiler_rpath_dirs}:${rpath_dirs}
fi
config_string=
if [[ "${moab_version}" == "4"* ]]; then
config_string+=" --enable-dagmc"
fi
if [ "${install_pymoab}" == "true" ]; then
config_string+=" --enable-pymoab"
fi
config_string+=" --enable-shared"
config_string+=" --enable-optimize"
config_string+=" --disable-debug"
config_string+=" --disable-blaslapack"
if [ "${custom_eigen}" == "true" ]; then
config_string+=" --with-eigen3=${eigen_dir}/include/eigen3"
fi
config_string+=" --with-hdf5=${hdf5_dir}"
config_string+=" --prefix=${install_prefix}"
config_string+=" CC=${CC} CXX=${CXX} FC=${FC}"
if [ "${install_pymoab}" == "true" ] && [ "${custom_python}" == "true" ]; then
config_string+=" PYTHON=${python3_dir}/bin/python3"
fi
config_string+=" LDFLAGS=-Wl,-rpath,${rpath_dirs}"
../src/configure ${config_string}
make -j${num_cpus}
make install