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

Compiling yarp with support for python 3.5 #1149

Closed
pedrombmachado opened this issue Mar 28, 2017 · 5 comments
Closed

Compiling yarp with support for python 3.5 #1149

pedrombmachado opened this issue Mar 28, 2017 · 5 comments
Labels
Issue Type: QA/Support This is a generic question or a support request that does not require a patch Resolution: Answered

Comments

@pedrombmachado
Copy link

Dear all,
I was trying to compile the YARP with support for python 3.5 and was unable to do that. One of the issues was related with having half of the links for python 2.7 and another half for python 3.5.
check here:
$ grep -R "PYTHON" ../ | grep PATH
../bindings/tests/python/run.sh: export PYTHONPATH=$YARP_DIR:$PYTHONPATH
../bindings/tests/python/run.sh: export PYTHONPATH=$PWD:$PYTHONPATH
../bindings/CMakeLists.txt: include_directories(SYSTEM ${PYTHON_INCLUDE_PATH})
../bindings/CMakeLists.txt: get_filename_component(PYTHON_DIR ${PYTHON_LIBRARY} PATH)
../bindings/CMakeLists.txt: set(CMAKE_INSTALL_PYTHONDIR ${_CMAKE_INSTALL_PYTHONDIR} CACHE PATH "python bindings (${_CMAKE_INSTALL_PYTHONDIR})")
../bindings/CMakeLists.txt: file(RELATIVE_PATH _rel_path "${CMAKE_INSTALL_FULL_PYTHONDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}")
../doc/yarp_swig.dox:For Python, you can append the path of the bindings build directory to the PYTHONPATH environment variable, like this:
../doc/yarp_swig.dox:export PYTHONPATH=$PYTHONPATH:/path/to/bindings/build
../build/CMakeCache.txt:CMAKE_INSTALL_PYTHONDIR:PATH=lib/python2.7/dist-packages
../build/CMakeCache.txt:PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
../build/CMakeCache.txt:PYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7
../build/CMakeCache.txt:PYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython2.7.so
../build/CMakeCache.txt:PYTHON_LIBRARY_DEBUG:FILEPATH=PYTHON_LIBRARY_DEBUG-NOTFOUND

The other issue was related with having python installing the yarp.py and _yarp.so
-- Installing: /usr/local/lib/python3/dist-packages/_yarp.so
-- Installing: /usr/local/lib/python3/dist-packages/yarp.py

$ yarp version
YARP version 2.3.68+205-20170303.1+git1993603

$ cmake --version
cmake version 3.5.1

$ uname -a
Linux icubsrv 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

@Tobias-Fischer
Copy link
Member

Hi, did you try setting the YARP_USE_PYTHON_VERSION cmake variable?

@pedrombmachado
Copy link
Author

pedrombmachado commented Mar 31, 2017

Hi @Tobias-Fischer. yes I did. I entered 3.5. However if it is working fine with using version 2.7

@drdanz
Copy link
Member

drdanz commented May 10, 2017

@pedrombmachado have you tried cleaning the cache and/or removing the build directory?

Also ensure that the YARP_USE_PYTHON_VERSION variable is set as soon as possible (maybe run cmake -DYARP_USE_PYTHON_VERSION=3.5) perhaps not all the variables are replaced when FindPython is executed the second time.

@gsaponaro
Copy link
Contributor

I stumbled upon this issue, too. The suggestion by @drdanz worked, in my case I enforced the following variables as soon as possible from the build directory:

cmake -DYARP_COMPILE_BINDINGS:BOOL=ON -DCREATE_PYTHON:BOOL=ON -DYARP_USE_PYTHON_VERSION=3.5 -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1 ..

@drdanz
Copy link
Member

drdanz commented Jan 9, 2018

@gsaponaro Thanks for testing this.
I'm closing this issue, @pedrombmachado please re-open it if you still have problems with this.

@drdanz drdanz closed this as completed Jan 9, 2018
@drdanz drdanz added Issue Type: QA/Support This is a generic question or a support request that does not require a patch and removed Type: Support labels Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue Type: QA/Support This is a generic question or a support request that does not require a patch Resolution: Answered
Projects
None yet
Development

No branches or pull requests

4 participants