diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fcdc8c5dfa6d3dd887ed8f4c6fcf4093e753869..f7332d1583563a03bcd389b8c562bf416ec4ecb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -795,6 +795,22 @@ gcc_8_hybrid_dbg: tags: - docker +gcc_8_hybrid_dbg_noboost: + <<: *build_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 + before_script: + - rm -rf /opt/boost /usr/include/boost + variables: + <<: *build_hybrid_dbg_variables + WALBERLA_BUILD_WITH_CUDA: "OFF" + WALBERLA_ENABLE_GUI: 0 + WALBERLA_BUILD_WITH_PYTHON: "OFF" + except: + variables: + - $DISABLE_PER_COMMIT_BUILDS + tags: + - docker + gcc_8_hybrid_dbg_sp: <<: *build_definition image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 diff --git a/CMakeLists.txt b/CMakeLists.txt index 735bbe5eda82c3a69cef0c98975c2ee2cbe9429b..d3234150dd933d903341b1d06b424c052f7c05e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -718,9 +718,18 @@ if ( Boost_FOUND ) list( APPEND LINK_DIRS ${PYTHON_LIBRARY_DIR}/libs ) endif() + set( WALBERLA_BUILD_WITH_BOOST TRUE CACHE INTERNAL "Build with Boost" ) else( Boost_FOUND ) - # Search again, this time with the REQUIRED option. This will give a CMAKE error and a detailed error message for the user - find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} REQUIRED ${waLBerla_REQUIRED_BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${waLBerla_OPTIONAL_BOOST_COMPONENTS} ) + if( (WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM OR WALBERLA_USE_STD_FILESYSTEM) AND (WALBERLA_USE_STD_EXPERIMENTAL_ANY OR WALBERLA_USE_STD_ANY) AND (WALBERLA_USE_STD_EXPERIMENTAL_OPTIONAL OR WALBERLA_USE_STD_OPTIONAL) AND NOT WALBERLA_BUILD_WITH_PYTHON) + # we don't really need Boost + set( WALBERLA_BUILD_WITH_BOOST FALSE CACHE INTERNAL "Build with Boost" ) + else() + # Search again, this time with the REQUIRED option. This will give a CMAKE error and a detailed error message for the user + find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} REQUIRED ${waLBerla_REQUIRED_BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${waLBerla_OPTIONAL_BOOST_COMPONENTS} ) + if( (WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM OR WALBERLA_USE_STD_FILESYSTEM) AND (WALBERLA_USE_STD_EXPERIMENTAL_ANY OR WALBERLA_USE_STD_ANY) AND (WALBERLA_USE_STD_EXPERIMENTAL_OPTIONAL OR WALBERLA_USE_STD_OPTIONAL) ) + message(WARNING "If you set WALBERLA_BUILD_WITH_PYTHON=OFF, you can build without the Boost library.") + endif() + endif() endif( Boost_FOUND ) diff --git a/src/blockforest/BlockForest.h b/src/blockforest/BlockForest.h index c109a605390f9f6213006de800ee697f4d0a91ab..45f39dcef889354810be9a7acd2e9e460d76ddec 100644 --- a/src/blockforest/BlockForest.h +++ b/src/blockforest/BlockForest.h @@ -854,7 +854,7 @@ template< typename T > inline BlockDataID BlockForest::addBlockData( const shared_ptr< T > & dataHandling, const std::string & identifier, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors ) { - //static_assert( boost::is_base_of< BlockDataHandling<typename T::value_type>, T >::value ); + //static_assert( std::is_base_of< BlockDataHandling<typename T::value_type>, T >::value ); auto downcast = dynamic_pointer_cast< blockforest::BlockDataHandling<typename T::value_type> >( dataHandling ); diff --git a/src/core/config/ConfigToBoostPropertyTree.cpp b/src/core/config/ConfigToBoostPropertyTree.cpp index e3b5e6b40bc0ead8cd49fce3aba4c432f407d710..45a04fc47854faa9f5cda5f4b8538b7297abfa8a 100644 --- a/src/core/config/ConfigToBoostPropertyTree.cpp +++ b/src/core/config/ConfigToBoostPropertyTree.cpp @@ -19,6 +19,9 @@ // //====================================================================================================================== +#include "waLBerlaDefinitions.h" +#ifdef WALBERLA_BUILD_WITH_BOOST + #include "ConfigToBoostPropertyTree.h" #include <boost/property_tree/ptree.hpp> @@ -51,3 +54,5 @@ boost::property_tree::iptree configToBoostPropertyTree( const Config & config ) } // namespace config } // namespace walberla + +#endif diff --git a/src/core/config/all.h b/src/core/config/all.h index 0994ebc80709d4645ec9edc3e7057fe60f8fa3c6..43bbd4f687a4907e644fd4169fbee71893f6a899 100644 --- a/src/core/config/all.h +++ b/src/core/config/all.h @@ -23,5 +23,7 @@ #pragma once #include "Config.h" +#ifdef WALBERLA_BUILD_WITH_BOOST #include "ConfigToBoostPropertyTree.h" +#endif #include "Create.h" diff --git a/src/core/math/PhysicalCheck.cpp b/src/core/math/PhysicalCheck.cpp index 7c3342449e13ab888e8186c3e385f204b25ffa7b..4800f192929bbcd0d60aa353e8955fae0f38d7ad 100644 --- a/src/core/math/PhysicalCheck.cpp +++ b/src/core/math/PhysicalCheck.cpp @@ -19,6 +19,9 @@ // //====================================================================================================================== +#include "waLBerlaDefinitions.h" +#ifdef WALBERLA_BUILD_WITH_BOOST + #include "PhysicalCheck.h" #include "core/Abort.h" #include "core/logging/Logging.h" @@ -536,3 +539,5 @@ namespace math { } // namespace math } // namespace walberla + +#endif diff --git a/src/core/math/all.h b/src/core/math/all.h index 29295fc4f159d9540e7e21b4e54ccb9270c222ec..0d5c22ad7d8b0f11e5887e47712ee0e36dcc9fdb 100644 --- a/src/core/math/all.h +++ b/src/core/math/all.h @@ -36,7 +36,9 @@ #include "Matrix3.h" #include "Parser.h" #include "ParserOMP.h" +#ifdef WALBERLA_BUILD_WITH_BOOST #include "PhysicalCheck.h" +#endif #include "Plane.h" #include "Primes.h" #include "Random.h" diff --git a/src/core/math/equation_system/EquationParser.cpp b/src/core/math/equation_system/EquationParser.cpp index 5f064d79c073d1b9e85261018b7acd6c2ad3a835..4a3894268b19b4f4b88cd4248caffd42b32d4456 100644 --- a/src/core/math/equation_system/EquationParser.cpp +++ b/src/core/math/equation_system/EquationParser.cpp @@ -19,6 +19,9 @@ // //====================================================================================================================== +#include "waLBerlaDefinitions.h" +#ifdef WALBERLA_BUILD_WITH_BOOST + #include "Equation.h" #include "EquationParser.h" #include "Operator.h" @@ -340,3 +343,5 @@ EquationPtr EquationParser::parseEquation( const std::string& str, size_t& index } // namespace math } // namespace walberla + +#endif \ No newline at end of file diff --git a/src/core/math/equation_system/EquationSystem.cpp b/src/core/math/equation_system/EquationSystem.cpp index a1293082fb12e88cd47c42a6bd811faf28dfe443..433a1283c2f9e6350c80184ff36af6279f1ed611 100644 --- a/src/core/math/equation_system/EquationSystem.cpp +++ b/src/core/math/equation_system/EquationSystem.cpp @@ -19,6 +19,9 @@ // //====================================================================================================================== +#include "waLBerlaDefinitions.h" +#ifdef WALBERLA_BUILD_WITH_BOOST + #include "Equation.h" #include "EquationSystem.h" #include "Variable.h" @@ -198,3 +201,5 @@ std::ostream& operator<<( std::ostream& os, EquationSystem& es ) } // namespace math } // namespace walberla + +#endif diff --git a/src/core/math/equation_system/all.h b/src/core/math/equation_system/all.h index 7ab238733df8855abfb38a2bb9b674be987cf9d2..5c3cc61ed82ebd39c635b37d4f92bb51e5f19f3c 100644 --- a/src/core/math/equation_system/all.h +++ b/src/core/math/equation_system/all.h @@ -23,7 +23,9 @@ #pragma once #include "Equation.h" +#ifdef WALBERLA_BUILD_WITH_BOOST #include "EquationParser.h" #include "EquationSystem.h" +#endif #include "Operator.h" #include "Variable.h" \ No newline at end of file diff --git a/src/waLBerlaDefinitions.in.h b/src/waLBerlaDefinitions.in.h index 610aea18d7e537ea82fbd70bca59eda88e3f55cc..82f38181f2388727934ded2e08f302e34369b7e1 100644 --- a/src/waLBerlaDefinitions.in.h +++ b/src/waLBerlaDefinitions.in.h @@ -19,6 +19,7 @@ // External libraries +#cmakedefine WALBERLA_BUILD_WITH_BOOST #cmakedefine WALBERLA_BUILD_WITH_MPI #cmakedefine WALBERLA_BUILD_WITH_OPENMP #cmakedefine WALBERLA_BUILD_WITH_METIS diff --git a/tests/core/CMakeLists.txt b/tests/core/CMakeLists.txt index e0a417390ec64f72d69acdfc57e3bc5c508f8f43..0a2f5a3851424b89295222d15ff981c329f45723 100644 --- a/tests/core/CMakeLists.txt +++ b/tests/core/CMakeLists.txt @@ -21,12 +21,16 @@ waLBerla_execute_test( NAME CellIntervalTest ) waLBerla_compile_test( FILES config/ConfigTest.cpp ) waLBerla_execute_test( NAME ConfigTest COMMAND $<TARGET_FILE:ConfigTest> ${CMAKE_CURRENT_SOURCE_DIR}/config/ConfigTest.dat ) -waLBerla_compile_test( FILES config/PropertyTreeTest.cpp) -#waLBerla_execute_test(NAME PropertyTreeTest COMMAND $<TARGET_FILE:PropertyTreeTest> ) +if( WALBERLA_BUILD_WITH_BOOST ) + waLBerla_compile_test( FILES config/PropertyTreeTest.cpp) + #waLBerla_execute_test(NAME PropertyTreeTest COMMAND $<TARGET_FILE:PropertyTreeTest> ) +endif( WALBERLA_BUILD_WITH_BOOST ) -waLBerla_compile_test( FILES config/MultiArrayIOTest.cpp ) -waLBerla_execute_test( NAME MultiArrayIOTest COMMAND $<TARGET_FILE:MultiArrayIOTest> ) +if( WALBERLA_BUILD_WITH_BOOST ) + waLBerla_compile_test( FILES config/MultiArrayIOTest.cpp ) + waLBerla_execute_test( NAME MultiArrayIOTest COMMAND $<TARGET_FILE:MultiArrayIOTest> ) +endif( WALBERLA_BUILD_WITH_BOOST ) ######### @@ -84,9 +88,11 @@ waLBerla_execute_test( NAME Matrix3Test ) waLBerla_compile_test( FILES math/GenericAABBTest.cpp DEPENDS stencil domain_decomposition ) waLBerla_execute_test( NAME GenericAABBTest ) -waLBerla_compile_test( FILES math/PhysicalCheckTest.cpp DEPENDS stencil ) -waLBerla_execute_test( NAME PhysicalCheckTest - COMMAND $<TARGET_FILE:PhysicalCheckTest> ${CMAKE_CURRENT_SOURCE_DIR}/math/PhysicalCheckTestInput.prm ) +if( WALBERLA_BUILD_WITH_BOOST ) + waLBerla_compile_test( FILES math/PhysicalCheckTest.cpp DEPENDS stencil ) + waLBerla_execute_test( NAME PhysicalCheckTest + COMMAND $<TARGET_FILE:PhysicalCheckTest> ${CMAKE_CURRENT_SOURCE_DIR}/math/PhysicalCheckTestInput.prm ) +endif( WALBERLA_BUILD_WITH_BOOST ) waLBerla_compile_test( FILES math/FastInvSqrtTest.cpp ) @@ -96,8 +102,10 @@ waLBerla_execute_test( NAME FastInvSqrtTest ) # math/equation_system # ######################## -waLBerla_compile_test( FILES math/equation_system/EquationSolverTest.cpp ) -waLBerla_execute_test( NAME EquationSolverTest ) +if( WALBERLA_BUILD_WITH_BOOST ) + waLBerla_compile_test( FILES math/equation_system/EquationSolverTest.cpp ) + waLBerla_execute_test( NAME EquationSolverTest ) +endif( WALBERLA_BUILD_WITH_BOOST ) ####### # mpi #