Skip to content

Commit 644a61a

Browse files
Windows Clang w/o MPI: Fix recent error (#1766)
* Empty commit to check CI status * Try -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH for now * Add default C++ flags back * Add documentation * Maybe try if clang-19 is available after all? * Revert "Maybe try if clang-19 is available after all?" This reverts commit 8f58500.
1 parent 42595a0 commit 644a61a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/windows.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ jobs:
6060
- uses: seanmiddleditch/gha-setup-ninja@master
6161
- name: Build & Install
6262
shell: cmd
63+
# In the below script, the -DCMAKE_CXX_FLAGS are a workaround, since the
64+
# windows-2022 runner currently ships with Clang-18, but the STL
65+
# implementation wants to have Clang-19.
66+
# We define -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH, this way telling
67+
# the STL not to be picky.
68+
# The other flags just bring back the default options since there is no
69+
# simple way to append to the compiler flags instead of overriding them.
70+
#
71+
# This workaround should hopefully be temporary until the Runner upgrades
72+
# to Clang-19.
6373
run: |
6474
python3.exe -m pip install --upgrade pip
6575
python3.exe -m pip install --upgrade numpy
@@ -71,7 +81,8 @@ jobs:
7181
-DCMAKE_C_COMPILER=clang-cl ^
7282
-DCMAKE_CXX_COMPILER=clang-cl ^
7383
-DCMAKE_BUILD_TYPE=Release ^
74-
-DopenPMD_USE_MPI=OFF
84+
-DopenPMD_USE_MPI=OFF ^
85+
-DCMAKE_CXX_FLAGS="/DWIN32 /D_WINDOWS /EHsc -fexceptions -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH"
7586
cmake --build build --config Release --parallel 2
7687
cmake --build build --config Debug --target install
7788

0 commit comments

Comments
 (0)