CMake: Skip MPICXX (#1785) #4200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🪟 Windows | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.ref }}-${{ github.head_ref }}-windows | |
cancel-in-progress: true | |
jobs: | |
build_win_msvc: | |
name: MSVC w/o MPI | |
runs-on: windows-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & Install | |
run: | | |
python3.exe -m pip install --upgrade pip | |
python3.exe -m pip install --upgrade numpy | |
pwsh "share\openPMD\download_samples.ps1" build | |
cmake -S . -B build ` | |
-DCMAKE_BUILD_TYPE=Debug ` | |
-DopenPMD_USE_MPI=OFF | |
cmake --build build --config Debug --parallel 2 | |
cmake --build build --config Debug --target install | |
# add before install, and fix Python path: | |
# ctest --test-dir build -C Debug --output-on-failure | |
build_win_msvc_pip: | |
name: MSVC w/o MPI via pip | |
runs-on: windows-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & Install | |
run: | | |
python3.exe -m pip install --upgrade pip setuptools wheel | |
python3.exe -m pip install --upgrade cmake | |
python3.exe -m pip install --upgrade numpy | |
python3.exe -m pip wheel . | |
if(!$?) { Exit $LASTEXITCODE } | |
python3.exe -m pip install openPMD_api-0.17.0.dev0-cp39-cp39-win_amd64.whl | |
if(!$?) { Exit $LASTEXITCODE } | |
python3.exe -c "import openpmd_api as api; print(api.variants)" | |
if(!$?) { Exit $LASTEXITCODE } | |
python3.exe -m openpmd_api.ls --help | |
if(!$?) { Exit $LASTEXITCODE } | |
build_win_clang: | |
name: Clang w/o MPI | |
runs-on: windows-2022 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Build & Install | |
shell: cmd | |
# In the below script, the -DCMAKE_CXX_FLAGS are a workaround, since the | |
# windows-2022 runner currently ships with Clang-18, but the STL | |
# implementation wants to have Clang-19. | |
# We define -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH, this way telling | |
# the STL not to be picky. | |
# The other flags just bring back the default options since there is no | |
# simple way to append to the compiler flags instead of overriding them. | |
# | |
# This workaround should hopefully be temporary until the Runner upgrades | |
# to Clang-19. | |
run: | | |
python3.exe -m pip install --upgrade pip | |
python3.exe -m pip install --upgrade numpy | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 | |
pwsh "share\openPMD\download_samples.ps1" build | |
cmake -S . -B build ^ | |
-G "Ninja" ^ | |
-DCMAKE_C_COMPILER=clang-cl ^ | |
-DCMAKE_CXX_COMPILER=clang-cl ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DopenPMD_USE_MPI=OFF ^ | |
-DCMAKE_CXX_FLAGS="/DWIN32 /D_WINDOWS /EHsc -fexceptions -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" | |
cmake --build build --config Release --parallel 2 | |
cmake --build build --config Debug --target install | |
# add before install, and fix Python path: | |
# ctest --test-dir build -C Debug --output-on-failure |