Skip to content

Commit 55e5aa2

Browse files
committed
add WITH_PYTHON_LAYER build option to include Python layer
Currently, this will only work when running from pycaffe (but not the tool binary), due to static linking conflicts with registration.
1 parent 3c94d96 commit 55e5aa2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ ifeq ($(CPU_ONLY), 1)
288288
COMMON_FLAGS += -DCPU_ONLY
289289
endif
290290

291+
# Python layer support
292+
ifeq ($(WITH_PYTHON_LAYER), 1)
293+
COMMON_FLAGS += -DWITH_PYTHON_LAYER
294+
LIBRARIES += $(PYTHON_LIBRARIES)
295+
endif
296+
291297
# BLAS configuration (default = ATLAS)
292298
BLAS ?= atlas
293299
ifeq ($(BLAS), mkl)

Makefile.config.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ PYTHON_INCLUDE := /usr/include/python2.7 \
5757
PYTHON_LIB := /usr/lib
5858
# PYTHON_LIB := $(ANACONDA_HOME)/lib
5959

60+
# Uncomment to support layers written in Python (will link against Python libs)
61+
# WITH_PYTHON_LAYER := 1
62+
6063
# Whatever else you find you need goes here.
6164
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
6265
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

0 commit comments

Comments
 (0)