Skip to content

Commit 6788039

Browse files
committed
ci: Intel icx/icpx via oneAPI
Add testing for Intel icx/icpx via the oneAPI images. This is Intel's next-gen compiler and new C++ support, e.g. C++17 bug fixes, first land here. Update .github/workflows/ci.yml Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net> CMake: Fix ICPX Detection in Python tests More IntelClang Detection Upsi, keep ICC rebased out by accident Prettify Compiler Workaround: Just in Configure ci: rely on newer CMake
1 parent 2cd32e5 commit 6788039

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,108 @@ jobs:
592592
cmake --build build-14 --target test_cmake_build
593593
594594
595+
# Testing on ICX/ICPX, Intel's next-gen C/C++ compiler using the oneAPI apt repo
596+
icx:
597+
runs-on: ubuntu-20.04
598+
strategy:
599+
fail-fast: false
600+
601+
name: "🐍 3 • ICPX latest • x64"
602+
603+
steps:
604+
- uses: actions/checkout@v2
605+
606+
- name: Add apt repo
607+
run: |
608+
sudo apt-get update
609+
sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
610+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
611+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
612+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
613+
614+
- name: Add ICPC & Python 3
615+
run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp cmake python3-dev python3-numpy python3-pytest python3-pip
616+
617+
- name: Update pip
618+
run: |
619+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
620+
python3 -m pip install --upgrade pip
621+
622+
- name: Install dependencies
623+
run: |
624+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
625+
python3 -m pip install -r tests/requirements.txt --prefer-binary
626+
627+
- name: Configure C++11
628+
run: |
629+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
630+
cmake -S . -B build-11 \
631+
-DPYBIND11_WERROR=ON \
632+
-DDOWNLOAD_CATCH=ON \
633+
-DDOWNLOAD_EIGEN=OFF \
634+
-DCMAKE_CXX_STANDARD=14 \
635+
-DCMAKE_VERBOSE_MAKEFILE=ON \
636+
-DCMAKE_CXX_COMPILER=$(which icpx) \
637+
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
638+
639+
- name: Build
640+
shell: bash
641+
run: |
642+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
643+
cmake --build build-11 -j 2
644+
645+
- name: Python tests
646+
shell: bash
647+
run: |
648+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
649+
sudo service apport stop
650+
cmake --build build --target check
651+
652+
- name: C++ tests
653+
shell: bash
654+
run: |
655+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
656+
cmake --build build --target cpptest
657+
658+
- name: Interface test
659+
shell: bash
660+
run: |
661+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
662+
cmake --build build-11 --target test_cmake_build
663+
664+
- name: Configure C++17
665+
run: |
666+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
667+
cmake -S . -B build-17 \
668+
-DPYBIND11_WERROR=ON \
669+
-DDOWNLOAD_CATCH=ON \
670+
-DDOWNLOAD_EIGEN=OFF \
671+
-DCMAKE_CXX_STANDARD=17 \
672+
-DCMAKE_CXX_COMPILER=$(which icpx) \
673+
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
674+
675+
- name: Build C++17
676+
run: |
677+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
678+
cmake --build build-17 -j 2 -v
679+
680+
- name: Python tests C++17
681+
run: |
682+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
683+
sudo service apport stop
684+
cmake --build build-17 --target check
685+
686+
- name: C++ tests C++17
687+
run: |
688+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
689+
cmake --build build-17 --target cpptest
690+
691+
- name: Interface test C++17
692+
run: |
693+
set +e; source /opt/intel/oneapi/setvars.sh; set -e
694+
cmake --build build-17 --target test_cmake_build
695+
696+
595697
# Testing on CentOS (manylinux uses a centos base, and this is an easy way
596698
# to get GCC 4.8, which is the manylinux1 compiler).
597699
centos:

0 commit comments

Comments
 (0)