From 6ee80b064288c65bb1d266ffd465bad86a3cbcee Mon Sep 17 00:00:00 2001 From: fktn Date: Sat, 15 Jun 2024 14:03:16 +0900 Subject: [PATCH] Support Intel icpx compiler (#360) * added workflow job for intel icpx compiler * add compile options for IntelLLVM compilers for testing * added IntelLLVM compiler to the supported compilers list * cleanup the workflow jobs for IntelLLVM compiler --- .github/workflows/ubuntu.yml | 29 ++++++++++++++++++++ README.md | 1 + docs/mkdocs/docs/home/supported_compilers.md | 1 + test/unit_test/CMakeLists.txt | 18 ++++++++++++ 4 files changed, 49 insertions(+) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 44a7a0f9..0702a9d7 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -269,3 +269,32 @@ jobs: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j ${{env.JOBS}} cd ${{github.workspace}}/build ctest -C ${{matrix.build_type}} --output-on-failure -j ${{env.JOBS}} + + ci_test_icpx: + runs-on: ubuntu-latest + strategy: + matrix: + build_type: [ Debug, Release ] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Intel oneAPI Base Toolkit + run: | # from the official document: https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2024-1/apt.html + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update + sudo apt-get install -y intel-basekit + + - name: Configure CMake + run: | + source /opt/intel/oneapi/setvars.sh + cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DFK_YAML_BUILD_TEST=ON + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j ${{env.JOBS}} + + - name: Test + run: ctest --test-dir ${{github.workspace}}/build -C ${{matrix.build_type}} --output-on-failure -j ${{env.JOBS}} diff --git a/README.md b/README.md index 168d6b2b..e09d7963 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ Currently, the following compilers are known to work and used in GitHub Actions | GCC 12.3.0 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | | GCC 13.3.0 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | | GCC 14.1.0 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | +| IntelLLVM 2024.1.2 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | | MinGW-64 8.1.0 | [Windows Server 2019](https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md) | | MinGW-64 12.2.0 | [Windows Server 2022](https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md) | | Visual Studio 16 2019 | [Windows Server 2019](https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md) | diff --git a/docs/mkdocs/docs/home/supported_compilers.md b/docs/mkdocs/docs/home/supported_compilers.md index 652dbc24..d0136294 100644 --- a/docs/mkdocs/docs/home/supported_compilers.md +++ b/docs/mkdocs/docs/home/supported_compilers.md @@ -46,6 +46,7 @@ Currently, the following compilers are known to work and used in GitHub Actions | GCC 12.3.0 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | | GCC 13.3.0 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | | GCC 14.1.0 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | +| IntelLLVM 2024.1.2 | [Ubuntu 22.04](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) | | MinGW-64 8.1.0 | [Windows Server 2019](https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md) | | MinGW-64 12.2.0 | [Windows Server 2022](https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md) | | Visual Studio 16 2019 | [Windows Server 2019](https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md) | diff --git a/test/unit_test/CMakeLists.txt b/test/unit_test/CMakeLists.txt index 734a4114..8d122890 100644 --- a/test/unit_test/CMakeLists.txt +++ b/test/unit_test/CMakeLists.txt @@ -123,6 +123,24 @@ target_compile_options( -Wall -Wextra -Werror -pedantic -Wno-c++98-compat -Wno-c++98-compat-pedantic > + # IntelLLVM + $<$: + # IntelLLVM warns the usage of nans and infinities due to its over-estimation. + # fkYAML, however, uses them as YAML node values, not as calculation. + # To disable too aggressive warnings, `-fp-model=precise` is used in the test as a workaround. + -fp-model=precise + $<$:-O0 -g> + $<$:-O2> + > +) + +target_link_options( + unit_test_config + INTERFACE + $<$: + $<$:-O0 -g> + $<$:-O2> + > ) # additional compile options for Clang Sanitizers.