Skip to content

Commit 7202506

Browse files
committed
ci:windows enable
1 parent 1c3c23b commit 7202506

File tree

11 files changed

+231
-131
lines changed

11 files changed

+231
-131
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/meson.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v4
17+
- uses: actions/setup-python@v5
1818
with:
1919
python-version: '3.x'
2020

2121
- name: install prereqs
2222
run: |
23-
pip install meson ninja
24-
sudo apt -yq update
25-
sudo apt -yq install --no-install-recommends libopenmpi-dev
23+
pip install meson
24+
sudo apt update
25+
sudo apt install --no-install-recommends libopenmpi-dev
2626
2727
- run: meson setup build
2828
- run: meson compile -C build

.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"

cmake/mpi.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ message(STATUS "MPI_Fortran_LINK_FLAGS: ${MPI_Fortran_LINK_FLAGS}")
1717

1818
include(${CMAKE_CURRENT_LIST_DIR}/openmpi.cmake)
1919

20-
if(MPI_Fortran_HAVE_F08_MODULE)
20+
if(DEFINED MPI_Fortran_HAVE_F08_MODULE)
2121
return()
2222
endif()
2323

test/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ target_link_libraries(mpi_version_Fortran PRIVATE MPI::MPI_Fortran)
2020
add_test(NAME MPIversionFortran COMMAND mpi_version_Fortran)
2121
test_mpi_launcher(mpi_version_Fortran MPIversionFortran 1)
2222

23+
2324
# --- more than one MPI image
2425

2526
add_executable(mpi_hello helloworld.f90)
@@ -30,15 +31,21 @@ set_property(TEST MPIhello PROPERTY FIXTURES_SETUP mpi_fxt)
3031

3132
# --- actual message passing
3233

34+
if(MPI_Fortran_VERSION VERSION_GREATER 3.0)
35+
3336
add_executable(mpi_pass thread_pass.f90)
3437
target_link_libraries(mpi_pass PRIVATE MPI::MPI_Fortran)
3538

36-
if(MPIEXEC_MAX_NUMPROCS GREATER_EQUAL 2)
37-
3839
add_test(NAME MPIpass COMMAND mpi_pass)
3940
test_mpi_launcher(mpi_pass MPIpass 2)
4041
set_property(TEST MPIpass PROPERTY FIXTURES_REQUIRED mpi_fxt)
4142

43+
set_tests_properties(MPIpass PROPERTIES
44+
LABELS "Fortran"
45+
DISABLED $<VERSION_LESS:${MPIEXEC_MAX_NUMPROCS},2>
46+
)
47+
48+
4249
endif()
4350

4451
# --- test properties
@@ -49,3 +56,7 @@ set_tests_properties(${tests} PROPERTIES
4956
RESOURCE_LOCK mpi
5057
SKIP_REGULAR_EXPRESSION "No host list provided"
5158
)
59+
60+
set_tests_properties(MPIbasicC MPIversionC PROPERTIES LABELS "C")
61+
set_tests_properties(MPIbasicFortran MPIversionFortran MPIhello
62+
PROPERTIES LABELS "Fortran")

test/basic.f90

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
program basic
22

3-
use mpi_f08
3+
use mpi
4+
use, intrinsic :: iso_fortran_env, only: stderr=>error_unit, compiler_version
45

56
implicit none (type, external)
67

7-
print *, "going to init MPI"
8+
integer :: ierr
89

9-
call MPI_INIT()
10+
print '(a)', "going to init MPI"
1011

11-
print *, "MPI Init OK"
12+
call MPI_INIT(ierr)
13+
if (ierr /= MPI_SUCCESS) then
14+
write(stderr,'(a,i0)') "MPI_INIT failed with error code", ierr
15+
error stop
16+
endif
1217

13-
call MPI_FINALIZE()
18+
print '(a)', "MPI Init OK"
1419

15-
print *, "MPI closed"
20+
call MPI_FINALIZE(ierr)
21+
if (ierr /= MPI_SUCCESS) then
22+
write(stderr,'(a,i0)') "MPI_FINALIZE failed with error code", ierr
23+
error stop
24+
endif
25+
26+
print '(a)', "MPI closed"
1627

1728
end program

0 commit comments

Comments
 (0)