From f4a0a6fcc2628150ddb847215355bd934c6162c3 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Tue, 11 Feb 2014 19:55:41 -0800 Subject: [PATCH] add CXXFLAGS for libstdc++ on OS X 10.9 --- Makefile | 6 +++--- Makefile.config.example | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e3496ea..d058257 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ mat: init $(STATIC_NAME) $(MAT$(PROJECT)_SRC) @echo $(NAME): init $(PROTO_OBJS) $(OBJS) - $(CXX) -shared -o $(NAME) $(OBJS) $(LDFLAGS) $(WARNINGS) + $(CXX) -shared -o $(NAME) $(OBJS) $(CXXFLAGS) $(LDFLAGS) $(WARNINGS) @echo $(STATIC_NAME): init $(PROTO_OBJS) $(OBJS) @@ -132,10 +132,10 @@ runtest: test for testbin in $(TEST_BINS); do $$testbin $(TEST_GPUID); done $(TEST_BINS): %.testbin : %.o $(GTEST_OBJ) $(STATIC_NAME) $(TEST_HDRS) - $(CXX) $< $(GTEST_OBJ) $(STATIC_NAME) -o $@ $(LDFLAGS) $(WARNINGS) + $(CXX) $< $(GTEST_OBJ) $(STATIC_NAME) -o $@ $(CXXFLAGS) $(LDFLAGS) $(WARNINGS) $(EXAMPLE_BINS): %.bin : %.o $(STATIC_NAME) - $(CXX) $< $(STATIC_NAME) -o $@ $(LDFLAGS) $(WARNINGS) + $(CXX) $< $(STATIC_NAME) -o $@ $(CXXFLAGS) $(LDFLAGS) $(WARNINGS) @echo $(OBJS): $(PROTO_GEN_CC) $(HXX_SRCS) diff --git a/Makefile.config.example b/Makefile.config.example index dd5b236..fe117b7 100644 --- a/Makefile.config.example +++ b/Makefile.config.example @@ -27,6 +27,8 @@ LIBRARY_DIRS := $(PYTHON_LIB) /usr/lib /usr/local/lib # For OS X, use clang++. CXX=/usr/bin/g++ +# For OS X 10.9, use libstdc++ instead of libc++ for CUDA compatibility. +#CXXFLAGS=-stdlib=libstdc++ BUILD_DIR=build DISTRIBUTE_DIR=distribute -- 2.7.4