From 571660458ecd414b9678a0281c750d474ac5b92a Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Thu, 4 Mar 2021 10:06:57 +0100 Subject: [PATCH 1/7] Silence test warnings due to deprecated Boost headers. --- tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 483294e94..d7dfc947e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,6 +20,7 @@ function(ADD_PAGMO_TESTCASE arg1) # Set the minimum C++ standard to C++17 target_compile_features(${arg1} PRIVATE cxx_std_17) set_property(TARGET ${arg1} PROPERTY CXX_EXTENSIONS NO) + target_compile_definitions(${arg1} PRIVATE BOOST_ALLOW_DEPRECATED_HEADERS) add_test(${arg1} ${arg1}) endfunction() From 4e2ff42caab8f710df29f8b0d1cc9ba1e0e42a20 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Thu, 4 Mar 2021 10:07:29 +0100 Subject: [PATCH 2/7] First stab at supporting oneTBB. --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96653bacf..d5b2d77c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,8 +114,18 @@ if(YACMA_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8") unset(_PAGMO_GCC_SUPPORTS_NO_OVERRIDE) endif() -# TBB. -find_package(TBB REQUIRED) +# TBB. Try to find it first in config mode (supported +# since version 2021 after the oneTBB rename), and, if this +# fails, fall back to our own FindTBB.cmake. This is of course +# not an ideal solution, but it should work until oneTBB +# becomes widely deployed. +find_package(TBB QUIET CONFIG) +if(NOT TBB_FOUND) + message(STATUS "TBB not found using config mode, retrying in module mode.") + find_package(TBB REQUIRED MODULE) +else() + message(STATUS "TBB found using config mode.") +endif() # Eigen3 if(PAGMO_WITH_EIGEN3) From d623be4c3552475f972b22d83c99e717421d3a73 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Thu, 4 Mar 2021 10:10:04 +0100 Subject: [PATCH 3/7] Try updating to GCC 9 on circleci. --- .circleci/config.yml | 12 ++++++------ ...7_coverage.sh => circleci_focal_gcc9_coverage.sh} | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) rename tools/{circleci_bionic_gcc7_coverage.sh => circleci_focal_gcc9_coverage.sh} (94%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95f298019..7d8a41321 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,14 +1,14 @@ -version: 2 +version: 2.1 jobs: - bionic_gcc7_coverage: + focal_gcc9_coverage: docker: - - image: circleci/buildpack-deps:bionic + - image: circleci/buildpack-deps:focal steps: - checkout - run: name: Build and test - command: bash ./tools/circleci_bionic_gcc7_coverage.sh + command: bash ./tools/circleci_focal_gcc9_coverage.sh focal_gcc9_asan: docker: - image: circleci/buildpack-deps:focal @@ -43,10 +43,10 @@ jobs: command: bash ./tools/circleci_bionic_clang6_release.sh workflows: - version: 2 + version: 2.1 all_builds: jobs: - - bionic_gcc7_coverage + - focal_gcc9_coverage - focal_gcc9_asan - focal_clang9 - bionic_clang6_release diff --git a/tools/circleci_bionic_gcc7_coverage.sh b/tools/circleci_focal_gcc9_coverage.sh similarity index 94% rename from tools/circleci_bionic_gcc7_coverage.sh rename to tools/circleci_focal_gcc9_coverage.sh index 438ea8c6d..33a10fa08 100644 --- a/tools/circleci_bionic_gcc7_coverage.sh +++ b/tools/circleci_focal_gcc9_coverage.sh @@ -30,7 +30,7 @@ make -j2 VERBOSE=1 ctest -V # Upload coverage data. -bash <(curl -s https://codecov.io/bash) -x gcov-7 +bash <(curl -s https://codecov.io/bash) -x gcov-9 set +e set +x From 2f68826c9107a9dcd0b48cee78ca7d5522e87d71 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Thu, 4 Mar 2021 10:37:33 +0100 Subject: [PATCH 4/7] Bump version to 2.17.0. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5b2d77c0..1ce0cc816 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ if(NOT CMAKE_BUILD_TYPE) FORCE) endif() -project(pagmo VERSION 2.16.1 LANGUAGES CXX C) +project(pagmo VERSION 2.17.0 LANGUAGES CXX C) # Setup module path. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/yacma") @@ -310,8 +310,8 @@ if(PAGMO_BUILD_STATIC_LIBRARY) add_library(pagmo STATIC "${PAGMO_SRC_FILES}") else() add_library(pagmo SHARED "${PAGMO_SRC_FILES}") - set_property(TARGET pagmo PROPERTY VERSION "6.0") - set_property(TARGET pagmo PROPERTY SOVERSION 6) + set_property(TARGET pagmo PROPERTY VERSION "7.0") + set_property(TARGET pagmo PROPERTY SOVERSION 7) set_target_properties(pagmo PROPERTIES CXX_VISIBILITY_PRESET hidden) set_target_properties(pagmo PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) endif() From 402cafb990948000dcb8c8b127fef17ba6979f55 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Thu, 4 Mar 2021 10:37:56 +0100 Subject: [PATCH 5/7] Disable the torture tests in the code coverage build. --- tools/circleci_focal_gcc9_coverage.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/circleci_focal_gcc9_coverage.sh b/tools/circleci_focal_gcc9_coverage.sh index 33a10fa08..e0d7c891d 100644 --- a/tools/circleci_focal_gcc9_coverage.sh +++ b/tools/circleci_focal_gcc9_coverage.sh @@ -27,7 +27,9 @@ cd build # GCC build with coverage. cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPAGMO_BUILD_TESTS=yes -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DPAGMO_WITH_IPOPT=yes -DCMAKE_CXX_FLAGS="--coverage" -DPAGMO_ENABLE_IPO=yes make -j2 VERBOSE=1 -ctest -V +# NOTE: skip the torture tests because they take +# a lot of time when code coverage is turned on. +ctest -V -j2 -E torture # Upload coverage data. bash <(curl -s https://codecov.io/bash) -x gcov-9 From b9133f4d04c9aa870bb9b2d07ead836c8eb310ad Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Thu, 4 Mar 2021 10:38:29 +0100 Subject: [PATCH 6/7] Update changelog. --- doc/sphinx/changelog.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/sphinx/changelog.rst b/doc/sphinx/changelog.rst index c96d4d9d8..06c32f287 100644 --- a/doc/sphinx/changelog.rst +++ b/doc/sphinx/changelog.rst @@ -3,6 +3,16 @@ Changelog ========= +2.17.0 (unreleased) +------------------- + +Fix +~~~ + +- Enable support in the build system for the latest + TBB version (oneTBB) + (`#469 `__). + 2.16.1 (2020-12-22) ------------------- From 4e81060910ff1618ccc8225d0493ae3f210bd947 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Fri, 5 Mar 2021 09:26:45 +0100 Subject: [PATCH 7/7] Silence some warnings from TBB in MSVC. --- src/batch_evaluators/thread_bfe.cpp | 14 ++++++++++++++ src/detail/bfe_impl.cpp | 14 ++++++++++++++ src/islands/thread_island.cpp | 14 ++++++++++++++ src/problems/translate.cpp | 14 ++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/src/batch_evaluators/thread_bfe.cpp b/src/batch_evaluators/thread_bfe.cpp index d688a1a65..4d3b7a824 100644 --- a/src/batch_evaluators/thread_bfe.cpp +++ b/src/batch_evaluators/thread_bfe.cpp @@ -32,9 +32,23 @@ see https://www.gnu.org/licenses/. */ #include #include +#if defined(_MSC_VER) + +// Disable a warning from MSVC in the TBB code. +#pragma warning(push) +#pragma warning(disable : 4324) + +#endif + #include #include +#if defined(_MSC_VER) + +#pragma warning(pop) + +#endif + #include #include #include diff --git a/src/detail/bfe_impl.cpp b/src/detail/bfe_impl.cpp index 8ac35a868..d95c63bd6 100644 --- a/src/detail/bfe_impl.cpp +++ b/src/detail/bfe_impl.cpp @@ -30,9 +30,23 @@ see https://www.gnu.org/licenses/. */ #include #include +#if defined(_MSC_VER) + +// Disable a warning from MSVC in the TBB code. +#pragma warning(push) +#pragma warning(disable : 4324) + +#endif + #include #include +#if defined(_MSC_VER) + +#pragma warning(pop) + +#endif + #include #include #include diff --git a/src/islands/thread_island.cpp b/src/islands/thread_island.cpp index fbc1f19ba..47f6541af 100644 --- a/src/islands/thread_island.cpp +++ b/src/islands/thread_island.cpp @@ -31,8 +31,22 @@ see https://www.gnu.org/licenses/. */ #include #include +#if defined(_MSC_VER) + +// Disable a warning from MSVC in the TBB code. +#pragma warning(push) +#pragma warning(disable : 4324) + +#endif + #include +#if defined(_MSC_VER) + +#pragma warning(pop) + +#endif + #include #include #include diff --git a/src/problems/translate.cpp b/src/problems/translate.cpp index 3b6e247cd..83861902d 100644 --- a/src/problems/translate.cpp +++ b/src/problems/translate.cpp @@ -37,9 +37,23 @@ see https://www.gnu.org/licenses/. */ #include #include +#if defined(_MSC_VER) + +// Disable a warning from MSVC in the TBB code. +#pragma warning(push) +#pragma warning(disable : 4324) + +#endif + #include #include +#if defined(_MSC_VER) + +#pragma warning(pop) + +#endif + #include #include #include