From f5888108712d04609d869459887629ec6562a158 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 11 Jan 2022 12:13:02 -0800 Subject: [PATCH] Replacing ICC C++14 with C++17 (#3570) * Replacing ICC C++14 with C++17 * ICPC: -diag-disable:conversion Try to suppress the `-Werror-all` promotion in `#include ` * Trying `-DPYBIND11_WERROR=OFF` * Trying `-Wno-conversion` (todo: make specific to C++17 if it works) * Inserting -Wno-conversion only for C++17 Co-authored-by: Axel Huebl --- .github/workflows/ci.yml | 22 +++++++++++----------- tests/CMakeLists.txt | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7176614de..c56e4003b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -559,37 +559,37 @@ jobs: set +e; source /opt/intel/oneapi/setvars.sh; set -e cmake --build build-11 --target test_cmake_build - - name: Configure C++14 + - name: Configure C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake -S . -B build-14 \ + cmake -S . -B build-17 \ -DPYBIND11_WERROR=ON \ -DDOWNLOAD_CATCH=ON \ -DDOWNLOAD_EIGEN=OFF \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_COMPILER=$(which icpc) \ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - name: Build C++14 + - name: Build C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-14 -j 2 -v + cmake --build build-17 -j 2 -v - - name: Python tests C++14 + - name: Python tests C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e sudo service apport stop - cmake --build build-14 --target check + cmake --build build-17 --target check - - name: C++ tests C++14 + - name: C++ tests C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-14 --target cpptest + cmake --build build-17 --target cpptest - - name: Interface test C++14 + - name: Interface test C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-14 --target test_cmake_build + cmake --build build-17 --target test_cmake_build # Testing on CentOS (manylinux uses a centos base, and this is an easy way diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b00c043ac..eb8c3228d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -327,6 +327,9 @@ function(pybind11_enable_warnings target_name) elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|IntelLLVM)") target_compile_options(${target_name} PRIVATE -Werror) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if(CMAKE_CXX_STANDARD EQUAL 17) # See PR #3570 + target_compile_options(${target_name} PRIVATE -Wno-conversion) + endif() target_compile_options( ${target_name} PRIVATE