Skip to content

Commit 7de8a1d

Browse files
committed
Make: Avoid nesting builds into scripts/
1 parent f9349fb commit 7de8a1d

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.github/workflows/prerelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ jobs:
154154
cmake --build build_artifacts --config RelWithDebInfo
155155
- name: Test C++
156156
run: |
157-
.\build_artifacts\scripts\fork_union_test_cpp17.exe
158-
.\build_artifacts\scripts\fork_union_test_cpp20.exe
157+
.\build_artifacts\fork_union_test_cpp17.exe
158+
.\build_artifacts\fork_union_test_cpp20.exe
159159
160160
# Rust
161161
- name: Set up Rust

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ You can rerun those benchmarks with the following commands:
383383
```bash
384384
cmake -B build_release -D CMAKE_BUILD_TYPE=Release
385385
cmake --build build_release --config Release
386-
time NBODY_COUNT=128 NBODY_ITERATIONS=1000000 NBODY_BACKEND=fork_union_static build_release/scripts/fork_union_nbody
387-
time NBODY_COUNT=128 NBODY_ITERATIONS=1000000 NBODY_BACKEND=fork_union_dynamic build_release/scripts/fork_union_nbody
386+
time NBODY_COUNT=128 NBODY_ITERATIONS=1000000 NBODY_BACKEND=fork_union_static build_release/fork_union_nbody
387+
time NBODY_COUNT=128 NBODY_ITERATIONS=1000000 NBODY_BACKEND=fork_union_dynamic build_release/fork_union_nbody
388388
```
389389

390390
## Safety & Logic
@@ -427,14 +427,14 @@ To run the C++ tests, use CMake:
427427
cmake -B build_release -D CMAKE_BUILD_TYPE=Release
428428
cmake --build build_release --config Release
429429
ctest -C build_release # run all tests
430-
build_release/scripts/fork_union_nbody # run the benchmarks
430+
build_release/fork_union_nbody # run the benchmarks
431431
```
432432

433433
For C++ debug builds, consider using the VS Code debugger presets or the following commands:
434434

435435
```bash
436436
cmake --build build_debug --config Debug # build with Debug symbols
437-
build_debug/scripts/fork_union_test_cpp20 # run a single test executable
437+
build_debug/fork_union_test_cpp20 # run a single test executable
438438
```
439439

440440
To include NUMA, Huge Pages, and other optimizations on Linux, make sure to install dependencies:
@@ -451,7 +451,7 @@ To build with an alternative compiler, like LLVM Clang, use the following comman
451451
sudo apt-get install libomp-15-dev clang++-15 # OpenMP version must match Clang
452452
cmake -B build_debug -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_COMPILER=clang++-15
453453
cmake --build build_debug --config Debug
454-
build_debug/scripts/fork_union_test_cpp20
454+
build_debug/fork_union_test_cpp20
455455
```
456456

457457
For Rust, use the following command:

scripts/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ foreach (STD IN LISTS CXX_STANDARDS)
5555
set_target_properties_for_fork_union_script(${TGT})
5656

5757
# Link against `libatomic` for older GCC versions that might need it
58-
# Note: AppleClang doesn't need `libatomic` as atomic operations are built-in
59-
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
60-
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
61-
target_link_libraries(${TGT} PRIVATE -latomic)
58+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
59+
# AppleClang doesn't need `libatomic` as atomic operations are built-in
60+
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
61+
target_link_libraries(${TGT} PRIVATE -latomic)
62+
endif ()
6263
endif ()
6364

6465
endforeach ()
@@ -71,6 +72,7 @@ set_target_properties(
7172
PROPERTIES CXX_STANDARD 20
7273
CXX_STANDARD_REQUIRED ON
7374
CXX_EXTENSIONS OFF
75+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
7476
)
7577
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
7678
message(STATUS "Enabling OpenMP for fork_union_nbody on GCC")

0 commit comments

Comments
 (0)