Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
python -m pip install build wheel setuptools pybind11-stubgen auditwheel

- name: Build wheel
env:
CMAKE_ARGS: "-DDSF_OPTIMIZE_ARCH=OFF"
run: |
rm -rf dist wheelhouse
python -m build --wheel
Expand Down Expand Up @@ -140,6 +142,8 @@ jobs:
echo "_PYTHON_HOST_PLATFORM=macosx-$(sw_vers -productVersion | cut -d. -f1)-$(uname -m)" >> $GITHUB_ENV

- name: Build wheel
env:
CMAKE_ARGS: "-DDSF_OPTIMIZE_ARCH=OFF"
run: python -m build --wheel

- name: Repair wheel (bundle libraries)
Expand Down Expand Up @@ -188,6 +192,8 @@ jobs:
python -m pip install build wheel setuptools pybind11-stubgen

- name: Build wheel
env:
CMAKE_ARGS: "-DDSF_OPTIMIZE_ARCH=OFF"
run: python -m build --wheel

- name: Upload wheels as artifacts
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ option(DSF_EXAMPLES "Build DSF examples" OFF)
option(DSF_BENCHMARKS "Build DSF benchmarks" OFF)
option(DSF_BUILD_PIC "Build DSF with position-independent code" OFF)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
option(DSF_OPTIMIZE_ARCH "Optimize for native architecture" ON)

# If CMAKE_BUILD_TYPE not set, default to Debug
if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -49,13 +50,19 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Ensure optimization flags are applied only in Release mode
if(CMAKE_BUILD_TYPE MATCHES "Release")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto=auto")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -flto=auto")
if(DSF_OPTIMIZE_ARCH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2")
endif()
elseif(CMAKE_BUILD_TYPE MATCHES "Profile")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto=auto -pg")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -flto=auto -pg")
if(DSF_OPTIMIZE_ARCH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
endif()
elseif(CMAKE_BUILD_TYPE MATCHES "Coverage")
set(DSF_TESTS ON)
Expand Down
2 changes: 1 addition & 1 deletion src/dsf/dsf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

static constexpr uint8_t DSF_VERSION_MAJOR = 4;
static constexpr uint8_t DSF_VERSION_MINOR = 5;
static constexpr uint8_t DSF_VERSION_PATCH = 3;
static constexpr uint8_t DSF_VERSION_PATCH = 4;

static auto const DSF_VERSION =
std::format("{}.{}.{}", DSF_VERSION_MAJOR, DSF_VERSION_MINOR, DSF_VERSION_PATCH);
Expand Down
Loading