Skip to content

Commit 76e3053

Browse files
authored
Use custom spdlog installation to avoid using fmt (#361)
* Use custom spdlog installation to avoid using fmt * Prova fix * Fix warnings * Fixing workflows * Disabling unused workflows * Typo * Io odio CMake * Bump version * Update Readme
1 parent 6549b12 commit 76e3053

21 files changed

+283
-493
lines changed

.github/workflows/benchmark.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/cmake_debug.yml

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CI: Test the installation with cmake"
1+
name: "CI: Cmake installation and testing"
22

33
on:
44
push:
@@ -22,13 +22,13 @@ jobs:
2222
if: matrix.os == 'ubuntu-latest'
2323
run: |
2424
sudo apt update
25-
sudo apt install -y build-essential cmake libtbb-dev libspdlog-dev libsimdjson-dev libfmt-dev
25+
sudo apt install -y lcov gcovr build-essential cmake libtbb-dev libsimdjson-dev
2626
2727
- name: Install dependencies on macOS
2828
if: matrix.os == 'macos-latest'
2929
run: |
3030
brew update
31-
brew install tbb spdlog simdjson fmt
31+
brew install tbb simdjson
3232
3333
- name: Install dependencies on Windows (vcpkg)
3434
if: matrix.os == 'windows-latest'
@@ -37,7 +37,7 @@ jobs:
3737
git clone https://github.com/microsoft/vcpkg.git vcpkg
3838
cd vcpkg
3939
.\bootstrap-vcpkg.bat
40-
.\vcpkg install spdlog:x64-windows tbb:x64-windows fmt:x64-windows simdjson:x64-windows
40+
.\vcpkg install tbb:x64-windows simdjson:x64-windows
4141
echo "VCPKG_ROOT=$env:GITHUB_WORKSPACE\vcpkg" >> $env:GITHUB_ENV
4242
echo "VCPKG_INSTALLED=$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows" >> $env:GITHUB_ENV
4343
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
mkdir -p build
4949
cd build
50-
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DDSF_BUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install
50+
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install
5151
cmake --build . -j$(nproc) --config Coverage
5252
5353
- name: Build on macOS
@@ -57,9 +57,7 @@ jobs:
5757
mkdir -p build
5858
cd build
5959
cmake .. \
60-
-DCMAKE_PREFIX_PATH="$(brew --prefix tbb):$(brew --prefix fmt):$(brew --prefix spdlog):$(brew --prefix simdjson)" \
61-
-DCMAKE_BUILD_TYPE=Debug \
62-
-DDSF_BUILD_TESTS=ON \
60+
-DCMAKE_PREFIX_PATH="$(brew --prefix tbb):$(brew --prefix simdjson)" \
6361
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install
6462
cmake --build . -j$(sysctl -n hw.ncpu) --config Debug
6563
@@ -100,8 +98,9 @@ jobs:
10098
echo "int main() { return 0; }" >> test.cpp
10199
g++ test.cpp -std=c++20 \
102100
-I${GITHUB_WORKSPACE}/install/include \
101+
-I${GITHUB_WORKSPACE}/install/include/dsf/bundled \
103102
-L${GITHUB_WORKSPACE}/install/lib \
104-
-ldsf -ltbb -lspdlog -lsimdjson -lfmt \
103+
-ldsf -ltbb -lsimdjson \
105104
&& echo "SUCCESS: dsf library can be included and linked on Ubuntu!" \
106105
|| (echo "FAILED: Cannot include/link dsf on Ubuntu"; exit 1)
107106
@@ -113,12 +112,13 @@ jobs:
113112
echo "int main() { return 0; }" >> test.cpp
114113
clang++ test.cpp -std=c++20 \
115114
-I${GITHUB_WORKSPACE}/install/include \
116-
-I$(brew --prefix tbb)/include -I$(brew --prefix fmt)/include -I$(brew --prefix spdlog)/include -I$(brew --prefix simdjson)/include \
115+
-I${GITHUB_WORKSPACE}/install/include/dsf/bundled \
116+
-I$(brew --prefix tbb)/include -I$(brew --prefix simdjson)/include \
117117
-L${GITHUB_WORKSPACE}/install/lib \
118-
-L$(brew --prefix tbb)/lib -L$(brew --prefix fmt)/lib -L$(brew --prefix spdlog)/lib -L$(brew --prefix simdjson)/lib \
118+
-L$(brew --prefix tbb)/lib -L$(brew --prefix simdjson)/lib \
119119
-Wl,-rpath,${GITHUB_WORKSPACE}/install/lib \
120120
-Wl,-rpath,$(brew --prefix simdjson)/lib \
121-
-ldsf -ltbb -lfmt -lspdlog -lsimdjson \
121+
-ldsf -ltbb -lsimdjson \
122122
&& echo "SUCCESS: dsf library can be included and linked on macOS!" \
123123
|| (echo "FAILED: Cannot include/link dsf on macOS"; exit 1)
124124
@@ -164,12 +164,6 @@ jobs:
164164
$tbbLib = Find-Lib "$VCPKG_INSTALLED\lib" "tbb*.lib"
165165
if ($tbbLib) { $libs += $tbbLib.Name } else { Write-Host "ERROR: TBB lib not found in $VCPKG_INSTALLED\lib"; exit 1 }
166166
167-
$fmtLib = Find-Lib "$VCPKG_INSTALLED\lib" "fmt*.lib"
168-
if ($fmtLib) { $libs += $fmtLib.Name }
169-
170-
$spdLib = Find-Lib "$VCPKG_INSTALLED\lib" "spdlog*.lib"
171-
if ($spdLib) { $libs += $spdLib.Name }
172-
173167
$simdLib = Find-Lib "$VCPKG_INSTALLED\lib" "simdjson*.lib"
174168
if ($simdLib) { $libs += $simdLib.Name }
175169
@@ -179,6 +173,7 @@ jobs:
179173
"/nologo", "/std:c++20", "/utf-8", "/EHsc",
180174
"test.cpp",
181175
"/I`"$INSTALL_DIR\include`"",
176+
"/I`"$INSTALL_DIR\include/dsf/bundled`"",
182177
"/I`"$VCPKG_INSTALLED\include`"",
183178
"/link",
184179
"/LIBPATH:`"$INSTALL_DIR\lib`"",
@@ -206,8 +201,25 @@ jobs:
206201
working-directory: ${{ github.workspace }}/build
207202
run: ctest --output-on-failure -j$(sysctl -n hw.ncpu)
208203

209-
- name: Run tests on Windows
210-
if: matrix.os == 'windows-latest'
211-
working-directory: ${{ github.workspace }}/build
212-
shell: powershell
213-
run: ctest --output-on-failure -C Debug -j $env:NUMBER_OF_PROCESSORS
204+
# - name: Run tests on Windows
205+
# if: matrix.os == 'windows-latest'
206+
# working-directory: ${{ github.workspace }}/build
207+
# shell: powershell
208+
# run: ctest --output-on-failure -C Debug -j $env:NUMBER_OF_PROCESSORS
209+
210+
- name: Create coverage report
211+
if: matrix.os == 'ubuntu-latest'
212+
working-directory: ${{github.workspace}}/build
213+
run: lcov --capture --directory .. --output-file coverage.xml
214+
215+
- name: Upload coverage to Codecov
216+
if: matrix.os == 'ubuntu-latest'
217+
uses: codecov/[email protected]
218+
env:
219+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
220+
with:
221+
token: ${{ secrets.CODECOV_TOKEN }}
222+
file: ${{github.workspace}}/build/coverage.xml
223+
flags: unittests
224+
name: codecov-umbrella
225+
fail_ci_if_error: true

.github/workflows/cmake_examples.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,28 @@ jobs:
2323
run: |
2424
if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
2525
sudo apt update
26-
sudo apt install libtbb-dev libspdlog-dev libsimdjson-dev binutils
26+
sudo apt install libtbb-dev libsimdjson-dev binutils
2727
elif [ ${{ matrix.os }} == 'macos-latest' ]; then
28-
brew install tbb spdlog simdjson
28+
brew install tbb simdjson
2929
fi
3030
3131
- uses: actions/checkout@v4
3232

33-
- name: Configure CMake
34-
working-directory: ${{github.workspace}}/examples
35-
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
36-
37-
- name: Build
38-
working-directory: ${{github.workspace}}/examples
39-
run: cmake --build build -j$(nproc)
33+
- name: Build DSF with examples and install
34+
working-directory: ${{github.workspace}}
35+
run: |
36+
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDSF_EXAMPLES=ON
37+
cmake --build build -j$(nproc)
38+
sudo cmake --install build
4039
4140
- name: Stalingrado
4241
working-directory: ${{github.workspace}}/examples
43-
run: make stalingrado
42+
run: ./stalingrado.out
4443

4544
- name: Slow Charge TL
4645
working-directory: ${{github.workspace}}/examples
47-
run: make slow_charge_tl
46+
run: ./slow_charge_tl.out 69 0.3 ./sctl 0 450
4847

4948
- name: Slow Charge RB
5049
working-directory: ${{github.workspace}}/examples
51-
run: make slow_charge_rb
50+
run: ./slow_charge_rb.out 69 0.3 ./scrb/ 900

.github/workflows/profiling.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)