adding support for env.OPTFLAGS when compiling tensorflow (to pass various optimization and arch specific flags)
@@ -114,11 +114,15 @@ $(shell mkdir -p $(DEPDIR) >/dev/null)
# Settings for the target compiler.
CXX := $(CC_PREFIX) gcc
-OPTFLAGS := -O2
+ifeq (${OPTFLAGS},)
+ OPTFLAGS := -O2
ifneq ($(TARGET),ANDROID)
OPTFLAGS += -march=native
endif
+else
+ OPTFLAGS := ${OPTFLAGS}
+endif
CXXFLAGS := --std=c++11 -DIS_SLIM_BUILD -fno-exceptions -DNDEBUG $(OPTFLAGS) ${CK_COMPILER_FLAGS_OBLIGATORY}
LDFLAGS := \
