Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Add scripts to compile DTK with sanitizer and modify scripts that all…
Browse files Browse the repository at this point in the history
…ow jenkins to launch the new job.
  • Loading branch information
Rombur committed Jan 9, 2017
1 parent 09fdde5 commit d2c8c4f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
11 changes: 11 additions & 0 deletions docker/jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ cd ${TRILINOS_DIR}/DataTransferKit
[ -d build ] && rm -rf build
mkdir build && cd build
# configure trilinos with dtk
if [ ${SANITIZE} == "undefined" ]
then . ../scripts/docker_clang_env.sh undefined_sanitizer
../scripts/docker_cmake -D Trilinos_ENABLE_Fortran=OFF -D TPL_ENABLE_MOAB=OFF
elif [ ${SANITIZE} == "thread" ]
then . ../scripts/docker_clang_env.sh thread_sanitizer
../scripts/docker_cmake -D Trilinos_ENABLE_Fortran=OFF
else
../scripts/docker_cmake -D Trilinos_ENABLE_COVERAGE_TESTING=ON
fi
# build
make -j${NPROC} -i
# run the unit tests
ctest -j${NPROC} --no-compress-output -T Test
if [ -z ${SANITIZE} ]
then
# collect coverage data
lcov --capture --directory DataTransferKit --output-file lcov.info
# upload it to codecov
curl -s https://codecov.io/bash -o codecov_bash_uploader
chmod +x codecov_bash_uploader
./codecov_bash_uploader -Z -X gcov -f lcov.info
fi
5 changes: 3 additions & 2 deletions docker/jenkins/config.dict
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
'tag': 'latest',
'name': os.getenv("BUILD_TAG"),
'cmd': [
'sh -c "patch -d /scratch/source/trilinos/release -p1 -i /scratch/source/trilinos/release/DataTransferKit/docker/jenkins/trilinos_stk.patch"',
'sh -xe /scratch/source/trilinos/release/DataTransferKit/docker/jenkins/build.sh',
'bash -c "patch -d /scratch/source/trilinos/release -p1 -i /scratch/source/trilinos/release/DataTransferKit/docker/jenkins/trilinos_stk.patch"',
'bash -xe /scratch/source/trilinos/release/DataTransferKit/docker/jenkins/build.sh',
],
'volumes': [
os.getenv("WORKSPACE") + ':/scratch/source/trilinos/release/DataTransferKit',
],
'environment': {
'NPROC': '16',
'CODECOV_TOKEN': os.getenv("CODECOV_TOKEN"),
'SANITIZE': os.getenv("SANITIZE"),
'JENKINS_URL': os.getenv("JENKINS_URL"),
'BUILD_NUMBER': os.getenv("BUILD_NUMBER"),
'BUILD_URL': os.getenv("BUILD_URL"),
Expand Down
19 changes: 19 additions & 0 deletions scripts/docker_clang_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use clang instead of gcc
export OMPI_CC=/usr/bin/clang-3.9
export OMPI_CXX=/usr/bin/clang++-3.9
export CC=mpicc
export CXX=mpicxx

# Add clang OpenMP runtime library to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

SANITIZER=$1
if [ "$SANITIZER" == "undefined_sanitizer" ]
then FLAGS="-fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
# Suppress leak sanitizer on functions we have no control of.
export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
elif [ "$SANITIZER" == "thread_sanitizer" ]
then FLAGS="-fsanitize=thread"
fi

export SANITIZER_FLAGS="$FLAGS"
2 changes: 1 addition & 1 deletion scripts/docker_cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARGS=(
-D BUILD_SHARED_LIBS=ON
### COMPILERS AND FLAGS ###
-D CMAKE_CXX_FLAGS="-Wall -Wpedantic"
-D DataTransferKit_CXX_FLAGS="-Wall -Wno-shadow -Wpedantic"
-D DataTransferKit_CXX_FLAGS="-Wall -Wno-shadow -Wpedantic ${SANITIZER_FLAGS}"
### TPLs ###
-D TPL_ENABLE_MPI=ON
-D TPL_ENABLE_BLAS=ON
Expand Down
3 changes: 3 additions & 0 deletions scripts/leak_blacklist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
leak:libmpi.so
leak:libopen-pal.so
leak:exe
3 changes: 3 additions & 0 deletions scripts/undefined_blacklist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This two problems seem related
src:/scratch/source/trilinos/release/packages/stk/stk_mesh/*
src:/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c\+\+/5.4.0/bits/*

0 comments on commit d2c8c4f

Please sign in to comment.