compiling log shows Py_* objects missing
Created by: wanglovesyang
The cmake command is like following, suggesting that the python reference dir is located manually.
cmake -DMKL_ROOT="/opt/user_home/user/intel/mkl/" -DWITH_PYTHON=ON -DWITH_SWIG_PY=ON -DCMAKE_Go_COMPILER="/opt/userhome/user/go/go18/go/bin/go" -DPYTHON_INCLUDE_DIR="/usr/include/python2.7" -DPYTHON_LIBRARY="/usr/lib/python2.7" ..
The error log shows:
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function SequenceHelper': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:211: undefined reference to
PySequence_Check'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function paddle::py::SequenceHelper::size() const': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:214: undefined reference to
PySequence_Size'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function paddle::py::ObjectHelper::getAttr(std::string const&) const': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:143: undefined reference to
PyObject_GetAttrString'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function paddle::py::ObjectHelper::getBoolAttr(std::string const&, bool*) const': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:190: undefined reference to
PyBool_Type'
/opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:192: undefined reference to PyObject_IsTrue' ../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function
paddle::py::SequenceHelper::SequenceHelper(std::unique_ptr<_object, paddle::PyObjectDeleter> const&)':
/opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:207: undefined reference to PySequence_Check' ../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function
paddle::py::SequenceHelper::SequenceHelper(_object*)':
/opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:211: undefined reference to PySequence_Check' ../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function
paddle::py::SequenceHelper::size() const':
/opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:214: undefined reference to PySequence_Size' /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:214: undefined reference to
PySequence_Size'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function paddle::DenseScanner::fill(paddle::Argument&, _object*)': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/gserver/dataproviders/PyDataProvider2.cpp:694: undefined reference to
PyType_IsSubtype'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function paddle::py::SequenceHelper::getDouble(unsigned long) const': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:222: undefined reference to
PyFloat_AsDouble'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function isCallable': /opt/userhome/kdd_yangyang/tools/Paddle/paddle/utils/PythonUtil.h:285: undefined reference to
PyCallable_Check'
../../gserver/libpaddle_gserver.a(PyDataProvider2.cpp.o): In function `paddle::PyDataProvider2::createPyDataObj(std::string const&, std::string const&, std::string const&, std::unique_ptr<_object, paddle::PyObjectDeleter>&&)':
I search stackoverflow and find some suspects. One said that the linking sequence is incorrect, leading to a result that python related objects are missing.