Skip to content

Commit

Permalink
ceres: allow default compile flags & respect CXX variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Mar 4, 2019
1 parent 8a8e958 commit 76470ef
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tractor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ CERES_LIB ?= -L$(CERES_LIB_DIR) -l$(CERES_LIB_NAME) $(GLOG_LIB) $(SUITESPARSE_LI
ceres.py: ceres.i
swig -python -c++ $(NUMPY_INC) $(CERES_INC) $(EIGEN_INC) $(GLOG_INC) $(GFLAGS_INC) $<

CXXFLAGS := -Wall -fPIC
CXX ?= g++
CXXFLAGS ?= -Wall -fPIC -O3
# DEBUG
CXXFLAGS += -O0 -g
#CXXFLAGS += -O3
#CXXFLAGS += -O0 -g
#CXXFLAGS +=
#CXXLINKFLAGS := -Wl,--no-undefined
#CXXLINKFLAGS :=
CXXLINKFLAGS ?=
Expand All @@ -131,6 +132,6 @@ CERES_EXTRA_LIB ?=

_ceres$(PYTHON_SO_EXT): ceres.i ceres-tractor.h ceres-tractor.cc
swig -python -c++ $(NUMPY_INC) $(CERES_INC) $(EIGEN_INC) $<
g++ $(CXXFLAGS) -c ceres_wrap.cxx $(PYMOD_INC) $(NUMPY_INC) $(CERES_INC) $(EIGEN_INC) $(GLOG_INC) $(GFLAGS_INC)
g++ $(CXXFLAGS) -c ceres-tractor.cc $(PYMOD_INC) $(NUMPY_INC) $(CERES_INC) $(EIGEN_INC) $(GLOG_INC) $(GFLAGS_INC)
g++ $(CXXFLAGS) $(CXXLINKFLAGS) -o $@ -shared ceres_wrap.o ceres-tractor.o $(CERES_LIB) $(PYMOD_LIB) $(CERES_EXTRA_LIB)
$(CXX) $(CXXFLAGS) -c ceres_wrap.cxx $(PYMOD_INC) $(NUMPY_INC) $(CERES_INC) $(EIGEN_INC) $(GLOG_INC) $(GFLAGS_INC)
$(CXX) $(CXXFLAGS) -c ceres-tractor.cc $(PYMOD_INC) $(NUMPY_INC) $(CERES_INC) $(EIGEN_INC) $(GLOG_INC) $(GFLAGS_INC)
$(CXX) $(CXXFLAGS) $(CXXLINKFLAGS) -o $@ -shared ceres_wrap.o ceres-tractor.o $(CERES_LIB) $(PYMOD_LIB) $(CERES_EXTRA_LIB)

0 comments on commit 76470ef

Please sign in to comment.