-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_configuration.sh
More file actions
executable file
·146 lines (121 loc) · 3.38 KB
/
example_configuration.sh
File metadata and controls
executable file
·146 lines (121 loc) · 3.38 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/sh
# SUMMARY: CMakeLists.txt
# USAGE: Part of DHSVM
# AUTHOR: William A. Perkins
# ORG: Pacific Northwest National Laboratory
# E-MAIL: william.perkins@pnl.gov
# ORIG-DATE: Dec-2016
# DESCRIPTION: Example DHSVM CMake configuration for some systems
# DESCRIP-END.
# COMMENTS:
#
# Last Change: 2020-05-12 10:09:21 d3g096
set -xue
# -------------------------------------------------------------
# handle command line options
# -------------------------------------------------------------
usage="$0 [-d|-r] [-t] [name]"
opts=`getopt dr $*`
if [ $? != 0 ]; then
echo $usage >&2
exit 2
fi
set -- $opts
build="RelWithDebInfo"
for o in $*; do
case $o in
-d)
build="Debug"
shift
;;
-r)
build="Release"
shift
;;
--)
shift
break
;;
*)
echo "$0: error: $o: unknown option" >&2
echo $usage >&2
exit 2
esac
done
if [ $# -gt 0 ]; then
host="$1"
else
host=`uname -n`
fi
rm -rf CMakeCache.txt CMakeFiles
options="-Wdev --debug-trycompile"
# useful build types: Debug, Release, RelWithDebInfo
common_flags="\
-D CMAKE_BUILD_TYPE:STRING=$build \
-D DHSVM_SNOW_ONLY:BOOL=ON \
-D DHSVM_BUILD_TESTS:BOOL=OFF \
-D DHSVM_USE_RBM:BOOL=ON \
-D DHSVM_DUMP_TOPO:BOOL=ON \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
"
if [ $host == "flophouse" ]; then
cmake $options \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
$common_flags \
..
elif [ $host == "WE32673" ]; then
# this is a Mac system with NetCDF installed using MacPorts
# using the GNU compiler installed via MacPorts
CC=gcc-mp-6
CXX=g++-mp-6
export CC CXX
cmake $options \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
-D NETCDF_DIR:PATH=/opt/local/include \
-D DHSVM_USE_X11:BOOL=ON \
-D DHSVM_USE_NETCDF:BOOL=ON \
-D DHSVM_USE_RBM:BOOL=OFF \
$common_flags \
..
elif [ $host == "WE32673-clang" ]; then
# this is a Mac system with NetCDF installed using MacPorts
# using the system (XCode) compiler
CC=/usr/bin/clang
CXX=/usr/bin/clang++
export CC CXX
cmake $options \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
-D NETCDF_DIR:PATH=/opt/local/include \
-D DHSVM_USE_X11:BOOL=ON \
-D DHSVM_USE_NETCDF:BOOL=ON \
-D DHSVM_USE_RBM:BOOL=OFF \
$common_flags \
..
elif [ $host == "pe10900" ]; then
# this is an older Mac system with Intel compilers and NetCDF
# installed via MacPorts. This is how you use non-default compilers.
CC=icc
FC=ifort
export CC FC
cmake $options \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
-D DHSVM_USE_X11:BOOL=ON \
-D DHSVM_USE_NETCDF:BOOL=ON \
-D NETCDF_DIR:PATH=/opt/local/include \
-D DHSVM_USE_RBM:BOOL=ON \
$common_flags \
..
else
# For an unknown system, turn most options off
cmake $options \
-D CMAKE_BUILD_TYPE:STRING=$build \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \
-D DHSVM_SNOW_ONLY:BOOL=OFF \
-D DHSVM_USE_X11:BOOL=OFF \
-D DHSVM_USE_NETCDF:BOOL=OFF \
-D DHSVM_USE_RBM:BOOL=OFF \
-D DHSVM_BUILD_TESTS:BOOL=OFF \
..
echo "Unknown host: $host"
exit 2
fi