-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup_cmake
executable file
·92 lines (81 loc) · 3.47 KB
/
setup_cmake
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
#!/bin/bash
#
# setup_cmake Chooses the correct cmake build command for a machine.
#
#-------------------------------------------------------------------------------
BUILD_TYPE=Release
MACHINE_ID=`uname -n`
echo Building stellarator tools for machine $MACHINE_ID
echo
if [ $# -eq 1 ]
then
BUILD_TYPE=Debug
fi
echo cmake configured to generate a $BUILD_TYPE build.
if [ "$BUILD_TYPE" == Debug ]
then
echo " cmake may be reconfigured to generate a Release build by running this script with no arguments or using the commmand"
echo
echo " cmake -DCMAKE_BUILD_TYPE=Release"
else
echo " cmake may be reconfigured to generate a Debug build by running this script with a Debug argument or using the commmand"
echo
echo " cmake -DCMAKE_BUILD_TYPE=Debug"
fi
mkdir -p build
cd build
if [ $MACHINE_ID == "mbp103254" ] || \
[ $MACHINE_ID == "cianciosaimac" ]
then
# Config for Mark Cianciosa's ORNL machine.
cmake -DCMAKE_BUILD_TYPE:String=$BUILD_TYPE \
-DBUILD_MAKEGRID=ON \
../
elif [ $MACHINE_ID == "Nebuchadnezaar" ] || \
[ $MACHINE_ID == "Z820" ]
then
# Config for Jonathan Schilling's Arch Linux machines.
cmake -DCMAKE_BUILD_TYPE:String=$BUILD_TYPE \
-DUSE_SSH=ON \
-DBUILD_PARVMEC=ON \
../
elif [ $MACHINE_ID == "sv-e5-da-1" ]
then
# Config for Jonathan Schilling's IPP machine.
# This is Debian oldoldstable (9.13).
# -fpermissive is needed for xwout_diff
# (vmec_test_commandline_parser with gcc-6.3.0).
# This config needs the debian_oldoldstable branch of LIBSTELL,
# where libblacsF77init is linked explicitly.
cmake -DCMAKE_BUILD_TYPE:String=$BUILD_TYPE \
-DUSE_SSH=ON \
-DBUILD_PARVMEC=ON \
-DCMAKE_CXX_FLAGS="-fpermissive" \
../
elif [[ $MACHINE_ID = raven* ]]
then
# Config for Raven cluster at MPCDF in Garching.
# For details, see https://docs.mpcdf.mpg.de/doc/computing/raven-user-guide.html .
# module load git gcc openmpi hdf5-serial netcdf-serial mkl
cmake -DCMAKE_BUILD_TYPE:String=$BUILD_TYPE \
-DCMAKE_C_COMPILER=$GCC_HOME/bin/gcc \
-DCMAKE_CXX_COMPILER=$GCC_HOME/bin/g++ \
-DCMAKE_Fortran_COMPILER=$OPENMPI_HOME/bin/mpif90 \
-DNetCDF_C_INCLUDE_DIR=$NETCDF_HOME/include \
-DNetCDF_Fortran_INCLUDE_DIR=$NETCDF_HOME/include \
-DNetCDF_C_LIBRARY=$NETCDF_HOME/lib/libnetcdf.so \
-DNetCDF_Fortran_LIBRARY=$NETCDF_HOME/lib/libnetcdff.so \
-DSCALAPACK_LIBRARY="${MKL_HOME}/lib/intel64/libmkl_scalapack_ilp64.a" \
-DBLAS_LIBRARIES="-Wl,--start-group ${MKL_HOME}/lib/intel64/libmkl_gf_ilp64.a ${MKL_HOME}/lib/intel64/libmkl_gnu_thread.a ${MKL_HOME}/lib/intel64/libmkl_core.a ${MKL_HOME}/lib/intel64/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group -lgomp -lpthread -lm -ldl" \
-DBUILD_PARVMEC=ON \
../
else
# MACHINE_ID is new and unknown. Inform the user how to add support for this new machine.
echo $MACHINE_ID not suported by this script.
echo To support this machine, add a new elif statement of the form
echo
echo elif [ \$MACHINE_ID == \"$MACHINE_ID\" ]
echo then
echo " " cmake -DVARIABLE=value ...
echo
fi