[ros-users] rosmake doesn't wait for rosbuild_gensrv to complete

Mike Vande Weghe vandeweg at cmu.edu
Tue Apr 19 17:55:23 UTC 2011


Nevermind, I had an error in the other package's manifest, and it was
exporting linker definitions that were not necessary.

Thanks again,

  Mike


On 4/18/2011 1:25 PM, Mike Vande Weghe wrote:
> Darn, that was an obvious mistake.  I should have seen that.
> 
> Well, that seems to have fixed the dependency problem, but now it's
> introducing a new error in the way the code is generated:
> 
>   [100%] Building CXX object CMakeFiles/mytraj.dir/MyTraj.o
>   Linking CXX shared library ../lib/libmytraj.so
>   /usr/bin/ld:
> /homes/mvandewe/pr/branches/mike/owd/lib/libopenwam.a(Trajectory.o):
> relocation R_X86_64_32 against `.bss' can not be used when making a
> shared object; recompile with -fPIC
>   /homes/mvandewe/pr/branches/mike/owd/lib/libopenwam.a: could not read
> symbols: Bad value
>   collect2: ld returned 1 exit status
>   make[3]: *** [../lib/libmytraj.so] Error 1
> 
> Is the rosbuild_add_library() setting different compile flags than
> cmake's own add_library()?  I wasn't getting this error before, and my
> compiled library loaded just fine, too.
> 
> Thanks,
> 
>   Mike
> 
> On 4/18/2011 12:16 PM, Brian Gerkey wrote:
>> On Mon, Apr 18, 2011 at 8:50 AM, Mike Vande Weghe <vandeweg at cmu.edu> wrote:
>>> I've noticed that for a package that defines a single ROS service and
>>> that builds a single shared library, the compilation fails the first
>>> time through because the header file for the service has not yet been
>>> completed.  When I do a second rosmake the compilation succeeds.  Do
>>> service generation and code compilation happen in parallel, and if so is
>>> there a way to order them?
>>>
>>> My CMakeLists.txt looks like this:
>>> -------------------------------------------------------
>>> cmake_minimum_required(VERSION 2.4.6)
>>> include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
>>>
>>> rosbuild_init()
>>> rosbuild_gensrv()
>>>
>>> add_library(mytraj SHARED MyTraj.cpp)
>>> -------------------------------------------------------
>>
>> You're calling CMake's `add_library()` directly, which doesn't offer
>> rosbuild the opportunity to set up dependencies.  It also doesn't
>> bring in ROS-related build flags, e.g., from packages that your
>> package depends on.
>>
>> I recommend calling `rosbuild_add_library()` instead:
>>   rosbuild_add_library(mytraj MyTraj.cpp)
>> You don't need to supply the SHARED flag.  Building of static and
>> shared libs for rosbuild is controlled via the `ROS_BUILD_STATIC_LIBS`
>> and `ROS_BUILD_SHARED_LIBS` variables (but note that static libs are
>> not well-exercised).
>>
>> 	brian.
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
>>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
> 



More information about the ros-users mailing list