Commit 11883db5 by Ziheng Jiang Committed by Tianqi Chen

add make/config.mk; add nnvm-fusion into plugin as a submodule (#80)

parent 86379cee
ROOTDIR = $(CURDIR)
ifndef config
ifneq ("$(wildcard ./config.mk)", "")
config = config.mk
else
config = make/config.mk
endif
endif
include $(config)
export LDFLAGS = -pthread -lm
export CFLAGS = -std=c++11 -Wall -O2 -msse2 -Wno-unknown-pragmas -funroll-loops\
-Iinclude -fPIC
ifneq ($(ADD_CFLAGS), NONE)
CFLAGS += $(ADD_CFLAGS)
endif
ifneq ($(ADD_LDFLAGS), NONE)
LFFLAGS += $(ADD_LDFLAGS)
endif
# plugin
PLUGIN_OBJ =
include $(NNVM_PLUGINS)
# specify tensor path
.PHONY: clean all test lint doc cython cython3 cyclean
all: lib/libnnvm.a lib/libnnvm_example.so
SRC = $(wildcard src/*.cc src/*/*.cc)
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC))
ALL_DEP = $(ALL_OBJ)
ALL_OBJ = $(patsubst %.cc, build/%.o, $(SRC))
ALL_DEP = $(ALL_OBJ) $(PLUGIN_OBJ)
UNAME_S := $(shell uname -s)
......@@ -26,11 +49,15 @@ include tests/cpp/unittest.mk
test: $(TEST)
build/%.o: src/%.cc
build/src/%.o: src/%.cc
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CXX) $(CFLAGS) -MM -MT build/src/$*.o $< >build/src/$*.d
$(CXX) -c $(CFLAGS) -c $< -o $@
build/plugin/%.o: plugin/%.cc
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MM -MT build/plugin/$*.o $< >build/plugin/$*.d
$(CXX) -c $(CFLAGS) -c $< -o $@
lib/libnnvm.a: $(ALL_DEP)
@mkdir -p $(@D)
......
#-------------------------------------------------------------------------------
# Template configuration for compiling nnvm
#
# If you want to change the configuration, please use the following
# steps. Assume you are on the root directory of nnvm. First copy the this
# file so that any local changes will be ignored by git
#
# $ cp make/config.mk .
#
# Next modify the according entries, and then compile by
#
# $ make
#
# or build in parallel with 8 threads
#
# $ make -j8
#-------------------------------------------------------------------------------
#---------------------
# choice of compiler
#--------------------
export CC = gcc
export CXX = g++
export NVCC = nvcc
# the additional link flags you want to add
ADD_LDFLAGS =
# the additional compile flags you want to add
ADD_CFLAGS =
#----------------------------
# plugins
#----------------------------
# whether to use fusion integration. This requires installing cuda.
# ifndef CUDA_PATH
# CUDA_PATH = /usr/local/cuda
# endif
# NNVM_FUSION_PATH = plugin/nnvm-fusion
# NNVM_PLUGINS += $(NNVM_FUSION_PATH)/nnvm-fusion.mk
nnvm-fusion @ 14593fb8
Subproject commit 14593fb85075ac8c049ca6faf1fee70fda28851a
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment