add WITH_PYTHON_LAYER build option to include Python layer
authorJonathan L Long <jonlong@cs.berkeley.edu>
Sat, 10 Jan 2015 06:57:26 +0000 (22:57 -0800)
committerJonathan L Long <jonlong@cs.berkeley.edu>
Tue, 17 Feb 2015 06:47:30 +0000 (22:47 -0800)
Currently, this will only work when running from pycaffe (but not the
tool binary), due to static linking conflicts with registration.

Makefile
Makefile.config.example

index ba60ae9..254f7fe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -288,6 +288,12 @@ ifeq ($(CPU_ONLY), 1)
        COMMON_FLAGS += -DCPU_ONLY
 endif
 
+# Python layer support
+ifeq ($(WITH_PYTHON_LAYER), 1)
+       COMMON_FLAGS += -DWITH_PYTHON_LAYER
+       LIBRARIES += $(PYTHON_LIBRARIES)
+endif
+
 # BLAS configuration (default = ATLAS)
 BLAS ?= atlas
 ifeq ($(BLAS), mkl)
index 9d13b45..7a8aafd 100644 (file)
@@ -57,6 +57,9 @@ PYTHON_INCLUDE := /usr/include/python2.7 \
 PYTHON_LIB := /usr/lib
 # PYTHON_LIB := $(ANACONDA_HOME)/lib
 
+# Uncomment to support layers written in Python (will link against Python libs)
+# WITH_PYTHON_LAYER := 1
+
 # Whatever else you find you need goes here.
 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib