Skip to content

Commit

Permalink
Fix for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed Oct 26, 2024
1 parent 89fe46e commit 824d288
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ SHELL := $(shell which bash)
OSS_ROOT ?= terark-downloads
DBG_FLAGS ?= -g3 -D_DEBUG
RLS_FLAGS ?= -O3 -DNDEBUG -g3
MARCH ?= $(shell uname -m)
ifeq "${MARCH}" "x86_64"
WITH_BMI2 ?= $(shell bash ./cpu_has_bmi2.sh)
else
# not available
WITH_BMI2 ?= na
endif
ROCKSDB_SRC ?= ../rocksdb
TERARK_CORE_HOME ?= ../terark
VCPKG_HOME ?= /node-shared/vcpkg
Expand Down
17 changes: 14 additions & 3 deletions tools/dcompact/exe-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ else
$(error "Fatal: not found topling-zip or topling-core")
endif
BOOST_INC ?= -I${TERARK_HOME}/boost-include
MARCH ?= $(shell uname -m)
ifeq "${MARCH}" "x86_64"
WITH_BMI2 ?= $(shell ${TERARK_HOME}/cpu_has_bmi2.sh)
else
# not available
WITH_BMI2 ?= na
endif

CURRENT_MAKEFILE := $(lastword $(MAKEFILE_LIST))

ifeq "$(origin CXX)" "default"
Expand Down Expand Up @@ -68,7 +75,9 @@ ifeq "$(shell a=${COMPILER};echo $${a:0:3})" "g++"
CXXFLAGS += -Wa,-q
endif
CXXFLAGS += -time
CXXFLAGS += -mcx16
ifeq "${MARCH}" "x86_64"
CXXFLAGS += -mcx16
endif
# CXXFLAGS += -fmax-errors=5
#CXXFLAGS += -fmax-errors=2
endif
Expand All @@ -78,7 +87,9 @@ ifeq "$(shell a=${COMPILER};echo $${a:0:2})" "ic"
CXXFLAGS += -xHost -fasm-blocks
CPU ?= -xHost
else
CPU ?= -march=haswell
ifeq "${MARCH}" "x86_64"
CPU ?= -march=haswell
endif
COMMON_C_FLAGS += -Wno-deprecated-declarations
ifeq "$(shell a=${COMPILER};echo $${a:0:5})" "clang"
COMMON_C_FLAGS += -fstrict-aliasing
Expand All @@ -89,7 +100,7 @@ endif

ifeq (${WITH_BMI2},1)
CPU += -mbmi -mbmi2
else
elifeq (${WITH_BMI2},0)
CPU += -mno-bmi -mno-bmi2
endif

Expand Down

0 comments on commit 824d288

Please sign in to comment.