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

[drake_cmake_installed] CMake error when building in release mode #216

Open
pangtao22 opened this issue Feb 14, 2022 · 4 comments
Open

[drake_cmake_installed] CMake error when building in release mode #216

pangtao22 opened this issue Feb 14, 2022 · 4 comments

Comments

@pangtao22
Copy link
Member

pangtao22 commented Feb 14, 2022

I've been structuring my research projects using the drake_cmake_installed pattern. About 1 and a half years ago, I started getting this error when I was running cmake in release mode:

amazon@amazon-system-product-name:~/ClionProjects/drake-external-examples/drake_cmake_installed/build$ cmake .. -DCMAKE_PREFIX_PATH=~/drake-build/install -DCMAKE_BUILD_TYPE=release
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3.6") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found suitable version "3.8.10", minimum required is "3.6") 
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found version "3.8.10") 
CMake Error at /home/amazon/drake-build/install/lib/cmake/pybind11/pybind11Tools.cmake:204 (pybind11_strip):
  Unknown CMake command "pybind11_strip".
Call Stack (most recent call first):
  src/simple_bindings/CMakeLists.txt:35 (pybind11_add_module)


-- Configuring incomplete, errors occurred!
See also "/home/amazon/ClionProjects/drake-external-examples/drake_cmake_installed/build/CMakeFiles/CMakeOutput.log".
See also "/home/amazon/ClionProjects/drake-external-examples/drake_cmake_installed/build/CMakeFiles/CMakeError.log".

It seems that pybind11_strip should be part of the pybind cmake scripts, but it's not installed in the pybind bundled with drake? Our workaround has been simply commenting out the line in cmake that calls pybind11_strip... which is not ideal, and could be the reason why we're getting "weak symbol" warnings after the bindings are built.

@RussTedrake

@pangtao22
Copy link
Member Author

Adding these lines from pybind11 to drake/tools/workspace/pybind11/pybind11-config.cmake (e.g. like this) can solve the problem, but I'm not sure if that's the correct way to do it.

@EricCousineau-TRI
Copy link
Collaborator

EricCousineau-TRI commented Nov 28, 2022

Howdy Pang! I am unable able to reproduce your error. On my system, using v1.10.0:

$ cd drake-external-examples
$ git log -n 1 --oneline --no-decorate
94ae27b Bump CI from Big Sur to Monterey as supported minimium (#245)

$ mkdir drake_cmake_installed-build && cd drake_cmake_installed-build
$ cmake -DCMAKE_PREFIX_PATH=~/.local/opt/drake/v1.10.0 ../drake_cmake_installed -DCMAKE_BUILD_TYPE=Release
# Fails

I believe this may be a system-level dependency issue (either in /usr or /usr/local).

Is there any way you could reproduce this in a Docker or Apptainer container?
(here is how I use Apptainer, for better or worse: repro/.../apptainer_stuff)

EDIT: Updated per Pang's comment - oops!

@pangtao22
Copy link
Member Author

I'm able to reproduce the error in a docker container:
https://github.com/pangtao22/quasistatic_simulator/actions/runs/3570809861/jobs/6002118367

The cause is the -DCMAKE_BUILD_TYPE=Release flag in the cmake command, which is missing in your run @EricCousineau-TRI .

Thanks for looking into this!

@EricCousineau-TRI
Copy link
Collaborator

Filed #247, sorry for the delay!

I just followed your suggested solution which worked out of the box. I can't think of anything better!

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 a pull request may close this issue.

2 participants