-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild_linux.sh
executable file
·79 lines (66 loc) · 1.89 KB
/
build_linux.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
#!/bin/bash -e
NUM_CORES=$(grep -c processor /proc/cpuinfo)
export DAL_DIR=$PWD
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
export BUILD_TYPE=Release
export SKIP_TESTS=false
export USE_COVERAGE=false # make it `false` when you need a full performance lib
export CMAKE_EXPORT_COMPILE_COMMANDS=on
export BUILD_SHARED_LIBS=off
export CMAKE_TOOLCHAIN_FILE=$PWD/externals/vcpkg/scripts/buildsystems/vcpkg.cmake
echo NUM_CORES: $NUM_CORES
echo BUILD_TYPE: $BUILD_TYPE
echo DAL_DIR: "$DAL_DIR"
echo SKIP_TESTS: $SKIP_TESTS
echo USE_COVERAGE: $USE_COVERAGE
echo BUILD_SHARED_LIBS: $BUILD_SHARED_LIBS
echo CMAKE_EXPORT_COMPILE_COMMANDS: $CMAKE_EXPORT_COMPILE_COMMANDS
echo CMAKE_TOOLCHAIN_FILE: "$CMAKE_TOOLCHAIN_FILE"
(
cd externals/vcpkg
if [ -f "./vcpkg" ]; then
echo "vcpkg executable already exists"
else
bash bootstrap-vcpkg.sh
fi
./vcpkg install gtest
./vcpkg install rapidjson
)
if [ $? -ne 0 ]; then
exit 1
fi
(
cd externals/machinist || exit
bash -e ./build_linux.sh
)
if [ $? -ne 0 ]; then
exit 1
fi
export MACHINIST_TEMPLATE_DIR=$PWD/externals/machinist/template/
./externals/machinist/bin/Machinist -c config/dal.ifc -l config/dal.mgl -d ./dal
./externals/machinist/bin/Machinist -c config/dal.ifc -l config/dal.mgl -d ./public
if [ $? -ne 0 ]; then
exit 1
fi
(
cd externals/adept || exit
autoreconf -i
./configure --disable-openmp --prefix=$PWD/build
make -j"${NUM_CORES}"
make install
)
rm -rf build
mkdir -p build
(
cd build || exit
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX="$DAL_DIR" -DUSE_COVERAGE=$USE_COVERAGE -DSKIP_TESTS=$SKIP_TESTS -DCMAKE_EXPORT_COMPILE_COMMANDS=$CMAKE_EXPORT_COMPILE_COMMANDS -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE ..
make -j"${NUM_CORES}"
make install
)
if [ $? -ne 0 ]; then
exit 1
fi
if [ "$SKIP_TESTS" = "false" ]; then
bin/test_suite
fi
echo "Finished building of Derivatives Algorithms Library"