Makefile: fix boost::thread linking, drop pthread, sort

This commit is contained in:
Evan Shelhamer 2014-08-30 16:41:01 -07:00
Родитель d7fb3f41b3
Коммит 1193b25c17
1 изменённых файлов: 17 добавлений и 13 удалений

Просмотреть файл

@ -159,9 +159,9 @@ ifneq ($(CPU_ONLY), 1)
LIBRARIES := cudart cublas curand
endif
LIBRARIES += \
glog gflags pthread protobuf leveldb snappy \
glog gflags protobuf leveldb snappy \
lmdb \
boost_system boost_thread \
boost_system \
hdf5_hl hdf5 \
opencv_core opencv_highgui opencv_imgproc
PYTHON_LIBRARIES := boost_python python2.7
@ -205,16 +205,8 @@ ifeq ($(LINUX), 1)
ifeq ($(shell echo $(GCCVERSION) \< 4.6 | bc), 1)
WARNINGS += -Wno-uninitialized
endif
endif
# CPU-only configuration
ifeq ($(CPU_ONLY), 1)
OBJS := $(PROTO_OBJS) $(CXX_OBJS)
TEST_OBJS := $(TEST_CXX_OBJS)
TEST_BINS := $(TEST_CXX_BINS)
ALL_WARNS := $(ALL_CXX_WARNS)
TEST_FILTER := --gtest_filter="-*GPU*"
COMMON_FLAGS += -DCPU_ONLY
# boost::thread is reasonably called boost_thread (compare OS X)
LIBRARIES += boost_thread
endif
# OS X:
@ -228,6 +220,8 @@ ifeq ($(OSX), 1)
CXXFLAGS += -stdlib=libstdc++
LINKFLAGS += -stdlib=libstdc++
endif
# boost::thread is called boost_thread-mt to mark multithreading on OS X
LIBRARIES += boost_thread-mt
endif
# Custom compiler
@ -242,6 +236,16 @@ else
COMMON_FLAGS += -DNDEBUG -O2
endif
# CPU-only configuration
ifeq ($(CPU_ONLY), 1)
OBJS := $(PROTO_OBJS) $(CXX_OBJS)
TEST_OBJS := $(TEST_CXX_OBJS)
TEST_BINS := $(TEST_CXX_BINS)
ALL_WARNS := $(ALL_CXX_WARNS)
TEST_FILTER := --gtest_filter="-*GPU*"
COMMON_FLAGS += -DCPU_ONLY
endif
# BLAS configuration (default = ATLAS)
BLAS ?= atlas
ifeq ($(BLAS), mkl)
@ -273,7 +277,7 @@ LIBRARY_DIRS += $(BLAS_LIB)
# Complete build flags.
COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir))
CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)
CXXFLAGS += -fPIC $(COMMON_FLAGS) $(WARNINGS)
NVCCFLAGS := -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
# mex may invoke an older gcc that is too liberal with -Wuninitalized
MATLAB_CXXFLAGS := $(CXXFLAGS) -Wno-uninitialized