Newer
Older
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
#!/bin/bash -ex
###############################################################################
# Check if python files have changed
###############################################################################
if $ALLOW_SKIPPING
then
if $WORKSPACE/buildconfig/Jenkins/check_for_changes py
then
echo "no python files changed, skipping pylint"
exit 0
fi
fi
echo "running pylint"
###############################################################################
# Print out the versions of things we are using
###############################################################################
cmake --version
###############################################################################
# RHEL6 setup steps - nodes must have a "rhel6" label set (in lowercase)
###############################################################################
if [[ ${NODE_LABELS} == *rhel6* ]]; then
SCL_ON_RHEL6="scl enable mantidlibs34"
ON_RHEL6=true
else
SCL_ON_RHEL6="eval"
fi
###############################################################################
# Setup the build directory
###############################################################################
BUILD_DIR=$WORKSPACE/build
if [ -z "$BUILD_DIR" ]; then
echo "Build directory not set. Cannot continue"
exit 1
fi
###############################################################################
# Clean build if requested
###############################################################################
if [[ "${CLEAN}" == "true" ]]; then
# Removing the build directory entirely guarantees a completely clean build
rm -rf $BUILD_DIR
fi
###############################################################################
# Create the build directory if it doesn't exist
###############################################################################
[ -d $BUILD_DIR ] || mkdir $BUILD_DIR
cd $BUILD_DIR
###############################################################################
# Clean some artifacts
###############################################################################
rm -rf $BUILD_DIR/bin
###############################################################################
## Build configuration
###############################################################################
BUILD_CONFIG="Release"
###############################################################################
# CMake configuration
###############################################################################
# Generator
if [ $(command -v ninja) ]; then
CMAKE_GENERATOR="-G Ninja"
elif [ $(command -v ninja-build) ]; then
CMAKE_GENERATOR="-G Ninja"
fi
if [ -e $BUILD_DIR/CMakeCache.txt ]; then
CMAKE_GENERATOR=""
fi
# Need this because some strange control sequences when using default TERM=xterm
export TERM="linux"
PYLINT_FORMAT="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"
$SCL_ON_RHEL6 "cmake ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} -DENABLE_CPACK=OFF -DMAKE_VATES=OFF -DPYLINT_MSG_TEMPLATE=\"${PYLINT_FORMAT}\" -DPYLINT_NTHREADS=$BUILD_THREADS -DPYLINT_OUTPUT_DIR=${PYLINT_OUTPUT_DIR} .."
###############################################################################
# Build step (we only need the framework)
###############################################################################
$SCL_ON_RHEL6 "cmake --build . --target Framework -- -j$BUILD_THREADS"
###############################################################################
###############################################################################
$SCL_ON_RHEL6 "cmake --build . --target pylintcheck"