Algomorph/pyboostcvconverter

Issues on Ubuntu 16.04

Closed this issue · 8 comments

Hello, i'm having the following error when i run Cmake

CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_python27

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:53 (find_package)


Can't find BOOST_LIBRARYDIR or BOOST_ROOT but is working if i run the demo code i have in :

https://stackoverflow.com/questions/53747379/expose-opencv-c-mat-to-python

so, idont know why i cant generate this solution hope you can help me

@Azazel17 , the issue was described in the README here: https://github.com/Algomorph/pyboostcvconverter/tree/5ea198f6d4ffd14a43737591fa945a23fc2e23e3#notes-for-windows-usage--known-problems--troubleshooting

It seems like newer versions of Boost or FindBoost don't require the "-py" suffix for the Boost Python component (argument to find_package), hence I removed them previously.

I just added a workaround where it first checks for the newer syntax, but reverts to the old syntax if nothing is found, and reports the error only if neither were found.

Try pulling again and re-running CMake.

Thanks a lot, Now it works like a charm, however cant import the library even if i run the make install as sudo, hwich files shuld i copy to dist-packages for it to works?

@Azazel17 sudo make install should work on Ubuntu 16.04, are you absolutely certain you're running the correct python? I think by default it builds for python 3.

If you want to do it manually, just the .so file that's being built needs to be copied to dist-packages or anywhere within your PYTHONPATH.

Yes i'm sure but in fact i can find the .so file, not sure whats wrong

In fact this is the ouput of make and sudo make install

the-taco-coder@the-taco-coder:~/Documentos/PBCVT/build$ make Scanning dependencies of target pbcvt [ 20%] Building CXX object CMakeFiles/pbcvt.dir/src/python_module.cpp.o [ 40%] Building CXX object CMakeFiles/pbcvt.dir/src/pyboost_cv3_converter.cpp.o [ 60%] Building CXX object CMakeFiles/pbcvt.dir/src/pyboost_cv2_converter.cpp.o [ 80%] Building CXX object CMakeFiles/pbcvt.dir/src/pyboost_cv4_converter.cpp.o [100%] Linking CXX shared library pbcvtNone [100%] Built target pbcvt the-taco-coder@the-taco-coder:~/Documentos/PBCVT/build$ sudo make install [sudo] password for the-taco-coder: [100%] Built target pbcvt Install the project... -- Install configuration: "" -- Installing: /usr/local/lib/python2.7/dist-packages/pbcvtNone -- Set runtime path of "/usr/local/lib/python2.7/dist-packages/pbcvtNone" to ""

I see, there seems to be a bug in the name generation for the .so file: the extension is wrong. I'll look into it right now.

@Azazel17 fixed now (pull again, please).
The issue was me failing to backport the deprecated method for retrieval of the extension library suffix, which changed for Python3 but remained the same for Python2. Sorry about that. I should probably do automated testing in this project.

Closing inactive thread, feel free to reopen if issues remain.