Skip to content

Commit 96fdde6

Browse files
committed
Adjust ext.amgcl module for GCC and mute thread-safety
1 parent 60f196c commit 96fdde6

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/Build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ jobs:
132132
libcxx_inc_path=$(dpkg -L libc++-21-dev | grep -m1 'std/algorithm.inc$' || true)
133133
if [ -n "$libcxx_inc_path" ]; then
134134
libcxx_inc_root=$(dirname "$(dirname "$libcxx_inc_path")")
135-
CXXFLAGS="-stdlib=libc++ -isystem $libcxx_inc_root"
135+
CXXFLAGS="-stdlib=libc++ -isystem $libcxx_inc_root -Wno-thread-safety"
136136
else
137-
CXXFLAGS="-stdlib=libc++ -isystem /usr/include/c++/v1 -isystem /usr/lib/llvm-21/include/c++/v1"
137+
CXXFLAGS="-stdlib=libc++ -isystem /usr/include/c++/v1 -isystem /usr/lib/llvm-21/include/c++/v1 -Wno-thread-safety"
138138
fi
139139
echo "CC=clang-21" >> "$GITHUB_ENV"
140140
echo "CXX=clang++-21" >> "$GITHUB_ENV"
@@ -154,7 +154,7 @@ jobs:
154154
echo "CC=$LLVM_HOME/bin/clang" >> "$GITHUB_ENV"
155155
echo "CXX=$LLVM_HOME/bin/clang++" >> "$GITHUB_ENV"
156156
echo "$LLVM_HOME/bin" >> "$GITHUB_PATH"
157-
echo "CXXFLAGS=-stdlib=libc++ -isystem $LLVM_HOME/include/c++/v1" >> "$GITHUB_ENV"
157+
echo "CXXFLAGS=-stdlib=libc++ -isystem $LLVM_HOME/include/c++/v1 -Wno-thread-safety" >> "$GITHUB_ENV"
158158
echo "LDFLAGS=-stdlib=libc++ -L$LLVM_HOME/lib -Wl,-rpath,$LLVM_HOME/lib" >> "$GITHUB_ENV"
159159
modules_json=$(find "$LLVM_HOME" -name libc++.modules.json -print -quit || true)
160160
if [ -n "$modules_json" ]; then

src/amgcl.cppm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ module;
4444
#include <amgcl/mpi/partition/ptscotch.hpp>
4545
#endif
4646

47+
#if defined(__GNUC__) && !defined(__clang__)
48+
module ext.amgcl;
49+
#else
4750
export module ext.amgcl;
51+
#endif
4852

4953
#if defined(__GNUC__) && !defined(__clang__)
5054
namespace amgcl {

src/opflow.cppm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ module;
1919
#include <iostream>
2020

2121
export module opflow;
22-
#if defined(__GNUC__) && !defined(__clang__)
23-
import ext.amgcl;
24-
#else
22+
#if !defined(__GNUC__) || defined(__clang__)
2523
export import ext.amgcl;
2624
#endif
2725

0 commit comments

Comments
 (0)