Trying to use OMPL 1.1.0 library. I'm using this sample code (not really relevant to the problem, which happens at runtime):
#include <ompl/base/Goal.h>
#include <ompl/base/goals/GoalState.h>
#include <ompl/base/goals/GoalStates.h>
#include <ompl/base/ProjectionEvaluator.h>
#include <ompl/base/StateSpace.h>
#include <ompl/geometric/PathSimplifier.h>
#include <ompl/base/samplers/UniformValidStateSampler.h>
#include <ompl/base/spaces/RealVectorStateSpace.h>
#include <ompl/base/spaces/SE2StateSpace.h>
#include <ompl/base/spaces/SE3StateSpace.h>
#include <ompl/geometric/SimpleSetup.h>
#include <ompl/geometric/planners/rrt/RRT.h>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
namespace ob = ompl::base;
namespace og = ompl::geometric;
bool isStateValid(const ob::State *state)
{
return true;
}
int main(int /*argc*/, char ** /*argv*/)
{
std::cout << "OMPL version: " << OMPL_VERSION << std::endl;
boost::shared_ptr<ob::SE3StateSpace> space(boost::make_shared<ob::SE3StateSpace>());
ob::RealVectorBounds bounds(3);
bounds.setLow(-1);
bounds.setHigh(1);
space->setBounds(bounds);
og::SimpleSetup ss(space);
//ss.setStateValidityChecker([](const ob::State *state) { return isStateValid(state); });
ob::ScopedState<> start(space);
start.random();
ob::ScopedState<> goal(space);
goal.random();
ss.setStartAndGoalStates(start, goal);
ss.setup();
ss.print();
ob::PlannerStatus solved = ss.solve(1.0);
if(solved)
{
std::cout << "Found solution:" << std::endl;
ss.simplifySolution();
ss.getSolutionPath().print(std::cout);
}
else
std::cout << "No solution found" << std::endl;
return 0;
}
and the following makefile:
CXXFLAGS=-I/usr/local/Cellar/ompl/1.1.0/include -I/usr/local/Cellar/boost/1.64.0_1/include
LDLIBS=-lc++ -L/usr/local/Cellar/boost/1.64.0_1/lib/ -lboost_thread-mt -lboost_filesystem -lboost_system -lompl
ompltest: ompltest.o
when I run the executable I get:
dyld: lazy symbol binding failed: Symbol not found: __ZN5boost11this_thread5hiden11sleep_untilERK8timespec
Referenced from: /usr/local/opt/ompl/lib/libompl.11.dylib
Expected in: /usr/local/opt/boost/lib/libboost_thread-mt.dylib
dyld: Symbol not found: __ZN5boost11this_thread5hiden11sleep_untilERK8timespec
Referenced from: /usr/local/opt/ompl/lib/libompl.11.dylib
Expected in: /usr/local/opt/boost/lib/libboost_thread-mt.dylib
Abort trap: 6
I look for the missing symbol in the boost shared library, and I find:
$ nm -gU /usr/local/opt/boost/lib/libboost_thread-mt.dylib | grep sleep_until.*timespec
0000000000004130 T __ZN5boost11this_thread21no_interruption_point6hidden11sleep_untilERK8timespec
0000000000004390 T __ZN5boost11this_thread6hidden11sleep_untilERK8timespec
there is __ZN5boost11this_thread6hidden11sleep_untilERK8timespec and not __ZN5boost11this_thread5hiden11sleep_untilERK8timespec . what is that? a typo? or intended? the point is that I cannot use this library which I didn't even build by myself (installed via homebrew)
EDIT: unmangled symbol names:
$ nm -jgU /usr/local/opt/boost/lib/libboost_thread-mt.dylib | grep sleep_until.*timespec | c++filt
boost::this_thread::no_interruption_point::hidden::sleep_until(timespec const&)
boost::this_thread::hidden::sleep_until(timespec const&)
$ echo __ZN5boost11this_thread5hiden11sleep_untilERK8timespec | c++filt
boost::this_thread::hiden::sleep_until(timespec const&)