-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·62 lines (52 loc) · 1.6 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
#!/bin/bash
buildtype="Release"
dcmake_c_compiler=""
dcmake_cxx_compiler=""
if [[ "$@" == *"ebug"* ]]
then
buildtype="Debug"
fi
if [[ "$@" == *"lean"* ]]
then
echo "Cleaning build"
rm -rf build
rm -rf cmake/download_scripts/tmp/
exit 0
fi
if [[ "$OSTYPE" == "linux-gnu" ]] || [[ "$OSTYPE" == "cygwin" ]]; then
echo "OS: Linux"
if [[ "$HOSTNAME" == *"triolith"* ]]; then
echo "We're on triolith!";
module add cmake/3.6.1
module load buildenv-intel/2016-3
export CC=/software/apps/gcc/5.3.0/build01/bin/gcc
export CXX=/software/apps/gcc/5.3.0/build01/bin/g++
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "OS: Mac OSX"
echo "Checking that GCC is installed in homebrew: [brew ls gcc | grep -q 'g++-7']"
if brew ls gcc | grep -q 'g++-7'; then
echo "GCC-7 is installed"
export CC=gcc-7
export CXX=g++-7
dcmake_c_compiler="-DCMAKE_C_COMPILER=gcc-7"
dcmake_cxx_compiler="-DCMAKE_CXX_COMPILER=g++-7"
else
echo "Please install GCC (version 7) through homebrew"
fi
else
echo "Could not identify OS"
fi
echo "Starting Build"
cmake -E make_directory build/${buildtype}
cd build/${buildtype}
cmake ${dcmake_c_compiler} ${dcmake_cxx_compiler} -DCMAKE_BUILD_TYPE=${buildtype} -G "CodeBlocks - Unix Makefiles" ../../
cmake --build . --target PT -- -j 4
#
#
#cmake -E make_directory build/${buildtype}
#cd build/${buildtype}
#cmake -Bbuild/${buildtype} --build build -config ${buildtype} ../../
#make
#cmake ${dcmake_c_compiler} ${dcmake_cxx_compiler} -DCMAKE_BUILD_TYPE=${buildtype} ../../
#make