Skip to content

Commit 81e91bd

Browse files
committed
ci:windows enable
1 parent 1c3c23b commit 81e91bd

File tree

5 files changed

+160
-96
lines changed

5 files changed

+160
-96
lines changed

.github/workflows/cmake.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
jobs:
1414

1515
linux:
16+
name: CMake build on Linux
17+
timeout-minutes: 15
1618
runs-on: ubuntu-latest
1719

1820
strategy:
@@ -24,11 +26,49 @@ jobs:
2426

2527
- name: install prereqs (linux)
2628
if: runner.os == 'Linux'
27-
run: sudo apt -yq install --no-install-recommends lib${{ matrix.mpi }}-dev ninja-build
29+
run: sudo apt -yq install --no-install-recommends lib${{ matrix.mpi }}-dev
2830

2931
- name: install prereqs (mac)
3032
if: runner.os == 'macOS'
31-
run: brew install ${{ matrix.mpi }} ninja
33+
run: brew install ${{ matrix.mpi }}
34+
35+
- run: cmake --workflow --preset debug
36+
37+
- run: cmake --workflow --preset release
38+
39+
40+
windows:
41+
runs-on: windows-2025
42+
name: CMake build on Windows
43+
timeout-minutes: 15
44+
45+
steps:
46+
- uses: msys2/setup-msys2@v2
47+
id: msys2
48+
with:
49+
update: true
50+
install: >-
51+
mingw-w64-ucrt-x86_64-gcc
52+
mingw-w64-ucrt-x86_64-gcc-fortran
53+
mingw-w64-ucrt-x86_64-msmpi
54+
55+
- name: Put MSYS2_MinGW64 on PATH
56+
run: echo "${{ steps.msys2.outputs.msys2-location }}/ucrt64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
57+
58+
- name: download MS-MPI setup (SDK is from MSYS2)
59+
run: curl -L -O https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe
60+
61+
- name: Install mpiexec.exe (-force needed to bypass GUI on headless)
62+
run: .\msmpisetup.exe -unattend -force
63+
64+
- name: test that mpiexec.exe exists
65+
# can't use MSMPI_BIN as Actions doesn't update PATH from msmpisetup.exe
66+
run: Test-Path "C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -PathType leaf
67+
68+
- name: put MSMPI_BIN on PATH (where mpiexec is)
69+
run: echo "C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
70+
71+
- uses: actions/checkout@v4
3272

3373
- run: cmake --workflow --preset debug
3474

.github/workflows/oneapi-linux.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: oneapi-linux
2+
3+
env:
4+
CC: icx
5+
CXX: icpx
6+
FC: ifx
7+
LINUX_CPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp
8+
LINUX_FORTRAN_COMPONENTS: intel-oneapi-compiler-fortran
9+
LINUX_MKL_COMPONENTS: intel-oneapi-mkl intel-oneapi-mkl-devel
10+
LINUX_MPI_COMPONENTS: intel-oneapi-mpi intel-oneapi-mpi-devel
11+
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
12+
CTEST_NO_TESTS_ACTION: error
13+
CMAKE_BUILD_PARALLEL_LEVEL: 4
14+
CMAKE_BUILD_TYPE: Release
15+
CTEST_PARALLEL_LEVEL: 0
16+
# oneAPI Debug triggers asan errors on Linux in general on any project
17+
CMAKE_INSTALL_PREFIX: ~/libs
18+
CMAKE_PREFIX_PATH: ~/libs
19+
20+
on:
21+
push:
22+
paths:
23+
- "**.c"
24+
- "**.cpp"
25+
- "**.f90"
26+
- "**.F90"
27+
- "**.cmake"
28+
- "cmake/libraries.json"
29+
- "CMakePresets.json"
30+
- "**/CMakeLists.txt"
31+
- "!cmake/gnu.cmake"
32+
- ".github/workflows/oneapi-linux.yml"
33+
# paths ignore starting with "!"
34+
- "!docs/**"
35+
- "!**/cray.cmake"
36+
workflow_dispatch:
37+
38+
# avoid wasted runs
39+
concurrency:
40+
group: ${{ github.workflow }}-${{ github.ref }}
41+
cancel-in-progress: true
42+
43+
44+
jobs:
45+
46+
linux:
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 15
49+
50+
steps:
51+
52+
- uses: actions/checkout@v4
53+
# this must be before oneAPI script commands else the scripts do not exist on the image
54+
55+
- name: cache install oneAPI
56+
id: cache-install
57+
uses: actions/cache@v4
58+
with:
59+
path: |
60+
/opt/intel/oneapi
61+
key: oneapi-apt
62+
63+
- name: non-cache install oneAPI
64+
if: steps.cache-install.outputs.cache-hit != 'true'
65+
timeout-minutes: 8
66+
# 5 minutes times out sometimes
67+
run: |
68+
sh -c .github/workflows/oneapi_setup_apt_repo_linux.sh
69+
sudo apt install --no-install-recommends ${{ env.LINUX_FORTRAN_COMPONENTS }} ${{ env.LINUX_CPP_COMPONENTS }} ${{ env.LINUX_MPI_COMPONENTS }}
70+
71+
- name: Setup Intel oneAPI environment
72+
run: |
73+
source /opt/intel/oneapi/setvars.sh
74+
printenv >> $GITHUB_ENV
75+
76+
- name: CMake Configure
77+
run: cmake --preset default -G Ninja
78+
79+
- name: Upload log failure
80+
if: failure()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: oneapi-${{ runner.os }}-CMakeConfigureLog.yaml
84+
path: build/CMakeFiles/CMakeConfigureLog.yaml
85+
86+
- name: build
87+
run: cmake --build --preset default
88+
89+
- name: build failed
90+
if: ${{ failure() }}
91+
run: cmake --build --preset default -j1 -v
92+
93+
- name: unit test
94+
run: ctest --preset default -V
95+
96+
- name: exclude unused files from cache
97+
if: steps.cache-install.outputs.cache-hit != 'true'
98+
run: sh -c .github/workflows/oneapi_cache_exclude_linux.sh

.github/workflows/oneapi-linux.yml.bak

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
2+
# This script sets up the Intel oneAPI apt repository on a Linux system.
3+
# https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2025-1/base-apt.html#BASE-APT
24

3-
# SPDX-FileCopyrightText: 2020 Intel Corporation
4-
#
5-
# SPDX-License-Identifier: MIT
5+
curl -sS -L https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
6+
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
7+
8+
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
69

7-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
8-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
9-
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
1010
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0"

test/thread_pass.f90

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ program mpi_pass
44
!!
55
!! Original author: John Burkardt
66

7-
use, intrinsic :: iso_fortran_env, only: real32, compiler_version, int64
7+
use, intrinsic :: iso_fortran_env, only: compiler_version, int64, stderr=>error_unit
88

99
use mpi_f08
1010

1111
implicit none
1212

1313
integer :: mcount
14-
real(real32) :: dat(0:99), val(200)
14+
real :: dat(0:99), val(200)
1515
integer :: dest, i, num_procs, id, tag
1616
integer(int64) :: tic, toc, rate
1717

@@ -27,38 +27,40 @@ program mpi_pass
2727
! Find out the number of processes available.
2828
call MPI_Comm_size(MPI_COMM_WORLD, num_procs)
2929

30-
if (num_procs < 2) error stop 'two threads are required, use: mpiexec -np 2 ./mpi_pass'
30+
if (id == 0) print '(a)',compiler_version()
3131

32-
if (id == 0) then
33-
print *,compiler_version()
34-
print *, 'Number of MPI processes available ', num_procs
35-
end if
32+
print '(a,i0,a,i0)' 'Process ', id, ' / ', num_procs
33+
34+
if (num_procs < 2) then
35+
if (id == 0) write(stderr, '(a,i0,a)') 'Detected ',num_procs, ' processes. Two workers required, use: mpiexec -np 2 ./mpi_pass'
36+
error stop
37+
endif
3638

3739
! Process 0 expects to receive as much as 200 real values, from any source.
3840
select case (id)
3941
case (0)
4042
print *, id, "waiting for MPI_send() from image 1"
4143
call MPI_Recv (val, size(val), MPI_REAL, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, status)
4244

43-
print *, id, ' Got data from processor ', status%MPI_SOURCE, 'tag',status%MPI_TAG
45+
print '(i0,a,i0,a,i0)', id, ' Got data from processor ', status%MPI_SOURCE, ' tag ',status%MPI_TAG
4446

4547
call MPI_Get_count(status, MPI_REAL, mcount)
4648

47-
print *, id, ' Got ', mcount, ' elements.'
49+
print '(i0,a,i0,a)', id, ' Got ', mcount, ' elements.'
4850

4951
if (abs(val(5)-4) > epsilon(0.)) error stop "data did not transfer"
5052

5153
! Process 1 sends 100 real values to process 0.
5254
case (1)
53-
print *, id, ': setting up data to send to process 0.'
55+
print '(i0, a)', id, ': setting up data to send to process 0.'
5456

5557
dat = real([(i, i = 0, 99)])
5658

5759
dest = 0
5860
tag = 55
5961
call MPI_Send(dat, size(dat), MPI_REAL, dest, tag, MPI_COMM_WORLD)
6062
case default
61-
print *, id, ': MPI has no work for image', id
63+
print '(i0,a,i0)', id, ': MPI has no work for image', id
6264
end select
6365

6466
call MPI_Finalize()
@@ -67,7 +69,7 @@ program mpi_pass
6769
if (id == 0) then
6870
call system_clock(toc)
6971
call system_clock(count_rate=rate)
70-
print *, 'Run time in seconds: ', real(toc - tic) / real(rate)
72+
print '(a,f8.4)', 'Run time in seconds: ', real(toc - tic) / real(rate)
7173
end if
7274

7375
end program

0 commit comments

Comments
 (0)