From f5634aff70a30818fc27d9da54f25d3aeee9b70e Mon Sep 17 00:00:00 2001 From: Scott Cyphers Date: Thu, 30 Jul 2015 13:35:50 -0400 Subject: [PATCH] Add the appropriate math -rpath to shared libraries link. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 42d71b9228bc..7115d7f2d3dd 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,12 @@ NVCCFLAGS = -std=c++11 -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -m 64 # Set up linker option to embed ORIGIN, i.e. directory where cntk is into the search path option # at runtime. This will try to resolve all dependent binaries in the same directory where cntk binary resides -LDFLAGS=-Wl,-rpath,'$$ORIGIN' +LDFLAGS:=-Wl,-rpath,'$$ORIGIN' +ifeq ($(DEVICE),cpu) +LDFLAGS:=$(LDFLAGS) -Wl,-rpath,$(MATHLIB_PATH)/lib +else +LDFLAGS:=$(LDFLAGS) -Wl,-rpath,$(CUDA_PATH)/lib -Wl,-rpath,$(NVML_LIB) +endif # Define all sources that need to be built COMMON_SRC = Common/fileutil.cpp Common/DataWriter.cpp Common/ConfigFile.cpp Common/DataReader.cpp \