From 91e724ee8761b5d83913d90df2ef78b7e573eed2 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 22 Dec 2021 16:21:40 -0800 Subject: [PATCH 1/5] Replacing ICC C++14 with C++17 --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7176614de8..c56e4003b3 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 From 53577c9698ad8a855cd80309e59b1de11c79f0ae Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 6 Jan 2022 12:59:15 +0100 Subject: [PATCH 2/5] ICPC: -diag-disable:conversion Try to suppress the `-Werror-all` promotion in `#include ` --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c56e4003b3..268f64b076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -562,6 +562,7 @@ jobs: - name: Configure C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e + export CXXFLAGS="-diag-disable:conversion" cmake -S . -B build-17 \ -DPYBIND11_WERROR=ON \ -DDOWNLOAD_CATCH=ON \ From 679bc41826f9467e91e39f36149d8d8a51cd6b17 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 10 Jan 2022 09:41:27 -0800 Subject: [PATCH 3/5] Trying `-DPYBIND11_WERROR=OFF` --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 268f64b076..83232f4262 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -562,9 +562,9 @@ jobs: - name: Configure C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - export CXXFLAGS="-diag-disable:conversion" + # export CXXFLAGS="-diag-disable:conversion" # Did not work. cmake -S . -B build-17 \ - -DPYBIND11_WERROR=ON \ + -DPYBIND11_WERROR=OFF \ -DDOWNLOAD_CATCH=ON \ -DDOWNLOAD_EIGEN=OFF \ -DCMAKE_CXX_STANDARD=17 \ From 3f9a67468db81c62939050f71476182b9ce7fc53 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 10 Jan 2022 10:20:48 -0800 Subject: [PATCH 4/5] Trying `-Wno-conversion` (todo: make specific to C++17 if it works) --- .github/workflows/ci.yml | 2 +- tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83232f4262..42c4e4f372 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -564,7 +564,7 @@ jobs: set +e; source /opt/intel/oneapi/setvars.sh; set -e # export CXXFLAGS="-diag-disable:conversion" # Did not work. cmake -S . -B build-17 \ - -DPYBIND11_WERROR=OFF \ + -DPYBIND11_WERROR=ON \ -DDOWNLOAD_CATCH=ON \ -DDOWNLOAD_EIGEN=OFF \ -DCMAKE_CXX_STANDARD=17 \ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b00c043ac3..94f66b4f57 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -330,7 +330,7 @@ function(pybind11_enable_warnings target_name) target_compile_options( ${target_name} PRIVATE - -Werror-all + -Werror-all -Wno-conversion # "Inlining inhibited by limit max-size", "Inlining inhibited by limit max-total-size" -diag-disable 11074,11076) endif() From 5c1a585f925e048b59d668a5d529384d91b18099 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 10 Jan 2022 13:46:33 -0800 Subject: [PATCH 5/5] Inserting -Wno-conversion only for C++17 --- .github/workflows/ci.yml | 1 - tests/CMakeLists.txt | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42c4e4f372..c56e4003b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -562,7 +562,6 @@ jobs: - name: Configure C++17 run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - # export CXXFLAGS="-diag-disable:conversion" # Did not work. cmake -S . -B build-17 \ -DPYBIND11_WERROR=ON \ -DDOWNLOAD_CATCH=ON \ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 94f66b4f57..eb8c3228da 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -327,10 +327,13 @@ 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 - -Werror-all -Wno-conversion + -Werror-all # "Inlining inhibited by limit max-size", "Inlining inhibited by limit max-total-size" -diag-disable 11074,11076) endif()