Error while do make after cmake
I got this error while make after cmake -DCMAKE_BUILD_TYPE=RELEASE -DMCF_BUILD_PYTHON=ON -DMCF_BUILD_STATIC=ON ..
[ 22%] Building CXX object CMakeFiles/pymcf.dir/python/pymcf.cpp.o In file included from /home/admin/Documents/tracker/mcf-tracker/external/mcf/build/external-install/include/pybind11/pytypes.h:12:0, from /home/admin/Documents/tracker/mcf-tracker/external/mcf/build/external-install/include/pybind11/cast.h:13, from /home/admin/Documents/tracker/mcf-tracker/external/mcf/build/external-install/include/pybind11/attr.h:13, from /home/admin/Documents/tracker/mcf-tracker/external/mcf/build/external-install/include/pybind11/pybind11.h:36, from /home/admin/Documents/tracker/mcf-tracker/external/mcf/python/pymcf.cpp:2: /home/admin/Documents/tracker/mcf-tracker/external/mcf/build/external-install/include/pybind11/common.h:70:20: fatal error: Python.h: No such file or directory compilation terminated. CMakeFiles/pymcf.dir/build.make:230: recipe for target 'CMakeFiles/pymcf.dir/python/pymcf.cpp.o' failed make[2]: *** [CMakeFiles/pymcf.dir/python/pymcf.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pymcf.dir/all' failed make[1]: *** [CMakeFiles/pymcf.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
I finally solve this. The problem is in pybind11.
just edit mcf-tracker/external/mcf/build/external-install/include/pybind11/common.h
line 70 from #include <Python.h> to #include <python2.7/Python.h,
line 71 from #include <frameobject.h> to #include <python2.7/frameobject.h>, and
line 72 from #include <pythread.h> to #include <python2.7/pythread.h>
This problem only for Python 2.7
Sorry, I didn't have a look at this in a while. I haven't tested it but an alternative (maybe cleaner) solution would be to set PYBIND11_PYTHON_VERSION to 2.7 by invoking cmake with -DPYBIND11_PYTHON_VERSION=2.7.