-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·115 lines (106 loc) · 3 KB
/
setup.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
#!/bin/bash
mkdir -p lib
cd lib
gbench="benchmark"
adept="adept-2.0.8"
adolc="adolc"
cppad="cppad"
sacado="Trilinos"
stan="stan-dev-math"
fastad="FastAD"
# setup GBench
if [ ! -d "$gbench" ]; then
git clone https://github.com/google/benchmark.git $gbench
git clone https://github.com/google/googletest.git $gbench/googletest
cd benchmark
cmake -E make_directory "build"
cmake -E chdir "build" cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=. \
-DCMAKE_CXX_COMPILER="g++-10" \
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF \
../
cmake --build "build" --config Release
cmake --build "build" --config Release --target install
cd ..
fi
# setup Adept2.0.8
if [ ! -d "$adept" ]; then
wget http://www.met.reading.ac.uk/clouds/adept/$adept.tar.gz
tar xvfz $adept.tar.gz
rm -rf $adept.tar.gz
cd $adept
mkdir -p build
./configure CXXFLAGS="-O3 -march=native" --prefix=$PWD/build --exec_prefix=$PWD/build
make
make install
cd ../ # back in lib
fi
# setup ADOL-C
if [ ! -d "$adolc" ]; then
git clone --depth 1 --branch releases/2.7.2 https://github.com/coin-or/ADOL-C.git $adolc
cd $adolc
mkdir -p build
autoreconf -fi
CC=gcc-10 CXX=g++-10 ./configure \
--prefix=$PWD/build \
--exec_prefix=$PWD/build \
--with-cflags="-O3 -march=native" \
--with-cxxflags="-O3 -march=native -std=c++17"
make -j6
make install
cd ../ # back in lib
fi
# setup CppAD
if [ ! -d "$cppad" ]; then
git clone --depth 1 --branch 20200000.3 https://github.com/coin-or/CppAD.git $cppad
cd $cppad
mkdir -p build
cd build
cmake .. \
-DCMAKE_C_COMPILER="gcc-10" \
-DCMAKE_CXX_COMPILER="g++-10" \
-Dcppad_prefix="." \
-DCMAKE_MACOSX_RPATH=1
make -j6
make install
cd ../../ # back in lib
fi
# setup Sacado
if [ ! -d "$sacado" ]; then
git clone --depth 1 --branch trilinos-release-13-0-0 https://github.com/trilinos/Trilinos.git
cd Trilinos
mkdir -p build
cd build
cmake \
-DCMAKE_C_COMPILER="gcc-10" \
-DCMAKE_CXX_COMPILER="g++-10" \
-DTrilinos_GENERATE_REPO_VERSION_FILE=OFF \
-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION=ON \
-DBUILD_SHARED_LIBS=ON \
-DTrilinos_ENABLE_Fortran=OFF \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="." \
..
make -j6 install
cd ../../ # back in lib
fi
# setup STAN
if [ ! -d "$stan" ]; then
git clone --depth 1 --branch v3.3.0 https://github.com/stan-dev/math.git $stan
cd $stan
echo "CXX=g++-10" > make/local
make -j4 -f make/standalone math-libs
cd ../ # back in lib
fi
# setup FastAD3
if [ ! -d "$fastad" ]; then
git clone https://github.com/JamesYang007/$fastad.git
cd $fastad
./clean-build.sh release -DFASTAD_ENABLE_TEST=OFF \
-DCMAKE_INSTALL_PREFIX=".." # installs into build
cd build/release
ninja install
cd ../../.. # back in lib
fi