Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install on Ubuntu #4

Closed
juanilarregui opened this issue May 28, 2017 · 8 comments
Closed

Cannot install on Ubuntu #4

juanilarregui opened this issue May 28, 2017 · 8 comments

Comments

@juanilarregui
Copy link

Hi,

I've been trying to install the library on Ubuntu 16.04. I had some problems in the compilation process (libboost_numpy was on a different folder than the rest of Boost libraries), but finally it did compile.
However, when I run

sudo python setup.py install

I get the following error:

build/lib/lime.so
running install
Traceback (most recent call last):
  File "setup.py", line 70, in <module>
    data_files=[ (get_python_lib(), [ lime_shared_lib ]) ]
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 49, in run
    super(install, self).run()
TypeError: super() argument 1 must be type, not classobj

Any ideas?

@tatsy
Copy link
Owner

tatsy commented May 29, 2017

Hi @juanilarregui,

Actually, the current version supports only Python 3.x, and I tested my code only on Python 3.4.
If the version is not important for you, please try on 3.x.

While I am trying to make the project running on also Python 2.x but it will take some time...

Cheers!

@juanilarregui
Copy link
Author

Hi @tatsy,

Thanks for your quick response! I've succeeded at the installation using:

sudo python3 setup.py

but now, I've got problems when I try to import the library in python:

>>> import lime
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python3/dist-packages/lime.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

do you know what's causing it?

P.S.: sorry to bother you with this kind of things.

@tatsy
Copy link
Owner

tatsy commented May 29, 2017

Hi @juanilarregui,

To install python module, you have to build lime.so before running setup.py.
The build can be perfomed with CMake. The installation can be like the following.

# On root of lime
mkdir build && cd build
cmake -D LIME_BUILD_PYTHON_MODULE=ON ..
cmake --build .
cd ..
python setup.py install

Before install the library, please make sure lime.so appears in build/lib directory.
Cheers.

@tatsy
Copy link
Owner

tatsy commented May 29, 2017

I updated codes to support Python 2.x. I tested on Python 2.7 on #MacOSX.
You can check the PR #5.

@juanilarregui
Copy link
Author

Hi @tatsy,

Still can't get it to work. Having the same problem as before (python 2.7 or 3, same thing). I have build the library and installed it, and lime.so is in build/lib folder.

Maybe a problem within lime.so while searching boost_python? Because the line mention it:

ImportError: /usr/lib/python3/dist-packages/lime.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

Cheers.

@tatsy
Copy link
Owner

tatsy commented May 30, 2017

Hi @juanilarregui,

Have you run setup.py from the root directory?
Even if lime.so is in build/lib directory, it cannot be used without installation in general.

The error you posted does not seem to be the one from boost python.
Cheers!

@juanilarregui
Copy link
Author

juanilarregui commented Jun 1, 2017

Hi @tatsy,

First, sorry to continue bothering you with this.

Yes, I have build and installed the library. Here is the output of each step, for if you find something wrong:

cmake -D LIME_BUILD_PYTHON_MODULE=ON ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-8.0 (found suitable exact version "8.0") 
-- Found OpenCV: /usr/local (found suitable version "3.2.0", minimum required is "3.0") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found suitable version "3.5.2", minimum required is "3") 
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   python
--   numpy
-- [ LIME ] Build examples.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/roberto/lime-master/build
cmake --build .
Scanning dependencies of target pylime
[  6%] Building CXX object sources/python/CMakeFiles/pylime.dir/lime.cpp.o
[ 13%] Linking CXX shared library ../../lib/libpylime.so
[ 13%] Built target pylime
Scanning dependencies of target demo_perlin_noise
[ 20%] Building CXX object examples/cpp/CMakeFiles/demo_perlin_noise.dir/perlin_noise/perlin_noise.cpp.o
[ 26%] Linking CXX executable ../../bin/demo_perlin_noise
[ 26%] Built target demo_perlin_noise
Scanning dependencies of target demo_vector_field_imaging
[ 33%] Building CXX object examples/cpp/CMakeFiles/demo_vector_field_imaging.dir/vector_field_imaging/vector_field_imaging.cpp.o
[ 40%] Linking CXX executable ../../bin/demo_vector_field_imaging
[ 40%] Built target demo_vector_field_imaging
Scanning dependencies of target demo_color_constancy
[ 46%] Building CXX object examples/cpp/CMakeFiles/demo_color_constancy.dir/color_constancy/color_constancy.cpp.o
[ 53%] Linking CXX executable ../../bin/demo_color_constancy
[ 53%] Built target demo_color_constancy
Scanning dependencies of target demo_flow_field_design
[ 60%] Building CXX object examples/cpp/CMakeFiles/demo_flow_field_design.dir/flow_field_design/flow_field_design.cpp.o
[ 66%] Linking CXX executable ../../bin/demo_flow_field_design
[ 66%] Built target demo_flow_field_design
Scanning dependencies of target demo_npr_filters
[ 73%] Building CXX object examples/cpp/CMakeFiles/demo_npr_filters.dir/npr_filters/npr_filters.cpp.o
[ 80%] Linking CXX executable ../../bin/demo_npr_filters
[ 80%] Built target demo_npr_filters
Scanning dependencies of target demo_pencil_drawing
[ 86%] Building CXX object examples/cpp/CMakeFiles/demo_pencil_drawing.dir/pencil_drawing/pencil_drawing.cpp.o
[ 93%] Building CXX object examples/cpp/CMakeFiles/demo_pencil_drawing.dir/pencil_drawing/main.cpp.o
[100%] Linking CXX executable ../../bin/demo_pencil_drawing
[100%] Built target demo_pencil_drawing
sudo python setup.py install
build/lib/lime.so
running install
running build
running install_data
copying build/lib/lime.so -> /usr/lib/python2.7/dist-packages
running install_egg_info
running egg_info
writing lime.egg-info/PKG-INFO
writing top-level names to lime.egg-info/top_level.txt
writing dependency_links to lime.egg-info/dependency_links.txt
reading manifest file 'lime.egg-info/SOURCES.txt'
writing manifest file 'lime.egg-info/SOURCES.txt'
removing '/usr/local/lib/python2.7/dist-packages/lime-0.2.0-py2.7.egg-info' (and everything under it)
Copying lime.egg-info to /usr/local/lib/python2.7/dist-packages/lime-0.2.0-py2.7.egg-info
running install_scripts

I've tried with and without sudo while installation. The problem is the same using python or python3.

Thanks in advance!

@tatsy
Copy link
Owner

tatsy commented Jun 9, 2017

Hi @juanilarregui,

Sorry to be late in responding.
I think the problem is Boost version. To use our program, you should use Boost version 1.63.0 or higher.
Please make sure boost_python and boost_numpy is built with the correct Python headers and libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants