shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

shogunPYTHON_wrap.cxx.o error when install shogun #5148

Closed hmzhangBio closed 3 years ago

hmzhangBio commented 3 years ago

I follow the install manual to compile shogun manually. I installed it in miniconda env. The following steps were taken

shogun_6.1.3 was downloaded

cd shogun-shogun_6.1.3 mkdir build cd build

cmake -DCMAKE_INSTALL_PREFIX=/data12/hongmei/software/shogun/ -DPYTHON_INCLUDE_DIR=/data12/hongmei/miniconda3/include/python3.6m -DPYTHON_LIBRARY=/data12/hongmei/miniconda3/lib/libpython3.6m.so -DPYTHON_EXECUTABLE=/data12/hongmei/miniconda3/bin/python3 -DINTERFACE_PYTHON=ON ..

make

Then, the 'shogunPYTHON_wrap.cxx.o' failed error info showed up. The following is the output of make

[ 0%] Built target ShogunVersionProtobuf [ 1%] Generating version header [ 1%] Built target version [ 1%] Built target class_list [ 2%] Built target rxcpp [ 2%] Built target ChunksProtobuf [ 2%] Built target HeadersProtobuf [ 68%] Built target libshogun [ 68%] Built target shogun [ 68%] copying SWIG files [ 68%] Built target interface_python_src [ 68%] Built target python_doxy2swig [ 68%] Building CXX object src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o src/interfaces/python/CMakeFiles/_interface_python.dir/build.make:93: recipe for target 'src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o' failed CMakeFiles/Makefile2:866: recipe for target 'src/interfaces/python/CMakeFiles/_interface_python.dir/all' failed Makefile:171: recipe for target 'all' failed

I don't know how to fix it. Could you please give me a help? Thanks

gf712 commented 3 years ago

Is that the complete output? Are there no compiler errors when building shogunPYTHON_wrap.cxx.o?

hmzhangBio commented 3 years ago

Thanks for the reply!

Here are the whole output.

[ 0%] Built target ShogunVersionProtobuf [ 1%] Generating version header [ 1%] Built target version [ 1%] Built target class_list [ 2%] Built target rxcpp [ 2%] Built target ChunksProtobuf [ 2%] Built target HeadersProtobuf [ 68%] Built target libshogun [ 68%] Built target shogun [ 68%] copying SWIG files [ 68%] Built target interface_python_src [ 68%] Built target python_doxy2swig [ 68%] Building CXX object src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o In file included from /data12/hongmei/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0, from /data12/hongmei/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /data12/hongmei/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4, from /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:6469: /data12/hongmei/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it with " \

^ cc1plus: warning: unrecognized command line option ‘-Wno-c++11-narrowing’ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:648061:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:648349:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:648637:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:648925:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:649213:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:649501:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:650077:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:650365:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:650653:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:701917:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:702403:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:702889:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:703375:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:703861:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:704347:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:704833:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:705319:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:705805:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:714314:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:714594:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:715227:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:715462:1: error: invalid conversion from ‘PyObject ()(PyObject, Py_ssize_t, bool) {aka _object ()(_object, long int, bool)}’ to ‘ssizeargfunc {aka _object ()(_object, long int)}’ [-fpermissive] }; ^ /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:765189:1: error: invalid conversion from ‘PyObject ()(PyObject, PyObject, bool) {aka _object ()(_object, _object, bool)}’ to ‘binaryfunc {aka _object ()(_object, _object*)}’ [-fpermissive] }; ^ cc1plus: warning: unrecognized command line option ‘-Wno-c++11-narrowing’ src/interfaces/python/CMakeFiles/_interface_python.dir/build.make:93: recipe for target 'src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o' failed make[2]: [src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o] Error 1 CMakeFiles/Makefile2:866: recipe for target 'src/interfaces/python/CMakeFiles/_interface_python.dir/all' failed make[1]: [src/interfaces/python/CMakeFiles/_interface_python.dir/all] Error 2 Makefile:171: recipe for target 'all' failed make: *** [all] Error 2

Thanks.

gf712 commented 3 years ago

It seems like you have added flags to the compiler using environment variables? Which compiler are you using? What is the output of echo $CPPFLAGS?

hmzhangBio commented 3 years ago

Thanks a lot for the help.

I used gcc 5.4.0 and cmake 3.17.5 to do the compiling. I got nothing for echo $CPPFLAGS.

The errors were changed after installing swig to system. Please see below.

[ 67%] Generating shogun_doxygen.i [ 67%] Built target python_doxy2swig [ 67%] Linking CXX shared module _shogun.so CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o: In function shogun_CSGObject___getstate__(shogun::CSGObject*)': /data12/hongmei/software/shogun-shogun_6.1.3/build/src/interfaces/python/shogunPYTHON_wrap.cxx:9561: warning: the use oftmpnam' is dangerous, better use mkstemp' [ 67%] Built target _interface_python [ 67%] Linking CXX executable kernel_machine_train_locked ../../../src/shogun/libshogun.so.18.0: undefined reference tocurl_easy_setopt@CURL_OPENSSL_3' ../../../src/shogun/libshogun.so.18.0: undefined reference to curl_easy_cleanup@CURL_OPENSSL_3' ../../../src/shogun/libshogun.so.18.0: undefined reference tocurl_easy_init@CURL_OPENSSL_3' ../../../src/shogun/libshogun.so.18.0: undefined reference to `curl_easy_perform@CURL_OPENSSL_3' collect2: error: ld returned 1 exit status examples/undocumented/libshogun/CMakeFiles/kernel_machine_train_locked.dir/build.make:112: recipe for target 'examples/undocumented/libshogun/kernel_machine_train_locked' failed make[2]: [examples/undocumented/libshogun/kernel_machine_train_locked] Error 1 CMakeFiles/Makefile2:887: recipe for target 'examples/undocumented/libshogun/CMakeFiles/kernel_machine_train_locked.dir/all' failed make[1]: [examples/undocumented/libshogun/CMakeFiles/kernel_machine_train_locked.dir/all] Error 2 Makefile:171: recipe for target 'all' failed make: *** [all] Error 2

Any idea to fix this? Thanks

jonpsy commented 3 years ago

+1 to this, the main build python interface failed on mine as well

/home/psykik/Documents/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx: At global scope:
/home/psykik/Documents/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx:425231:1: error: invalid conversion from ‘int (*)(PyObject*, FILE*, int)’ {aka ‘int (*)(_object*, _IO_FILE*, int)’} to ‘Py_ssize_t’ {aka ‘long int’} [-fpermissive]
 };

Using ccache compiler develop build

hmzhangBio commented 3 years ago

@gf712, thanks for your patience to answer my questions. I was wondering could you please give me some suggestions to above errors? Thanks in advance!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue is now being closed due to a lack of activity. Feel free to reopen it.