0
$\begingroup$

Rosanswers logo

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.


Originally posted by raul.perula on ROS Answers with karma: 71 on 2015-05-11

Post score: 0


Original comments

Comment by William on 2015-05-11:
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.

Comment by raul.perula on 2015-05-12:
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.

Comment by ahendrix on 2015-05-12:
Yes, "Releasing a Third Party Package (with bloom)" is the tutorial you should be following.

Comment by raul.perula on 2015-05-14:
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.

Comment by raul.perula on 2015-05-19:
Nobody can help me with this? Or at least give me a reference to a project which use something similar?

Comment by William on 2015-06-10:
@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?

Comment by raul.perula on 2015-06-11:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by ahendrix with karma: 47576 on 2015-05-19

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by raul.perula on 2015-05-19:
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.

Comment by ahendrix on 2015-05-19:
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/ReleaseThirdParty#Modifying_the_Release_Repository

Comment by raul.perula on 2015-06-06:
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?

Comment by ahendrix on 2015-06-07:
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.

Comment by raul.perula on 2015-06-10:
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...

Comment by raul.perula on 2015-06-10:
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?

Comment by ahendrix on 2015-06-10:
What do you have set as your upstream repository? For EML, I directly listed the tarball for the upstream package.

Comment by raul.perula on 2015-06-11:
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").

Comment by raul.perula on 2015-06-11:
Could you show me a pkg which use the eml? Because I would like to see the content of the package.xml for the deps. Thanks.

Comment by ahendrix on 2015-06-11:
You should create a separate release package for each of your dependencies, one for each upstream tarball or zip file that you build and install. You SHOULD NOT set the upstream URL to your existing repository or try to call your existing bash script.

Comment by raul.perula on 2015-06-16:
Hi @ahendrix, I think I am not explaining very well my situation and you are not understanding me. I have tried to explain better my case in my question. Could you revise again and tell me if the solutions you propose have sense. Thanks.

Comment by ahendrix on 2015-06-16:
I understand your situation. You need to change the structure of your packages to support the release process. You cannot use your install script. You need to create separate release repositories for each third-party package that you depend on.

Comment by raul.perula on 2015-06-16:
@ahendrix ok, I understand that I have to create separate releases. But if I don't use my install scripts, how are the 3rd parties installed?

Comment by William on 2015-06-16:
@raul.perula you can probably use your scripts, but you'll need to wrap them in CMake like you described above. Though you might want to use a CMake "custom command", instead of execute_process so that the installation happens when make is run and not when cmake is run. Both should work though

Comment by raul.perula on 2015-06-26:
@William sorry about my late comment. I have a question then. If I have to do same as I have right now, a CMake with an execute_process but in a release pkg. Why is it not working with my current configuration? I ask because of the failure on the jenking job with headers.

Comment by William on 2015-06-26:
It should work, my guess is that you're not installing that header for some reason or you're not installing it to the right place. You'd have to point me to your release repository.

Comment by William on 2015-06-26:
This probably isn't the issue with the Jenkins job you linked to, but you should install things to the CMAKE_INSTALL_PREFIX, to avoid collisions between ROS versions. Here it is hard:

Comment by William on 2015-06-26:
https://github.com/UC3MSocialRobots/maggie_drivers/blob/hydro-devel/maggie_ir_drivers/third_parties/IRTrans_shlib/install.bash#L11

Comment by raul.perula on 2015-07-06:
@William in this 3rd party there is no hard path. So, I think the execute_process command isn't being executed when the release is installed. Could be?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.