Commit 4acadd45 authored by Dominik Thoennes's avatar Dominik Thoennes Committed by Sebastian Eibl
Browse files

Add debug STL build in CI

parent 03e1fca2
......@@ -33,7 +33,24 @@ stages:
- mkdir $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- if dpkg --compare-versions `ompi_info | head -2 | tail -1 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'` ge 1.10; then export MPIEXEC_PREFLAGS="--allow-run-as-root" ; fi
- cmake .. -DWALBERLA_BUFFER_DEBUG=$WALBERLA_BUFFER_DEBUG -DWALBERLA_BUILD_TESTS=ON -DWALBERLA_BUILD_BENCHMARKS=ON -DWALBERLA_BUILD_TUTORIALS=ON -DWALBERLA_BUILD_TOOLS=ON -DWALBERLA_BUILD_WITH_MPI=$WALBERLA_BUILD_WITH_MPI -DWALBERLA_BUILD_WITH_CUDA=$WALBERLA_BUILD_WITH_CUDA -DWALBERLA_BUILD_WITH_PYTHON=$WALBERLA_BUILD_WITH_PYTHON -DWALBERLA_BUILD_WITH_OPENMP=$WALBERLA_BUILD_WITH_OPENMP -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DMPIEXEC_PREFLAGS=$MPIEXEC_PREFLAGS -DWALBERLA_DOUBLE_ACCURACY=$WALBERLA_DOUBLE_ACCURACY -DWARNING_ERROR=ON -DWALBERLA_BUILD_WITH_METIS=$WALBERLA_BUILD_WITH_METIS -DWALBERLA_BUILD_WITH_PARMETIS=$WALBERLA_BUILD_WITH_PARMETIS -DWALBERLA_ENABLE_GUI=$WALBERLA_ENABLE_GUI -DWALBERLA_BUILD_WITH_CODEGEN=$WALBERLA_BUILD_WITH_CODEGEN
- cmake ..
-DWALBERLA_BUFFER_DEBUG=$WALBERLA_BUFFER_DEBUG
-DWALBERLA_BUILD_TESTS=ON
-DWALBERLA_BUILD_BENCHMARKS=ON
-DWALBERLA_BUILD_TUTORIALS=ON
-DWALBERLA_BUILD_TOOLS=ON
-DWALBERLA_BUILD_WITH_MPI=$WALBERLA_BUILD_WITH_MPI
-DWALBERLA_BUILD_WITH_CUDA=$WALBERLA_BUILD_WITH_CUDA
-DWALBERLA_BUILD_WITH_PYTHON=$WALBERLA_BUILD_WITH_PYTHON
-DWALBERLA_BUILD_WITH_OPENMP=$WALBERLA_BUILD_WITH_OPENMP
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DMPIEXEC_PREFLAGS=$MPIEXEC_PREFLAGS
-DWALBERLA_DOUBLE_ACCURACY=$WALBERLA_DOUBLE_ACCURACY
-DWARNING_ERROR=ON
-DWALBERLA_BUILD_WITH_METIS=$WALBERLA_BUILD_WITH_METIS
-DWALBERLA_BUILD_WITH_PARMETIS=$WALBERLA_BUILD_WITH_PARMETIS
-DWALBERLA_ENABLE_GUI=$WALBERLA_ENABLE_GUI
-DWALBERLA_BUILD_WITH_CODEGEN=$WALBERLA_BUILD_WITH_CODEGEN
-DWALBERLA_STL_BOUNDS_CHECKS=$WALBERLA_STL_BOUNDS_CHECKS
- cmake . -LAH
- make -j $NUM_BUILD_CORES -l $NUM_CORES
- ctest -LE $CTEST_EXCLUDE_LABELS -C $CMAKE_BUILD_TYPE --output-on-failure -j $NUM_CORES
......@@ -1878,9 +1895,9 @@ gcc_8_hybrid_dbg_noboost:
## ##
###############################################################################
gcc_9_stl_debug:
gcc_10_stl_debug:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-debug-stl:10
before_script:
- rm -rf /opt/boost /usr/include/boost
variables:
......@@ -1896,11 +1913,13 @@ gcc_9_stl_debug:
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_PYTHON: "OFF"
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
WALBERLA_STL_BOUNDS_CHECKS: "ON"
tags:
- docker
stage: merge_request
when: manual
needs: [ ]
allow_failure: false
......
......@@ -373,6 +373,7 @@ endif ( )
if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG )
if ( WALBERLA_STL_BOUNDS_CHECKS )
add_definitions ( "-D_GLIBCXX_DEBUG" )
add_definitions ( "-D_LIBCPP_DEBUG=1" )
endif()
endif()
......
......@@ -41,6 +41,8 @@
#cmakedefine WALBERLA_THREAD_SAFE_LOGGING
#cmakedefine WALBERLA_STL_BOUNDS_CHECKS
// Compiler
#cmakedefine WALBERLA_CXX_COMPILER_IS_GNU
#cmakedefine WALBERLA_CXX_COMPILER_IS_INTEL
......
......@@ -188,6 +188,10 @@ waLBerla_execute_test( NAME ConcatIterator )
waLBerla_compile_test( FILES DataTypesTest.cpp )
waLBerla_execute_test( NAME DataTypesTest )
waLBerla_compile_test( FILES DebugSTLTest.cpp )
waLBerla_execute_test( NAME DebugSTLTest )
set_tests_properties(DebugSTLTest PROPERTIES WILL_FAIL TRUE)
waLBerla_compile_test( FILES FunctionTraitsTest.cpp )
waLBerla_execute_test( NAME FunctionTraitsTest )
......
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file GridGeneratorTest.cpp
//! \author Dominik Thoennes <dominik.thoennes@fau.de>
//
//======================================================================================================================
#include <cstdlib>
#include <vector>
#include "waLBerlaDefinitions.h"
// this test is expected to fail
int main(int /*argc*/, char** /*argv*/)
{
int ret = EXIT_FAILURE;
#ifdef WALBERLA_STL_BOUNDS_CHECKS
std::vector< int > a(100);
// this throws an exception if the debug STL is used
// otherwise main will return 0 and the test fails since it is expected to fail
if (a[200] != 1337) { ret = EXIT_SUCCESS; }
#endif
return ret;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment