From 071b1e869752ee94095e557671b92bee501ffa75 Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Thu, 7 Sep 2017 15:55:20 +0200 Subject: [PATCH] better installation instructions --- Makefile | 8 +++++++- README.md | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6109e96..33d187f 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,18 @@ +# The C++ compiler. Adjust if needed CXX:=g++ +# python-config tool. +PYTHON_CONFIG:=python-config + + + PYETS_DEP:=src/ets.cc src/pyETS.cc src/*.h src/external/* PYETS_SRC:=src/ets.cc src/pyETS.cc src/external/*.cc PYCCONV_DEP:=src/cconv.cc src/pycconv.cc src/*.h src/external/* PYCCONV_SRC:=src/cconv.cc src/pycconv.cc src/external/*.cc PYBIND_INC:=src -PYFLAGS:=$(filter-out -Wstrict-prototypes,$(shell python-config --cflags --ldflags)) +PYFLAGS:=$(filter-out -Wstrict-prototypes,$(shell $(PYTHON_CONFIG) --cflags --ldflags)) COMMON_FLAGS:=-O3 -g -fmax-errors=1 -std=c++14 -I src/external -W -Wall diff --git a/README.md b/README.md index de7e54a..bc63e0f 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,14 @@ Pybind11 headers for C++/Python integration Simply type "make". This requires a fairly recent version of GNU g++ (tested with version 5.3 and above, but any 5.x will probably work). +If you can compile the code but you get error messages when trying to import +the Python modules, chances are that the "python" executable and the Python +configuration tool "python-config" in your search path don't match; this +can happen when installing a new Python interpreter from a software repository +in addition to the one distributed with the system. In this case you can edit +the Makefile and set the PYTHON_CONFIG variable to the appropriate +"python-config" with full path. + ## Demo code: The file demo.py contains a very brief overview over the typical workflow, i.e.