-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_openmc.sh
executable file
·37 lines (29 loc) · 1.05 KB
/
install_openmc.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
#!/bin/bash
set -e
build_prefix=${build_dir}/openmc-${openmc_version}
install_prefix=${install_dir}/openmc-${openmc_version}
openmpi_dir=${install_dir}/openmpi-${openmpi_version}
hdf5_dir=${install_dir}/hdf5-${hdf5_version}
dagmc_dir=${install_dir}/DAGMC-moab-${moab_version}
CC=${openmpi_dir}/bin/mpicc
CXX=${openmpi_dir}/bin/mpic++
rm -rfv ${build_prefix}
mkdir -pv ${build_prefix}/bld
cd ${build_prefix}
git clone https://github.com/openmc-dev/openmc -b v${openmc_version} --single-branch
ln -sv openmc src
cd bld
cmake_string=
cmake_string+=" -Doptimize=ON"
cmake_string+=" -Dopenmp=ON"
cmake_string+=" -Ddagmc=ON"
cmake_string+=" -DHDF5_ROOT=${hdf5_dir}"
cmake_string+=" -DDAGMC_DIR=${dagmc_dir}/lib/cmake/dagmc"
cmake_string+=" -DCMAKE_BUILD_TYPE=Release"
cmake_string+=" -DCMAKE_C_COMPILER=${CC}"
cmake_string+=" -DCMAKE_CXX_COMPILER=${CXX}"
cmake_string+=" -DCMAKE_INSTALL_PREFIX=${install_prefix}"
# Note: RPATH will not include path to compiler libraries if using custom compilers
${CMAKE} ../src ${cmake_string}
make -j${num_cpus}
make -j${num_cpus} install