Skip to content

Commit f00a6f0

Browse files
author
Moumard Corentin
committed
Add CI release workflow and distribution build option
1 parent 936a32d commit f00a6f0

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build Linux binary
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-linux:
10+
runs-on: ubuntu-22.04
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Install build tools
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y cmake g++ git
20+
21+
- name: Configure CMake
22+
run: |
23+
cmake -S . -B build \
24+
-DCMAKE_BUILD_TYPE=Release \
25+
-DSB_BUNDLE_OGDF=ON \
26+
-DSB_ENABLE_SANITIZERS=OFF \
27+
-DSB_NATIVE_OPTIMIZATIONS=OFF
28+
29+
- name: Build BubbleFinder
30+
run: cmake --build build -j"$(nproc)"
31+
32+
- name: Show dynamic dependencies
33+
run: ldd build/BubbleFinder || true
34+
35+
- name: Package artifacts
36+
run: |
37+
mkdir -p dist
38+
cp build/BubbleFinder dist/
39+
cp README.md dist/ || true
40+
tar czf BubbleFinder-linux-x86_64.tar.gz -C dist .
41+
42+
- name: Upload to GitHub Release
43+
uses: softprops/action-gh-release@v2
44+
with:
45+
files: BubbleFinder-linux-x86_64.tar.gz
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ set(CMAKE_CXX_STANDARD 17)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212
set(CMAKE_CXX_EXTENSIONS OFF)
1313

14+
# Option pour contrôler -march=native en Release
15+
option(SB_NATIVE_OPTIMIZATIONS "Use -march=native in Release builds" ON)
16+
1417
# 2. FetchContent
1518
include(FetchContent)
1619

@@ -99,7 +102,13 @@ endif()
99102
foreach(t BubbleFinder sbio sbutil)
100103
if(TARGET ${t})
101104
target_compile_options(${t} PRIVATE
102-
$<$<CONFIG:Release>:-O3 -DNDEBUG -march=native -flto -pthread>
105+
$<$<CONFIG:Release>:
106+
-O3
107+
-DNDEBUG
108+
-flto
109+
-pthread
110+
$<$<BOOL:${SB_NATIVE_OPTIMIZATIONS}>:-march=native>
111+
>
103112
$<$<CONFIG:RelWithDebInfo>:-O2 -g -DENABLE_PROFILING -fno-omit-frame-pointer>
104113
$<$<CONFIG:Debug>:-O0 -g -fno-omit-frame-pointer>
105114
)
@@ -116,7 +125,8 @@ message(STATUS "C++ standard: ${CMAKE_CXX_STANDARD}")
116125
message(STATUS "OGDF target: ${OGDF_LIB}")
117126
message(STATUS "Sanitizers: ${SB_ENABLE_SANITIZERS}")
118127
message(STATUS "Enable LTO: ${SB_ENABLE_LTO} (ipo_ok=${ipo_ok})")
128+
message(STATUS "Native optimizations (-march=native): ${SB_NATIVE_OPTIMIZATIONS}")
119129

120-
# 10. Tests
130+
# 10. Tests / brute-force tools
121131
add_executable(snarls_bf src/snarls_bruteforce.cpp)
122132
add_executable(superbubbles_bf src/superbubbles_bruteforce.cpp)

0 commit comments

Comments
 (0)