我的makefile:
SHELL := /bin/bash
.PHONY: all
all:
pip install runcython
makecython++ stitch_wrapper.pyx "" "stitch_rects.cpp ./hungarian/hungarian.cpp"
hungarian: hungarian/hungarian.so
hungarian/hungarian.so:
cd hungarian && \
TF_INC=$$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') && \
if [ `uname` == Darwin ];\
then g++ -std=c++11 -shared hungarian.cc -o hungarian.so -fPIC -I $$TF_INC -undefined dynamic_lookup;\
else g++ -std=c++11 -shared hungarian.cc -o hungarian.so -fPIC -I $$TF_INC; fi
我已经安装好了。
-cython
-runcython
-python-dev
-python3-dev
-cffi
很遗憾,我仍然收到错误提示:
pkg-config: command not found
.cpp:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 1
makecython++
命令行后添加了标志-I/usr/include/python3.5 -lpython3.5
,但是没有成功,并且出现了错误makecython++需要一个*.pyx文件。
看起来这个标志的语法对于makecython++
不正确。 - AndreaFmakecython++
不是很熟悉,所以只能猜测一下,但我认为你想将这些标志发送给 g++ 而不是makecython++
。 - DavidWpkg-config
部分),但我想知道它是否适用于 Python2 而不是 Python3。然而,我真的不知道如何修复它。 - DavidW