-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_hpx.sh
executable file
·175 lines (162 loc) · 5.74 KB
/
install_hpx.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/bin/bash -li
# Check proper usage
if [[ $# != 1 ]]
then
echo "Not enough parameters"
echo "Usage: $0 /install/path/"
exit 1
fi
PWD_BAK=$PWD
if [ ! -d $1 ]
then
mkdir -p $1
fi
BASE_PATH=`dirname $(readlink -e $1)`/`basename $1`
echo $BASE_PATH
# Parse Host ... we do different things on edison and babbage
if hostname | grep -q '^bint'
then
HOST="babbage"
elif hostname | grep -q '^edison'
then
HOST="edison"
else
echo "Unknown host! This script only works on the NERSC machines Edison or Babbage"
exit 1
fi
echo "Compiling HPX and dependencies on $HOST"
function build_hpx()
{
if [ ! -d $BASE_PATH/source/hpx ]
then
mkdir -p $BASE_PATH/source
cd $BASE_PATH/source
git clone --depth=1 https://github.com/STEllAR-GROUP/hpx.git
fi
cd $BASE_PATH/source/hpx
git pull --rebase
cd $BASE_PATH
if [[ $HOST == "babbage" ]]
then
load_modules "$MODULES_MIC"
mkdir -p $BASE_PATH/mic/hpx/debug
cd $BASE_PATH/mic/hpx/debug
if [ ! -f CMakeCache.txt ]
then
echo "Configuring HPX for the XeonPhi (Debug version)..."
cmake $BASE_PATH/source/hpx \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-wd68 -mmic" \
-DCMAKE_TOOLCHAIN_FILE=$BASE_PATH/source/hpx/cmake/toolchains/XeonPhi.cmake \
-DMPI_CXX_COMPILER=/opt/intel/impi/5.1.1.109/mic/bin/mpicxx \
-DMPI_C_COMPILER=/opt/intel/impi/5.1.1.109/mic/bin/mpicc \
-DHWLOC_ROOT=$BASE_PATH/mic/hwloc \
-DTBBMALLOC_ROOT=/opt/intel/tbb \
-DBOOST_ROOT=$BOOST_ROOT \
-DTAU_ROOT=$TAUROOTDIR \
-DPAPI_ROOT=$PAPI_PATH \
-DHPX_WITH_PARCELPORT_MPI=On \
-DHPX_WITH_PAPI=On
echo "done"
fi
echo "Building HPX for the XeonPhi (Debug version)..."
make -j8 core
make -j8 examples
echo "Building HPX for the XeonPhi (Debug version)... done"
mkdir -p $BASE_PATH/mic/hpx/release
cd $BASE_PATH/mic/hpx/release
if [ ! -f CMakeCache.txt ]
then
echo "Configuring HPX for the XeonPhi (Release version)..."
cmake $BASE_PATH/source/hpx \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-wd68 -mmic" \
-DCMAKE_TOOLCHAIN_FILE=$BASE_PATH/source/hpx/cmake/toolchains/XeonPhi.cmake \
-DMPI_CXX_COMPILER=/opt/intel/impi/5.1.1.109/mic/bin/mpicxx \
-DMPI_C_COMPILER=/opt/intel/impi/5.1.1.109/mic/bin/mpicc \
-DHWLOC_ROOT=$BASE_PATH/mic/hwloc \
-DTBBMALLOC_ROOT=/opt/intel/tbb \
-DBOOST_ROOT=$BOOST_ROOT \
-DTAU_ROOT=$TAUROOTDIR \
-DPAPI_ROOT=$PAPI_PATH \
-DHPX_WITH_PARCELPORT_MPI=On \
-DHPX_WITH_PAPI=On
echo "done"
fi
echo "Building HPX for the XeonPhi (Release version)..."
make -j8 core
make -j8 examples
echo "Building HPX for the XeonPhi (Release version)... done"
load_modules "$MODULES_HOST"
mkdir -p $BASE_PATH/host/hpx/debug
cd $BASE_PATH/host/hpx/debug
if [ ! -f CMakeCache.txt ]
then
echo "Configuring HPX for the Host (Debug version)..."
cmake $BASE_PATH/source/hpx \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-wd68 -DBOOST_FUSION_DONT_USE_PREPROCESSED_FILES" \
-DCMAKE_CXX_COMPILER=icpc \
-DMPI_C_COMPILER=icc \
-DHWLOC_ROOT=$BASE_PATH/host/hwloc \
-DTBBMALLOC_ROOT=/opt/intel/tbb \
-DHPX_WITH_MALLOC=tbbmalloc \
-DBOOST_ROOT=$BOOST_ROOT \
-DTAU_ROOT=$TAUROOTDIR \
-DPAPI_ROOT=$PAPI_PATH \
-DHPX_WITH_APEX=On \
-DAPEX_WITH_ACTIVEHARMONY=On \
-DHPX_WITH_PARCELPORT_MPI=On \
-DHPX_WITH_PAPI=On
echo "done"
fi
echo "Building HPX for the Host (Debug version)..."
make -j8 core
make -j8 examples
echo "Building HPX for the Host (Debug version)... done"
mkdir -p $BASE_PATH/host/hpx/release
cd $BASE_PATH/host/hpx/release
if [ ! -f CMakeCache.txt ]
then
echo "Configuring HPX for the Host (Release version)..."
cmake $BASE_PATH/source/hpx \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-wd68 -DBOOST_FUSION_DONT_USE_PREPROCESSED_FILES" \
-DCMAKE_CXX_COMPILER=icpc \
-DMPI_C_COMPILER=icc \
-DHWLOC_ROOT=$BASE_PATH/host/hwloc \
-DTBBMALLOC_ROOT=/opt/intel/tbb \
-DHPX_WITH_MALLOC=tbbmalloc \
-DBOOST_ROOT=$BOOST_ROOT \
-DTAU_ROOT=$TAUROOTDIR \
-DPAPI_ROOT=$PAPI_PATH \
-DHPX_WITH_APEX=On \
-DAPEX_WITH_ACTIVEHARMONY=On \
-DHPX_WITH_PARCELPORT_MPI=On \
-DHPX_WITH_PAPI=On
echo "done"
fi
echo "Building HPX for the Host (Release version)..."
make -j8 core
make -j8 examples
echo "Building HPX for the Host (Release version)... done"
else
mkdir -p $BASE_PATH/build/
fi
}
function create_modulefile()
{
}
mkdir -p $BASE_PATH
# Compile list of needed modules:
if [[ $HOST == "babbage" ]]
then
cd $BASE_PATH
install_hwloc
MODULES_HOST="cmake intel impi gcc boost/host-1.57.0 tau/host-2.25 papi/host-5.3.0"
MODULES_MIC="cmake intel impi gcc boost/mic-1.57.0 tau/mic-2.25 papi/mic-5.3.0"
build_hpx
elif [[ $HOST == "edison" ]]
then
MODULES=""
fi