From 24bfd03da3da5342034be7ba18116dcf0596216c Mon Sep 17 00:00:00 2001 From: Jeff Donahue Date: Sat, 12 Jul 2014 10:00:44 -0700 Subject: [PATCH] -Override the default compiler by specifying a CXX in Makefile.config instead of CUSTOM_CXX, as Travis exports CXX as the compiler env variable name. -Change TEST_HDFS -> TEST_HXX_SRCS. --- Makefile | 17 ++++++----------- Makefile.config.example | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index c17d498..fc3ffe6 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,8 @@ TEST_SRCS := $(shell find src/$(PROJECT) -name "test_*.cpp") TEST_SRCS := $(filter-out $(TEST_MAIN_SRC), $(TEST_SRCS)) TEST_CU_SRCS := $(shell find src/$(PROJECT) -name "test_*.cu") GTEST_SRC := src/gtest/gtest-all.cpp -# TEST_HDRS are the test header files -TEST_HDRS := $(shell find include/$(PROJECT) -name "test_*.hpp") +# TEST_HXX_SRCS are the test header files +TEST_HXX_SRCS := $(shell find include/$(PROJECT) -name "test_*.hpp") # TOOL_SRCS are the source files for the tool binaries TOOL_SRCS := $(shell find tools -name "*.cpp") # EXAMPLE_SRCS are the source files for the example binaries @@ -194,7 +194,7 @@ else ifeq ($(UNAME), Darwin) endif ifeq ($(LINUX), 1) - CXX := /usr/bin/g++ + CXX ?= /usr/bin/g++ GCCVERSION := $(shell $(CXX) -dumpversion | cut -f1,2 -d.) # older versions of gcc are too dumb to build boost with -Wuninitalized ifeq ($(shell echo $(GCCVERSION) \< 4.6 | bc), 1) @@ -206,7 +206,7 @@ endif # clang++ instead of g++ # libstdc++ instead of libc++ for CUDA compatibility on 10.9 ifeq ($(OSX), 1) - CXX := /usr/bin/clang++ + CXX ?= /usr/bin/clang++ # clang throws this warning for cuda headers WARNINGS += -Wno-unneeded-internal-declaration ifneq ($(findstring 10.9, $(shell sw_vers -productVersion)),) @@ -215,11 +215,6 @@ ifeq ($(OSX), 1) endif endif -# Custom compiler -ifdef CUSTOM_CXX - CXX := $(CUSTOM_CXX) -endif - # Debugging ifeq ($(DEBUG), 1) COMMON_FLAGS := -DDEBUG -g -O0 @@ -385,14 +380,14 @@ $(STATIC_NAME): $(PROTO_OBJS) $(OBJS) | $(LIB_BUILD_DIR) ar rcs $@ $(PROTO_OBJS) $(OBJS) @ echo -$(TEST_BUILD_DIR)/%.o: src/$(PROJECT)/test/%.cpp $(HXX_SRCS) $(TEST_HDRS) \ +$(TEST_BUILD_DIR)/%.o: src/$(PROJECT)/test/%.cpp $(HXX_SRCS) $(TEST_HXX_SRCS) \ | $(TEST_BUILD_DIR) $(CXX) $< $(CXXFLAGS) -c -o $@ 2> $@.$(WARNS_EXT) \ || (cat $@.$(WARNS_EXT); exit 1) @ cat $@.$(WARNS_EXT) @ echo -$(TEST_BUILD_DIR)/%.cuo: src/$(PROJECT)/test/%.cu $(HXX_SRCS) $(TEST_HDRS) \ +$(TEST_BUILD_DIR)/%.cuo: src/$(PROJECT)/test/%.cu $(HXX_SRCS) $(TEST_HXX_SRCS) \ | $(TEST_BUILD_DIR) $(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -c $< -o $@ 2> $@.$(WARNS_EXT) \ || (cat $@.$(WARNS_EXT); exit 1) diff --git a/Makefile.config.example b/Makefile.config.example index 17c9001..81effb4 100644 --- a/Makefile.config.example +++ b/Makefile.config.example @@ -3,7 +3,7 @@ # To customize your choice of compiler, uncomment and set the following. # N.B. the default for Linux is g++ and the default for OSX is clang++ -# CUSTOM_CXX := g++ +# CXX := g++ # CUDA directory contains bin/ and lib/ directories that we need. CUDA_DIR := /usr/local/cuda -- 2.7.4