-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-nl.sh
executable file
·66 lines (59 loc) · 2.05 KB
/
build-nl.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
#!/usr/bin/env bash
set -ex
: ${SOURCE_ROOT:?} ${INSTALL_ROOT:?} ${GCC_VERSION:?} ${VTK_VERSION:?}
DIR_SRC=${SOURCE_ROOT}/nl
#DIR_BUILD=${INSTALL_ROOT}/jemalloc/build
DIR_INSTALL=${INSTALL_ROOT}/nl
FILE_MODULE=${INSTALL_ROOT}/modules/nl/${NL_VERSION}
if [[ ! -d ${DIR_INSTALL} ]]; then
(
mkdir -p ${DIR_SRC}
cd ${DIR_SRC}
git clone https://github.com/nonlocalmodels/NLMech.git
cd NLMech
git checkout ${NL_VERSION}
mkdir -p build
cd build
${CMAKE_COMMAND} \
-DCMAKE_INSTALL_PREFIX=${DIR_INSTALL} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDCXXFLAGS}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LDCXXFLAGS}" \
-DHPX_DIR="${INSTALL_ROOT}/hpx/lib64/cmake/HPX" \
-Dblaze_DIR="${INSTALL_ROOT}/blaze/share/blaze/cmake" \
-Dblaze_INCLUDE_DIR="${INSTALL_ROOT}/blaze/include" \
-DBLAZEITERATIVE_DIR="${INSTALL_ROOT}/blaze-iterative/" \
-DYAML_CPP_DIR="${INSTALL_ROOT}/yamlcpp/" \
-DBOOST_ROOT=${BOOST_ROOT} \
-DVTK_DIR="${INSTALL_ROOT}/vtk/lib64/cmake/vtk-${VTK_VERSION::-2}" \
-DGMSH_DIR="${INSTALL_ROOT}/gmsh/" \
-DEnable_PCL=ON \
-DPCL_DIR="${INSTALL_ROOT}/pcl/share/pcl-${PCL_VERSION::-2}" \
-DEnable_Tools=ON \
..
make -j${PARALLEL_BUILD}
make install
)
fi
mkdir -p $(dirname ${FILE_MODULE})
cat >${FILE_MODULE} <<EOF
#%Module
proc ModulesHelp { } {
puts stderr {NL}
}
module-whatis {NL}
set root ${DIR_INSTALL}
conflict NL
module load gcc/${GCC_VERSION}
prereq gcc/${GCC_VERSION}
prepend-path CPATH \$root/include
prepend-path PATH \$root/bin
prepend-path PATH \$root/sbin
prepend-path MANPATH \$root/share/man
prepend-path LD_LIBRARY_PATH \$root/lib
prepend-path LIBRARY_PATH \$root/lib
prepend-path PKG_CONFIG_PATH \$root/lib/pkgconfig
setenv NL_ROOT \$root
setenv NL_VERSION ${NL_VERSION}
EOF