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

Cleanup cmake files #11

Merged
merged 9 commits into from
Dec 23, 2019
Merged

Cleanup cmake files #11

merged 9 commits into from
Dec 23, 2019

Conversation

rhaschke
Copy link
Contributor

@rhaschke rhaschke commented Dec 23, 2019

This addresses #10 and several other minor issues in the cmake files. See individual commits and their commit messages for details.
One open question is whether Eigen and numpy should be really package dependencies here?
These are only required if you actually want to use those features in your downstream project.
Hence, I would argue, the downstream project is responsible for including them.

These are not find_packaged and thus the corresponding variables are not defined.
They are not needed to build this package, but by downstream packages.
but directly create module .so in target folder.
The distinction between install and devel space was brittle and is not required:
devel-space includes are made relative to intall space by catkin
Setting an already cached variable again is a no-op.
Thus, most of the variable settings were non-sense.

pybind11 should use the same python version as ROS.
Thus considering PYBIND_PYTHON_EXECUTABLE doesn't make sense to me.

To directly use pybind11_add_module(), it is important to correctly set PYBIND11_INCLUDE_DIR.

pybind11_catkin_INCLUDE_DIRS should include PYTHON_INCLUDE_DIRS,
maybe EIGEN3_INCLUDE_DIR?
@rhaschke
Copy link
Contributor Author

Looks like Travis is broken on Melodic. Looking into this now...

@rhaschke rhaschke closed this Dec 23, 2019
@rhaschke
Copy link
Contributor Author

The Travis issue was unrelated to my changes: industrial_ci installs python3 via lsb-release in its base docker image. This caused pybind11 to use python3 instead of python2. I added another commit to ensure that the same python version is used as by catkin.

@rhaschke rhaschke reopened this Dec 23, 2019
@wxmerkt
Copy link
Owner

wxmerkt commented Dec 23, 2019

Thank you for the clean-up!

Thus considering PYBIND_PYTHON_EXECUTABLE doesn't make sense to me.

We have users who under ROS1 use Python3 (and manually pip3 install the rospy, rospack dependencies). Is there another way to have ROS1 with Python3 locally that I missed?

@rhaschke
Copy link
Contributor Author

We have users who under ROS1 use Python3 (and manually pip3 install the rospy, rospack dependencies). Is there another way to have ROS1 with Python3 locally that I missed?

The way to select the python version for ROS is to set the environment variable ROS_PYTHON_VERSION, isn't it?
https://github.com/ros/catkin/blob/15df8d27136976aa2240eae9aa232728887aebb8/cmake/python.cmake#L3-L4

@wxmerkt
Copy link
Owner

wxmerkt commented Dec 23, 2019

The way to select the python version for ROS is to set the environment variable ROS_PYTHON_VERSION, isn't it?
https://github.com/ros/catkin/blob/15df8d27136976aa2240eae9aa232728887aebb8/cmake/python.cmake#L3-L4

Ah, yes, that is what I had missed and was looking for.

@wxmerkt
Copy link
Owner

wxmerkt commented Dec 23, 2019

Which project are you testing and building with these changes? I tried exotica_python locally and it doesn't work using these updates. I am looking for an example to amend accordingly

@rhaschke
Copy link
Contributor Author

Which project are you testing and building with these changes? I tried exotica_python locally and it doesn't work using these updates. I am looking for an example to amend accordingly

I'm in the process of migrating https://github.com/ubi-agni/moveit_task_constructor/tree/wip-python-api from boost::python to pybind11. So far, only moveit_task_constructor_core is building.

@rhaschke
Copy link
Contributor Author

I just built exotica with the new pybind11_catkin in a clean workspace w/o issues.
What kind of problems do you observe?

@wxmerkt
Copy link
Owner

wxmerkt commented Dec 23, 2019

The include directories weren't set up correctly. The minimal change to this PR that I required was:
image

Then this PR works well for me :-)

catkin_package() doesn't export the install-space's include path correctly.
It's only named include, missing the subfolder pybind11_catkin.
@wxmerkt wxmerkt merged commit 2f601aa into wxmerkt:master Dec 23, 2019
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

Successfully merging this pull request may close these issues.

2 participants