Skip to content

Commit

Permalink
Support Intel icpx compiler (#360)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fktn-k committed Jun 15, 2024
1 parent e1ab634 commit 6ee80b0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs/docs/home/supported_compilers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
18 changes: 18 additions & 0 deletions test/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ target_compile_options(
-Wall -Wextra -Werror -pedantic
-Wno-c++98-compat -Wno-c++98-compat-pedantic
>
# IntelLLVM
$<$<CXX_COMPILER_ID: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
$<$<CONFIG:Debug>:-O0 -g>
$<$<CONFIG:Release>:-O2>
>
)

target_link_options(
unit_test_config
INTERFACE
$<$<CXX_COMPILER_ID:IntelLLVM>:
$<$<CONFIG:Debug>:-O0 -g>
$<$<CONFIG:Release>:-O2>
>
)

# additional compile options for Clang Sanitizers.
Expand Down

0 comments on commit 6ee80b0

Please sign in to comment.