Ask Your Question
3

Is it possible to install ROS 32bit and a 64bit on the 64bit ubuntu?

asked 2013-08-16 00:54:32 -0500

Mfumbesi gravatar image

I have a third party 32 bit library that I want to encapsulate with a ROS node/application. The problem is that I am running Fuerte (64bit) on Ubuntu 12.04 LTS (also 64bit). The GNU C (or GCC) and Ubuntu 32bit libraries were easy to get (get-apt ia32xxx command line), but I am struggling to get the ROS fuerte 32bit libraries.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2013-08-16 10:20:14 -0500

mirzashah gravatar image

updated 2013-08-20 20:47:43 -0500

I was interested in this myself and could not find a straightforward way to allow 64 bit and 32 bit debs to coexist. The most common solutions you'll hear are:

1) Create a chroot enviroment, install all the 32 bit debs, and build/run from that chroot environment.

or

2) Utilize a virtual machine such as VirtualBox. There is a tool called "vagrant" that allows you to run headless VirtualBox instances from the command line.

Hope that helps!

Edit: Regarding your second comment

Yes, you cannot simply move binaries built against 32 bit libraries onto a machine with the 64 bit libraries installed. Yes, if the 32 bit versions of the libraries were installed, it would not be a problem. However, as I had stated earlier...it's not very easy to have both versions libraries installed side by side when using prepackaged debians.

The most common trick is to use a "chroot" environment. "chroot" stands for change root and allows you to turn some folder in your file system into a fake root that is jailed/sandboxed from the rest of the system. Using the "chroot" command, you can enter the jailed root environment. In there you can install 32 bit versions of all the debians you need. Checkout your code within the chroot environment, build it there, and most importantly...RUN IT FROM THERE.

The other option is using virtualization. You'll incur a little bit of overhead for your application, but it's negligible on modern processors.

Here's a great Ubuntu answer explaining chroot a little further: http://askubuntu.com/questions/29665/how-do-i-apt-get-a-32-bit-package-on-a-64-bit-installation

edit flag offensive delete link more

Comments

I used a second machine that has the 32bit fuerte ROS and built my application on it. When I try and run it on the 64bit uBuntu it complains about missing libraries.

Mfumbesi gravatar image Mfumbesi  ( 2013-08-19 20:00:41 -0500 )edit

Please move this to the comments section.

mirzashah gravatar image mirzashah  ( 2013-08-20 20:35:35 -0500 )edit

Finally bit the bullet and went with the chroot option. It is working now.

Mfumbesi gravatar image Mfumbesi  ( 2013-08-23 01:09:30 -0500 )edit

Glad to hear it! I find it frustrating that the file system hierarchy doesn't allow installing multiple architectures on the same machine...but it can make things a lot more complex. It has to do with the nature of FHS and dealing with way too much complexity for too little gain.

mirzashah gravatar image mirzashah  ( 2013-08-27 21:55:35 -0500 )edit
0

answered 2014-10-06 08:32:14 -0500

BennyRe gravatar image

I know this question is over a year old now but I want to add my solution for future users who also have to struggle with 32 bit libraries.

I added the -m32 compile and link flag to the target properties. Doing this my node gets compiled to 32 bit architecture. In order to communicate with the rest of the ROS system I have to provide the 32 bit ROS libraries by my own. These libraries also have to be linked explicitly and the ${catkin_LIBRARIES} have to be removed from the target_link_libraries function. I placed these libraries in a lib directory inside my package.

The remaining system dependencies can be installed with sudo apt-get install <dependency>:i386. For the ROS packages this did not work somehow.

My node runs without any problems in connection with other ROS nodes.

I don't feel that well with this solution but I can't force my 3rd party library vendor to publish 62 bit Linux libraries.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-08-16 00:54:32 -0500

Seen: 3,206 times

Last updated: Oct 06 '14