Skip to content

Commit a54f958

Browse files
committed
Add Intel oneAPI setup for OpenMP in GitHub Actions
Integrated Intel oneAPI into the workflow to enable OpenMP support for the project. Updated CMake configuration to include necessary OpenMP flags and library paths. This ensures compatibility with Intel's OpenMP runtime for improved parallelization.
1 parent ba1ba02 commit a54f958

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -812,23 +812,32 @@ jobs:
812812
uses: seanmiddleditch/gha-setup-ninja@v6
813813
- name: Setup MSVC for Ninja again
814814
uses: ilammy/msvc-dev-cmd@v1
815+
816+
- name: Setup Intel oneAPI (for OpenMP)
817+
uses: rscohn2/setup-oneapi@v1
818+
with:
819+
components: compiler # includes Intel OpenMP runtime
815820
- name: CMake configure
816821
run: >
817-
cmake -S . -B build -G Ninja -D CMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
822+
cmake -S . -B build -G Ninja
823+
-D CMAKE_C_COMPILER=clang-cl -D CMAKE_CXX_COMPILER=clang-cl
818824
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
819-
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
825+
-D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=install
826+
-D OpenMP_C_FLAGS="/clang:-fopenmp=libiomp5"
827+
-D OpenMP_CXX_FLAGS="/clang:-fopenmp=libiomp5"
828+
-D OpenMP_C_LIB_NAMES="iomp5"
829+
-D OpenMP_CXX_LIB_NAMES="iomp5"
830+
-D OpenMP_iomp5_LIBRARY="${ONEAPI_ROOT}/compiler/latest/windows/redist/intel64_win/compiler/libiomp5md.lib"
820831
env:
821832
CC: clang-cl
822833
CXX: clang-cl
823834
- name: Build project
824-
run: |
825-
cmake --build build --config Release --parallel
835+
run: cmake --build build --config Release --parallel
826836
env:
827837
CC: clang-cl
828838
CXX: clang-cl
829839
- name: Install project
830-
run: |
831-
cmake --install build
840+
run: cmake --install build
832841
- name: Archive installed package
833842
run: Compress-Archive -Path install -DestinationPath windows-clang-install.zip
834843
shell: pwsh

0 commit comments

Comments
 (0)