File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 8787 python -m pip install build wheel setuptools pybind11-stubgen auditwheel
8888
8989 - name : Build wheel
90+ env :
91+ CMAKE_ARGS : " -DDSF_OPTIMIZE_ARCH=OFF"
9092 run : |
9193 rm -rf dist wheelhouse
9294 python -m build --wheel
@@ -140,6 +142,8 @@ jobs:
140142 echo "_PYTHON_HOST_PLATFORM=macosx-$(sw_vers -productVersion | cut -d. -f1)-$(uname -m)" >> $GITHUB_ENV
141143
142144 - name : Build wheel
145+ env :
146+ CMAKE_ARGS : " -DDSF_OPTIMIZE_ARCH=OFF"
143147 run : python -m build --wheel
144148
145149 - name : Repair wheel (bundle libraries)
@@ -188,6 +192,8 @@ jobs:
188192 python -m pip install build wheel setuptools pybind11-stubgen
189193
190194 - name : Build wheel
195+ env :
196+ CMAKE_ARGS : " -DDSF_OPTIMIZE_ARCH=OFF"
191197 run : python -m build --wheel
192198
193199 - name : Upload wheels as artifacts
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ option(DSF_EXAMPLES "Build DSF examples" OFF)
2222option (DSF_BENCHMARKS "Build DSF benchmarks" OFF )
2323option (DSF_BUILD_PIC "Build DSF with position-independent code" OFF )
2424option (BUILD_PYTHON_BINDINGS "Build Python bindings" OFF )
25+ option (DSF_OPTIMIZE_ARCH "Optimize for native architecture" ON )
2526
2627# If CMAKE_BUILD_TYPE not set, default to Debug
2728if (NOT CMAKE_BUILD_TYPE )
@@ -49,13 +50,19 @@ set(CMAKE_CXX_EXTENSIONS OFF)
4950# Ensure optimization flags are applied only in Release mode
5051if (CMAKE_BUILD_TYPE MATCHES "Release" )
5152 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
52- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto=auto" )
53+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -flto=auto" )
54+ if (DSF_OPTIMIZE_ARCH)
55+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native" )
56+ endif ()
5357 elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
5458 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2" )
5559 endif ()
5660elseif (CMAKE_BUILD_TYPE MATCHES "Profile" )
5761 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
58- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto=auto -pg" )
62+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -flto=auto -pg" )
63+ if (DSF_OPTIMIZE_ARCH)
64+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native" )
65+ endif ()
5966 endif ()
6067elseif (CMAKE_BUILD_TYPE MATCHES "Coverage" )
6168 set (DSF_TESTS ON )
Original file line number Diff line number Diff line change 66
77static constexpr uint8_t DSF_VERSION_MAJOR = 4 ;
88static constexpr uint8_t DSF_VERSION_MINOR = 5 ;
9- static constexpr uint8_t DSF_VERSION_PATCH = 3 ;
9+ static constexpr uint8_t DSF_VERSION_PATCH = 4 ;
1010
1111static auto const DSF_VERSION =
1212 std::format (" {}.{}.{}" , DSF_VERSION_MAJOR, DSF_VERSION_MINOR, DSF_VERSION_PATCH);
You can’t perform that action at this time.
0 commit comments