Skip to content

Commit ec2ac92

Browse files
committed
Merge remote-tracking branch 'app4triqs-remote/unstable'
2 parents c73f1cc + 40fb488 commit ec2ac92

File tree

5 files changed

+43
-21
lines changed

5 files changed

+43
-21
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
include:
29-
- {os: ubuntu-24.04, cc: gcc, cxx: g++, doc: OFF}
30-
- {os: ubuntu-24.04, cc: clang, cxx: clang++, doc: ON}
31-
#- {os: macos-14, cc: gcc-14, cxx: g++-14, doc: OFF}
32-
#- {os: macos-14, cc: clang, cxx: clang++, doc: OFF}
29+
- {os: ubuntu-24.04, cxx: g++, doc: OFF}
30+
- {os: ubuntu-24.04, cxx: clang++, doc: ON}
3331

3432
runs-on: ${{ matrix.os }}
3533

@@ -39,9 +37,17 @@ jobs:
3937
- uses: actions/cache/restore@v4
4038
with:
4139
path: ${{ env.CCACHE_DIR }}
42-
key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}
43-
restore-keys:
44-
ccache-${{ matrix.os }}-${{ matrix.cc }}-
40+
key: ccache-${{ matrix.os }}-${{ matrix.cxx }}-${{ github.run_id }}-${{ github.run_attempt }}
41+
restore-keys: |
42+
ccache-${{ matrix.os }}-${{ matrix.cxx }}-
43+
44+
- name: Set cxx variables
45+
run: |
46+
if [[ ${{ matrix.os }} == 'macos-15' && ${{ matrix.cxx }} == 'g++' ]]; then
47+
echo "CXX=g++-15" >> $GITHUB_ENV
48+
else
49+
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
50+
fi
4551
4652
- name: Install ubuntu dependencies
4753
if: ${{ contains(matrix.os, 'ubuntu') }}
@@ -50,15 +56,18 @@ jobs:
5056
sudo apt-get install lsb-release wget software-properties-common &&
5157
sudo apt-get install
5258
ccache
59+
cmake
60+
ninja-build
5361
clang
62+
clang-tools
5463
g++
5564
hdf5-tools
5665
libblas-dev
5766
libc++-dev
5867
libc++abi-dev
5968
libomp-dev
6069
libhdf5-dev
61-
liblapack-dev
70+
libopenblas-dev
6271
libopenmpi-dev
6372
openmpi-bin
6473
openmpi-common
@@ -75,7 +84,7 @@ jobs:
7584
7685
- name: Set up virtualenv
7786
run: |
78-
mkdir $HOME/.venv
87+
mkdir -p $HOME/.venv
7988
python3 -m venv --system-site-packages $HOME/.venv/my_python
8089
source $HOME/.venv/my_python/bin/activate
8190
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
@@ -86,23 +95,19 @@ jobs:
8695
run: |
8796
brew update
8897
brew install ccache gcc llvm hdf5 open-mpi openblas
89-
pip install mako
9098
echo "PATH=$(brew --prefix llvm)/bin:$(brew --prefix gcc)/bin:$PATH" >> $GITHUB_ENV
91-
echo "PYTHONPATH=$(brew --prefix llvm)/lib/python3.13/site-packages" >> $GITHUB_ENV
99+
echo "SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV
100+
echo "LDFLAGS=-L$(brew --prefix llvm)/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind" >> $GITHUB_ENV
92101
93102
- name: Add clang CXXFLAGS
94-
if: ${{ contains(matrix.cxx, 'clang') }}
103+
if: ${{ matrix.cxx == 'clang++' }}
95104
run: |
96105
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
97106
98107
- name: Build cppdlr
99-
env:
100-
CC: ${{ matrix.cc }}
101-
CXX: ${{ matrix.cxx }}
102-
TRIQS_BRANCH: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
103108
run: |
104-
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=${{ matrix.doc }}
105-
make -j2 || make -j1 VERBOSE=1
109+
cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=${{ matrix.doc }}
110+
cmake --build build --verbose
106111
107112
- name: Test cppdlr
108113
env:
@@ -119,7 +124,7 @@ jobs:
119124
if: always()
120125
with:
121126
path: ${{ env.CCACHE_DIR }}
122-
key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}
127+
key: ccache-${{ matrix.os }}-${{ matrix.cxx }}-${{ github.run_id }}-${{ github.run_attempt }}
123128

124129
- name: Deploy documentation to website
125130
if: matrix.doc == 'ON' && github.event_name == 'push'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
compile_commands.json
22
doc/cpp2rst_generated
3+
.claude

c++/cppdlr/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ set_target_properties(${PROJECT_NAME}_c PROPERTIES
1313
)
1414
target_include_directories(${PROJECT_NAME}_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
1515
target_include_directories(${PROJECT_NAME}_c SYSTEM INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>)
16+
target_link_directories(${PROJECT_NAME}_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
17+
target_link_directories(${PROJECT_NAME}_c INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_LIBDIR}>)
1618
target_compile_definitions(${PROJECT_NAME}_c PUBLIC
1719
CPPDLR_GIT_HASH=${PROJECT_GIT_HASH}
1820
$<$<CONFIG:Debug>:CPPDLR_DEBUG>

doc/conf.py.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ htmlhelp_basename = '@PROJECT_NAME@doc'
8282

8383
intersphinx_mapping = {'python': ('https://docs.python.org/3.8', None)}
8484

85+
# numpydoc options
86+
numpydoc_show_class_members = False
87+
numpydoc_show_inherited_class_members = False
88+
numpydoc_class_members_toctree = False
89+
8590
# open links in new tab instead of same window
8691
from sphinx.writers.html import HTMLTranslator
8792
from docutils import nodes

share/cmake/extract_flags.cmake

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ macro(extract_flags)
9292
endif()
9393
endforeach()
9494

95+
get_property_recursive(libdirs TARGET ${target} PROPERTY INTERFACE_LINK_DIRECTORIES)
96+
foreach(dir ${libdirs})
97+
set(${target}_LDFLAGS "${${target}_LDFLAGS} -L${dir}")
98+
endforeach()
99+
95100
# ==== We have to replace generator expressions explicitly ====
96101

97102
if(ARG_BUILD_INTERFACE)
@@ -114,8 +119,12 @@ macro(extract_flags)
114119
endif()
115120

116121
# Remove all remaining generator expressions
117-
string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_LDFLAGS "${${target}_LDFLAGS}")
118-
string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_CXXFLAGS "${${target}_CXXFLAGS}")
122+
string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^ ]*>" "" ${target}_LDFLAGS "${${target}_LDFLAGS}")
123+
string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^ ]*>" "" ${target}_CXXFLAGS "${${target}_CXXFLAGS}")
124+
125+
# Filter out ::@ expressions
126+
string(REGEX REPLACE "::@[^ ]* " "" ${target}_LDFLAGS "${${target}_LDFLAGS}")
127+
string(REGEX REPLACE "::@[^ ]* " "" ${target}_CXXFLAGS "${${target}_CXXFLAGS}")
119128

120129
# Filter out system directories from LDFLAGS and CXXFLAGS
121130
string(REGEX REPLACE " -L/usr/lib " " " ${target}_LDFLAGS "${${target}_LDFLAGS}")

0 commit comments

Comments
 (0)