Skip to content

Commit

Permalink
avoid march=native
Browse files Browse the repository at this point in the history
  • Loading branch information
ekg committed Jun 4, 2024
1 parent 081213c commit 719381c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
reproducibleBuild = false;

# Use custom attributes to set compiler flags
CFLAGS = if enableOptimizations then "-O3 -march=native" else "";
CXXFLAGS = if enableOptimizations then "-O3 -march=native" else "";
CFLAGS = if enableOptimizations then "-Ofast -march=x86-64-v3" else "";
CXXFLAGS = if enableOptimizations then "-Ofast -march=x86-64-v3" else "";

postPatch = ''
mkdir -p include
Expand Down
4 changes: 2 additions & 2 deletions src/common/wflign/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ endif()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")

if (${CMAKE_BUILD_TYPE} MATCHES Release)
#set(EXTRA_FLAGS "-Ofast -march=native -flto -fno-fat-lto-objects")
set(EXTRA_FLAGS "-Ofast -march=native")
#set(EXTRA_FLAGS "-Ofast -march=x86-64-v3 -flto -fno-fat-lto-objects")
set(EXTRA_FLAGS "-Ofast -march=x86-64-v3")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG") # reset CXX_FLAGS to replace -O3 with -Ofast
endif ()

Expand Down
2 changes: 1 addition & 1 deletion src/common/wflign/deps/WFA2-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()

if (${CMAKE_BUILD_TYPE} MATCHES Release)
set(OPTIMIZE_FLAGS "${OPTIMIZE_FLAGS} -march=native -D_FILE_OFFSET_BITS=64")
set(OPTIMIZE_FLAGS "${OPTIMIZE_FLAGS} -march=x86-64-v3")
endif()

if ((${CMAKE_BUILD_TYPE} MATCHES Release) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo))
Expand Down
2 changes: 1 addition & 1 deletion src/common/wflign/deps/WFA2-lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ifeq ($(BUILD_EXAMPLES),1)
APPS+=examples
endif

all: CC_FLAGS+=-O3 -march=native #-flto -ffat-lto-objects
all: CC_FLAGS+=-O3 -march=x86-64-v3 #-flto -ffat-lto-objects
all: build

debug: build
Expand Down

0 comments on commit 719381c

Please sign in to comment.