ci-linux.sh 3.4 KB
Newer Older
Max Lyon's avatar
add CI  
Max Lyon committed
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
#!/bin/bash

COMPILER=$1
LANGUAGE=$2

# Exit script on any error
set -e

OPTIONS=""
MAKE_OPTIONS=""
BUILDPATH=""

if [ "$COMPILER" == "gcc" ]; then
  echo "Building with GCC";
  BUILDPATH="gcc"

  # without icecc: no options required
  OPTIONS="-DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++ -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc"
  MAKE_OPTIONS="-j16"
  export ICECC_CXX=/usr/bin/g++ ; export ICECC_CC=/usr/bin/gcc

elif [ "$COMPILER" == "clang" ]; then

  OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
  echo "Building with CLANG";
  BUILDPATH="clang"
fi

if [ "$LANGUAGE" == "C++98" ]; then
  echo "Building with C++98";
  BUILDPATH="$BUILDPATH-cpp98"
elif [ "$LANGUAGE" == "C++11" ]; then
  echo "Building with C++11";
  OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
  BUILDPATH="$BUILDPATH-cpp11"
elif [ "$LANGUAGE" == "C++14" ]; then
  echo "Building with C++14";
  OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' "
  BUILDPATH="$BUILDPATH-cpp14"
fi

#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'

#clone OpenVolumeMesh
Max Lyon's avatar
Max Lyon committed
50
if [ -d OpenVolumeMesh/ ]; then
Max Lyon's avatar
Max Lyon committed
51
  cd OpenVolumeMesh
Max Lyon's avatar
add CI  
Max Lyon committed
52
53
  git pull
  cd ..
Max Lyon's avatar
Max Lyon committed
54
55
else
  git clone https://graphics.rwth-aachen.de:9000/OpenVolumeMesh/OpenVolumeMesh
Max Lyon's avatar
add CI  
Max Lyon committed
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
fi


echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Basic configuration details:"
echo "======================================================================"
echo -e "${NC}"

echo "Compiler:     $COMPILER"
echo "Options:      $OPTIONS"
echo "Language:     $LANGUAGE"
echo "Make Options: $OPTIONS"
echo "BuildPath:    $BUILDPATH"
echo "Path:         $PATH"
echo "Language:     $LANGUAGE"

echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Release version"
echo "======================================================================"
echo -e "${NC}"


Max Lyon's avatar
Max Lyon committed
82
83
git submodule update --init --recursive

Max Lyon's avatar
Max Lyon committed
84
85
if [ ! -d build-release-$BUILDPATH ]; then
  mkdir build-release-$BUILDPATH
Max Lyon's avatar
add CI  
Max Lyon committed
86
87
fi

Max Lyon's avatar
Max Lyon committed
88
cd build-release-$BUILDPATH
Max Lyon's avatar
add CI  
Max Lyon committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

cmake -DCMAKE_BUILD_TYPE=Release -DHEXEX_BUILD_UNIT_TESTS=TRUE $OPTIONS ../

#build it
make $MAKE_OPTIONS

#build the unit tests
make  $MAKE_OPTIONS unittests

echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Release version"
echo "======================================================================"
echo -e "${NC}"

Max Lyon's avatar
Max Lyon committed
105
cd Build/bin
Max Lyon's avatar
add CI  
Max Lyon committed
106
107
108
109

#execute tests
./unittests --gtest_color=yes --gtest_output=xml

110
cd ../../..
Max Lyon's avatar
add CI  
Max Lyon committed
111
112
113
114
115
116
117
118
119

echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Debug version"
echo "======================================================================"
echo -e "${NC}"


Max Lyon's avatar
Max Lyon committed
120
121
if [ ! -d build-debug-$BUILDPATH ]; then
  mkdir build-debug-$BUILDPATH
Max Lyon's avatar
add CI  
Max Lyon committed
122
123
fi

Max Lyon's avatar
Max Lyon committed
124
cd build-debug-$BUILDPATH
Max Lyon's avatar
add CI  
Max Lyon committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

cmake -DCMAKE_BUILD_TYPE=Debug -DHEXEX_BUILD_UNIT_TESTS=TRUE $OPTIONS ../

#build it
make $MAKE_OPTIONS

#build the unit tests
make  $MAKE_OPTIONS unittests

echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Debug version"
echo "======================================================================"
echo -e "${NC}"


Max Lyon's avatar
Max Lyon committed
142
cd Build/bin
Max Lyon's avatar
add CI  
Max Lyon committed
143
144
145
146

#execute tests
./unittests --gtest_color=yes --gtest_output=xml

147
cd ../../..