Skip to content

Commit

Permalink
Fix segfault due to linking issue.
Browse files Browse the repository at this point in the history
On Darwin, link with python library from conda instead of from system.
  • Loading branch information
David Froger committed Aug 19, 2014
1 parent 9c28128 commit 28539f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ UNAME := $(shell uname)
SHARED_LIB := _$(PROG).so
CFLAGS := -O3 -Wall -g -fPIC
PYTHON_INCLUDES := $(shell python-config --includes)
PYTHON_PREFIX := $(shell python-config --prefix)
PYTHON_LIBS := $(shell python-config --libs)

all: $(PROG) swig test-python

Expand All @@ -24,7 +26,7 @@ endif

$(SHARED_LIB): $(PROG) $(PROG)_wrap.c $(PROG)_wrap.o
ifeq ($(UNAME), Darwin)
$(CC) $(SHLIB_FLAGS) $(CFLAGS) $(PYTHON_INCLUDES) -o $@ $(PROG)_wrap.o -lpython
$(CC) $(SHLIB_FLAGS) $(CFLAGS) $(PYTHON_INCLUDES) -o $@ $(PROG)_wrap.o -L$(PYTHON_PREFIX)/lib $(PYTHON_LIB)
else
$(CC) $(SHLIB_FLAGS) $(CFLAGS) -o $@ $(PROG)_wrap.o
endif
Expand Down

0 comments on commit 28539f1

Please sign in to comment.