diff --git a/CI/ci-linux.sh b/CI/ci-linux.sh index 3378607c..0fb2d6ff 100755 --- a/CI/ci-linux.sh +++ b/CI/ci-linux.sh @@ -7,11 +7,18 @@ LANGUAGE=$2 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" @@ -28,45 +35,140 @@ elif [ "$LANGUAGE" == "C++11" ]; then BUILDPATH="$BUILDPATH-cpp11" fi -######################################### +#===================================== +# Color Settings: +#===================================== +NC='\033[0m' +OUTPUT='\033[0;32m' +WARNING='\033[0;93m' -# Make release build folder -if [ ! -d build-release-$BUILDPATH ]; then - mkdir build-release-$BUILDPATH + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Release version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then + mkdir build-release-$BUILDPATH-Vector-Checks fi -cd build-release-$BUILDPATH +cd build-release-$BUILDPATH-Vector-Checks -cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../ +cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_BINDINGS=OFF $OPTIONS ../ #build it -make +make $MAKE_OPTIONS #build the unit tests -make unittests +make $MAKE_OPTIONS unittests +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests Release version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" -######################################### -# Run Release Unittests -######################################### cd Unittests #execute tests ./unittests --gtest_color=yes --gtest_output=xml +cd .. cd .. -# Execute Python unittests -cd Python-Unittests -#python -m unittest discover -v +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Release version with vectorchecks disabled for python tests" +echo "======================================================================" +echo -e "${NC}" + +if [ ! -d build-release-$BUILDPATH ]; then + mkdir build-release-$BUILDPATH +fi + +cd build-release-$BUILDPATH + +cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../ + +#build it +make $MAKE_OPTIONS + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running Python unittests Release version " +echo "======================================================================" +echo -e "${NC}" + +if [ "$LANGUAGE" == "C++11" ] || [ "$COMPILER" == "gcc" ] ; then + + # Execute Python unittests + cd Python-Unittests + + python -m unittest discover -v + + cd .. + +else + echo -e "${WARNING}" + echo "WARNING! Python unittests disabled !!" + echo -e "${NC}" +fi + + +cd .. + + + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Debug version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then + mkdir build-debug-$BUILDPATH-Vector-Checks +fi + +cd build-debug-$BUILDPATH-Vector-Checks + +cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_BINDINGS=OFF $OPTIONS ../ + +#build it +make $MAKE_OPTIONS + +#build the unit tests +make $MAKE_OPTIONS unittests + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests Debug version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +cd Unittests + +#execute tests +./unittests --gtest_color=yes --gtest_output=xml cd .. cd .. - -######################################### -# Build Debug version and Unittests -######################################### +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Debug version with vectorchecks disabled for python tests" +echo "======================================================================" +echo -e "${NC}" if [ ! -d build-debug-$BUILDPATH ]; then mkdir build-debug-$BUILDPATH @@ -74,19 +176,28 @@ fi cd build-debug-$BUILDPATH -cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../ +cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../ -#build the unit tests -make unittests +#build it +make $MAKE_OPTIONS +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running Python unittests Debug version " +echo "======================================================================" +echo -e "${NC}" -######################################### -# Run Debug Unittests -######################################### +if [ "$LANGUAGE" == "C++11" ] || [ "$COMPILER" == "gcc" ] ; then -cd Unittests + # Execute Python unittests + cd Python-Unittests -# Run the unittests -./unittests --gtest_color=yes --gtest_output=xml + python -m unittest discover -v +else + echo -e "${WARNING}" + echo "WARNING! Python unittests disabled !!" + echo -e "${NC}" +fi diff --git a/CI/ci-mac.sh b/CI/ci-mac.sh index 0ee6ada2..b580c59f 100755 --- a/CI/ci-mac.sh +++ b/CI/ci-mac.sh @@ -1,10 +1,11 @@ #!/bin/bash #Exit on any error -set -e +set -e LANGUAGE=$1 + PATH=$PATH:/opt/local/bin export PATH @@ -12,23 +13,36 @@ OPTIONS="" 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" +fi + +#===================================== +# Color Settings: +#===================================== +NC='\033[0m' +OUTPUT='\033[0;32m' +WARNING='\033[0;93m' + + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Release version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then + mkdir build-release-$BUILDPATH-Vector-Checks fi +cd build-release-$BUILDPATH-Vector-Checks -######################################### -# Build release version -######################################### - -if [ ! -d build-release ]; then - mkdir build-release -fi - -cd build-release - -cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../ +cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../ #build it make @@ -36,38 +50,84 @@ make #build the unit tests make unittests +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests Release version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" -######################################### -# Run Release Unittests -######################################### cd Unittests #execute tests ./unittests --gtest_color=yes --gtest_output=xml -cd .. -# Execute Python unittests -cd Python-Unittests - -rm -f openmesh.so -cp ../Build/python/openmesh.so . -#python -m unittest discover -v - cd .. cd .. +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Release version with vectorchecks disabled for python tests" +echo "======================================================================" +echo -e "${NC}" -######################################### -# Build Debug version and Unittests -######################################### - -if [ ! -d build-debug ]; then - mkdir build-debug +if [ ! -d build-release-$BUILDPATH ]; then + mkdir build-release-$BUILDPATH fi -cd build-debug +cd build-release-$BUILDPATH -cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../ +cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../ + +#build it +make + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running Python unittests Release version " +echo "======================================================================" +echo -e "${NC}" + + +if [ "$LANGUAGE" == "C++11" ]; then + + # Execute Python unittests + cd Python-Unittests + + rm -f openmesh.so + cp ../Build/python/openmesh.so . + python -m unittest discover -v + + cd .. + +else + echo -e "${WARNING}" + echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!" + echo -e "${NC}" +fi + + +cd .. + + + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Debug version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then + mkdir build-debug-$BUILDPATH-Vector-Checks +fi + +cd build-debug-$BUILDPATH-Vector-Checks + +cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../ #build it make @@ -75,21 +135,59 @@ make #build the unit tests make unittests +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests Debug version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" -######################################### -# Run Debug Unittests -######################################### cd Unittests -# Run the unittests +#execute tests ./unittests --gtest_color=yes --gtest_output=xml +cd .. cd .. -# Execute Python unittests -cd Python-Unittests +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building Debug version with vectorchecks disabled for python tests" +echo "======================================================================" +echo -e "${NC}" -rm -f openmesh.so -cp ../Build/python/openmesh.so . -#python -m unittest discover -v +if [ ! -d build-debug-$BUILDPATH ]; then + mkdir build-debug-$BUILDPATH +fi + +cd build-debug-$BUILDPATH + +cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../ + +#build it +make + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running Python unittests Debug version " +echo "======================================================================" +echo -e "${NC}" + +if [ "$LANGUAGE" == "C++11" ]; then + + # Execute Python unittests + cd Python-Unittests + + rm -f openmesh.so + cp ../Build/python/openmesh.so . + python -m unittest discover -v +else + + echo -e "${WARNING}" + echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!" + echo -e "${NC}" + +fi diff --git a/cmake/ACGCompiler.cmake b/cmake/ACGCompiler.cmake index dd70fea8..92794b50 100644 --- a/cmake/ACGCompiler.cmake +++ b/cmake/ACGCompiler.cmake @@ -134,15 +134,19 @@ if (UNIX) set ( STL_VECTOR_CHECKS false CACHE BOOL "Include full stl vector checks in debug mode (This option is only used in debug Mode!)" ) endif ( NOT STL_VECTOR_CHECKS ) - # Add a flag to check stl vectors in debugging mode + # Add a flag to check stl vectors if ( STL_VECTOR_CHECKS AND NOT CMAKE_SYSTEM MATCHES "SunOS*" ) list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" ) list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC") + list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-D_GLIBCXX_DEBUG" ) + list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC") list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" ) list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC") list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" ) list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC") + list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-D_GLIBCXX_DEBUG" ) + list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC") list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" ) list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC") endif()