-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·70 lines (69 loc) · 2.36 KB
/
build.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
#!/bin/bash
#
# Define how to build the libraries and executables:
BUILD_TYPE=Debug
Fortran_COMPILER=gfortran
LIBSUFFIX="so"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
LIBSUFFIX="so"
elif [[ "$OSTYPE" == "darwin"* ]]; then
LIBSUFFIX="dylib"
elif [[ "$OSTYPE" == "CYGWIN"* ]]; then
LIBSUFFIX="dll"
elif [[ "$OSTYPE" == "MINGW"* ]]; then
LIBSUFFIX="dll"
elif [[ "$OSTYPE" == "msys"* ]]; then
LIBSUFFIX="dll"
GENERATOR="MSYS Makefiles"
fi
git submodule update --init --recursive
################################################################################
# #
# Build pFUnit #
# #
################################################################################
cd pFUnit || exit || exit
# Create the build directory if it does not exist
if [[ ! -d "build" ]]; then
mkdir build
else
rm -rf build/*
fi
cd build || exit || exit
echo "Updating cmake"
export PFUNIT_DIR=..//pFUnit/build/installed
export FC=$Fortran_COMPILER
cmake -DSKIP_MPI=yes -G "$GENERATOR" ../
echo "Building pFUnit"
cmake --build .
cmake --install .
cd ../ || exit || exit
echo "Leaving pFUnit"
cd ../ || exit || exit
################################################################################
# #
# Build libslam #
# #
################################################################################
# Create the build directory if it does not exist
if [[ ! -d "build" ]]; then
mkdir build
else
rm -rf build/*
fi
cd build || exit || exit
echo "Executing cmake"
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_Fortran_COMPILER=$Fortran_COMPILER -DENABLE_OpenMP_SUPPORT=ON -DENABLE_POSTGRESQL_SUPPORT=ON -DENABLE_PFUNIT=ON -G "$GENERATOR" ../
echo "Building libslam"
cmake --build .
cmake --install .
if [[ $? -ne 0 ]]; then
echo "Could not build libslam. Exiting."
exit $?
fi
echo "Manually preparing 'lib' and 'include' directories"
cd ../ || exit || exit
ln -sf build/include include || exit || exit
ln -sf build/lib lib || exit || exit
echo "Leaving libslam"
echo "Done"