Disentangle cuda libraries from where they aren't needed
Allow nvidia gdk to be installed in /usr/local/gdk
This commit is contained in:
Родитель
9b44e1f92f
Коммит
04af449678
13
Makefile
13
Makefile
|
@ -54,7 +54,10 @@ INCLUDEPATH:= Common/Include Math/Math MachineLearning/CNTK MachineLearning/CNTK
|
||||||
CPPFLAGS:= -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K
|
CPPFLAGS:= -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K
|
||||||
CXXFLAGS:= -msse3 -std=c++0x -std=c++11 -fopenmp -fpermissive -fPIC -Werror -Wno-error=literal-suffix
|
CXXFLAGS:= -msse3 -std=c++0x -std=c++11 -fopenmp -fpermissive -fPIC -Werror -Wno-error=literal-suffix
|
||||||
LIBPATH:=
|
LIBPATH:=
|
||||||
|
# For everyone
|
||||||
LIBS:=
|
LIBS:=
|
||||||
|
# Just the math library
|
||||||
|
CNTKMATH_LIBS:=
|
||||||
LDFLAGS:=
|
LDFLAGS:=
|
||||||
|
|
||||||
SEPARATOR = "=-----------------------------------------------------------="
|
SEPARATOR = "=-----------------------------------------------------------="
|
||||||
|
@ -85,7 +88,9 @@ endif
|
||||||
# Set up CUDA includes and libraries
|
# Set up CUDA includes and libraries
|
||||||
INCLUDEPATH += $(CUDA_PATH)/include
|
INCLUDEPATH += $(CUDA_PATH)/include
|
||||||
LIBPATH += $(CUDA_PATH)/lib64
|
LIBPATH += $(CUDA_PATH)/lib64
|
||||||
LIBS += -lcublas -lcudart -lcuda -lcurand -lcusparse -lnvidia-ml
|
# Profiling is currently enabled directly from cntk, rather than via the math library
|
||||||
|
LIBS += -lcudart
|
||||||
|
CNTKMATH_LIBS += -lcublas -lcudart -lcuda -lcurand -lcusparse -lnvidia-ml
|
||||||
|
|
||||||
else
|
else
|
||||||
DEVICE = cpu
|
DEVICE = cpu
|
||||||
|
@ -96,14 +101,14 @@ endif
|
||||||
ifeq ("$(MATHLIB)","acml")
|
ifeq ("$(MATHLIB)","acml")
|
||||||
INCLUDEPATH += $(ACML_PATH)/include
|
INCLUDEPATH += $(ACML_PATH)/include
|
||||||
LIBPATH += $(ACML_PATH)/lib
|
LIBPATH += $(ACML_PATH)/lib
|
||||||
LIBS += -lacml -lm -lpthread
|
CNTKMATH_LIBS += -lacml -lm -lpthread
|
||||||
CPPFLAGS += -DUSE_ACML
|
CPPFLAGS += -DUSE_ACML
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ("$(MATHLIB)","mkl")
|
ifeq ("$(MATHLIB)","mkl")
|
||||||
INCLUDEPATH += $(MKL_PATH)/mkl/include
|
INCLUDEPATH += $(MKL_PATH)/mkl/include
|
||||||
LIBPATH += $(MKL_PATH)/compiler/lib/intel64 $(MKL_PATH)/mkl/lib/intel64 $(MKL_PATH)/compiler/lib/mic $(MKL_PATH)/mkl/lib/mic
|
LIBPATH += $(MKL_PATH)/compiler/lib/intel64 $(MKL_PATH)/mkl/lib/intel64 $(MKL_PATH)/compiler/lib/mic $(MKL_PATH)/mkl/lib/mic
|
||||||
LIBS += -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -liomp5 -lpthread
|
CNTKMATH_LIBS += -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -liomp5 -lpthread
|
||||||
CPPFLAGS += -DUSE_MKL
|
CPPFLAGS += -DUSE_MKL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -212,7 +217,7 @@ $(CNTKMATH_LIB): $(MATH_OBJ)
|
||||||
@echo $(SEPARATOR)
|
@echo $(SEPARATOR)
|
||||||
@echo creating $@ for $(ARCH) with build type $(BUILDTYPE)
|
@echo creating $@ for $(ARCH) with build type $(BUILDTYPE)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%, $(LIBPATH) $(NVMLPATH)) $(patsubst %,$(RPATH)%, $(ORIGINDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -fopenmp
|
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%, $(LIBPATH) $(NVMLPATH)) $(patsubst %,$(RPATH)%, $(ORIGINDIR) $(LIBPATH)) -o $@ $^ $(CNTKMATH_LIBS) $(LIBS) -fopenmp
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# BinaryReader plugin
|
# BinaryReader plugin
|
||||||
|
|
|
@ -40,7 +40,7 @@ default_mkls=""
|
||||||
# NOTE: Will get compilation errors with cuda-6.0
|
# NOTE: Will get compilation errors with cuda-6.0
|
||||||
default_cudas="cuda-7.5 cuda-7.0 cuda-6.5"
|
default_cudas="cuda-7.5 cuda-7.0 cuda-6.5"
|
||||||
default_kaldis="kaldi-trunk"
|
default_kaldis="kaldi-trunk"
|
||||||
default_gdks="."
|
default_gdks=". gdk/usr"
|
||||||
|
|
||||||
function default_paths ()
|
function default_paths ()
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче