ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Release package which depends on 3rd party libraries

asked 2015-05-11 10:59:28 -0500

updated 2015-07-06 08:35:00 -0500

Hello everyone,

My question is related to do a release of packages that depends on a 3rd party library. Until now, I have solved my problem for the doc buildfarm by adding a command in the CMakeList.txt which launch a script to install the 3rd parties in the system (headers and libs). I know this could be considered as a trick but it worked fine for me.

Here the command I used in the CMakeList.txt:

# install third parties
execute_process(COMMAND sudo bash install.bash
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/third_parties/
)

After that, I tried to do the release version of my packages. So, I read the tutorial of "Wrapping an external library in ROS" which says that this way is deprecated. And, I read then the tutorial "Releasing a Third Party Package (with bloom)" but I do not understand very well the steps for releasing the 3rd party code.


My package structure are the next:

  • maggie_drivers (repo)
    • maggie_drivers (metapkg)
    • maggie_ir_drivers (pkg with 3rd party deps)
    • maggie_labjack_drivers (pkg with 3rd party deps)
    • maggie_rfid_drivers (pkg with 3rd party deps)
    • maggie_*_drivers (other pkgs)

Here the link to GitHub.

For the maggie_ir_drivers package, I have directly the code of the 3rd party, that is, I have 2 folders, with the headers and the libs I need to compile my package.

Until now, to install this 3rd party I had to run this bash script:

#!/bin/bash

# get machine architecture
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == "x86_64" ]; then
  LIBPATH=./x64
else
  LIBPATH=./x86
fi

LOCALINCLUDE=/usr/local/include/irtrans
LOCALLIB=/usr/local/lib/

### copy headers
echo "Copying headers..."
mkdir $LOCALINCLUDE --parents
cp $LIBPATH/*.h $LOCALINCLUDE

### copy libs
echo "Copying libs..."
cp $LIBPATH/*.so $LOCALLIB

# config links
ldconfig

For the maggie_rfid_drivers package the 3rd party is similar, a folder with the headers and the libs to be installed in the system by a bash script. Here the script.

Finally, for the maggie_labjack_drivers package, I have something different. The 3rd party code are divided in two, one installed by a github repository and other by a ZIP file. For the first one, I need to patch the bash script that install the code because of a bug. The second one is simpler, is a makefile project and only is necessary to unzip and to do a make install.

Thanks in advance.

Edit:

Still with no solution. It seems the execute_process is not being executed when the Jenking job install the releases. So, there is an error searching the headers form the 3rd parties.

edit retag flag offensive close merge delete

Comments

If you want to build these things on the ROS build farm, then you should definitely use the "Releasing a Third Party Package (with bloom)", but I don't know what exactly you're having an issue with, so I can't help more.

William gravatar image William  ( 2015-05-11 13:33:11 -0500 )edit

Ok @William. Sorry for not to give many details. Now I edit my own question.

Could you tell me if the steps on that tutorial are valid for me?

Thanks.

raul.perula gravatar image raul.perula  ( 2015-05-12 02:23:02 -0500 )edit

Yes, "Releasing a Third Party Package (with bloom)" is the tutorial you should be following.

ahendrix gravatar image ahendrix  ( 2015-05-12 03:01:08 -0500 )edit

Ok, @ahendrix. The problem is this tutorial is not so clear for me. I do not understand how I could release my 3rd party properly.

For instance, I do not know if I should create a separate package with my script.

I am totally lost with this tutorial.

raul.perula gravatar image raul.perula  ( 2015-05-14 03:55:43 -0500 )edit

Nobody can help me with this? Or at least give me a reference to a project which use something similar?

raul.perula gravatar image raul.perula  ( 2015-05-19 06:25:57 -0500 )edit

@raul.perula Step 2.4 is technically not required for it to work, but it's a pretty straight forward thing to ask "install the package.xml". If you're using CMake then you just add an install rule; otherwise all build systems should allow you to install arbitrary files. Why are you blocked?

William gravatar image William  ( 2015-06-10 12:36:59 -0500 )edit

As @ahendrix said, I need several patchs. So, if you see mi "Edit 1", you can see that I need to call a bash script, not a CMake compilation and installation. I have been following the steps carefully and seeing the "eml" example, but I miss more info in the Tutorial.

raul.perula gravatar image raul.perula  ( 2015-06-11 03:21:24 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-05-19 11:17:07 -0500

ahendrix gravatar image

You'll need to release each package in your install.sh separately. You may want to declare dependencies between them by using the package.xml that you add.

The eml package is a reasonable example of a package that is released from a pre-packaged distribution: https://github.com/ros-gbp/eml-release

edit flag offensive delete link more

Comments

Thanks @ahendrix for your answer.

I saw the package.xml you referenced and I don't understand how it is downloaded and installed the 3rd party in your release pkg.

As you can see I have also some patches and a sh.

raul.perula gravatar image raul.perula  ( 2015-05-19 14:22:33 -0500 )edit

You should add a package.xml and apply your patches in the release repository, as described in the second option in the tutorial: http://wiki.ros.org/bloom/Tutorials/R...

ahendrix gravatar image ahendrix  ( 2015-05-19 22:42:54 -0500 )edit

Hi @ahendrix, and sorry about my late comment. I still do not understand so well that tutorial because I cannot see it without an example.

I have found another way to do what I want, but I am not sure if it is a good option. I refer to rdmanifest description. Could be this an option?

raul.perula gravatar image raul.perula  ( 2015-06-06 03:05:32 -0500 )edit

Is there anything unclear about the example repository I linked to? I don't think using an rdmanifest will allow you to release your package.

ahendrix gravatar image ahendrix  ( 2015-06-07 23:54:54 -0500 )edit

Ok, I am trying to follow step by step the bloom tutorial. I thought I had it, but in step 2.4 after the Note comment. Continue next...

raul.perula gravatar image raul.perula  ( 2015-06-10 04:00:34 -0500 )edit

If I compare the content of my release/hydro/maggie_labjack_drivers and your /release/hydro/eml, I observe that your content is directly your 3rd party, however, my content is the same of my package. I thought that I should add the 3rd party content there, it means, there should be empty?

raul.perula gravatar image raul.perula  ( 2015-06-10 04:03:34 -0500 )edit

What do you have set as your upstream repository? For EML, I directly listed the tarball for the upstream package.

ahendrix gravatar image ahendrix  ( 2015-06-10 12:23:39 -0500 )edit

I do not know exactly what you mean, If you refer to the release track, the "Repository Name" is "maggie_drivers".

My repo organization looks like above (see "Edit 4").

raul.perula gravatar image raul.perula  ( 2015-06-11 03:10:47 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2015-05-11 10:59:28 -0500

Seen: 916 times

Last updated: Jul 06 '15