I am trying to build and install Drake from source in order to get support for Mosek. I keep running into trouble, however. For the record, I am running macOS Catalina.
Right now my approach has been this:
- Clone drake from github to a location on my computer (from https://github.com/RobotLocomotion/drake.git)
- Install prereqs
with
./setup/mac/install_prereqs.sh
- Run
bazel build //...
Make a directory calledbuild
andcd build
cmake ..
and thenmake
andmake install
- And in my C++ project, which I build using cmake, I add this to CMakeLists.txt:
link_directories(drakelocation/build/install/lib)
include_directories(drakelocation/build/install/include)
However, when I try to build my project, I get an error that Drake is unable to locate Eigen: 'Eigen/Core' file not found
. I was able to work around this by adding:
target_link_libraries(my_lib Eigen3::Eigen)
to my CMakeLists.txt
I found this a bit strange, as I expect that Drake includes Eigen when it is built, but at least this made me able to get a bit further.
After this I get a bunch of messages of the type:
no member named 'signbit' in the global namespace
i.e. it seems like Drake suddenly is missing all the standard C++ libraries. I have not yet been able to fix this issue, so this is where I am currently stuck.
Do you have any suggestions, or have you encountered any similar problems before?
Other information:
- Using
find_package(drake)
does not work with my current approach at all (cmake is not able to locate drake-config.cmake). Am I missing something here that is required to make this work? Where does cmake expect libraries to be installed, and how do I install them in that place? - I have also tried skipping the entire
bazel build //...
step, going directly to thecmake ..
step, which did not seem to make any difference. - In between every different build approach I have run
bazel clean --expunge
to make sure that nothing sticks around from the previous run.
Thanks!