MJC

From Wiki for iCub and Friends
Jump to: navigation, search

Mike Ciaraldi's Software Odyssey

Introduction

This is my first time working with the iCub, so I am trying to install the software on my laptop before I get to Italy. This page documents my adventure. I hope it will be helpful to other iCub newbies. Feel free to add comments, suggestions, and especially corrections.

Maybe I should call this page "VVV11: A Software Odyssey". :-)

Mike Ciaraldi, WPI Computer Science / Robotics Engineering, ciaraldi <at> wpi.edu

Platform

My laptop is a brand-new Lenovo Thinkpad T420s, equipped with an Intel i7-2620 processor, 8 GB RAM, and 160 GB SSD. The display is 1600x900, driven by switchable graphics hardware: Intel 3100 integrated hardware graphics and Nvidia NVS discrete graphics. System is dual-boot:

  • Windows 7 Enterprise 64-bit with Visual Studio 2010.
  • Fedora 15 Linux 64-bit with all the standard GNU development tools. Display in Linux is currently limited to 1024x768 pending driver updates.

Linux Software Installation

Preliminary Software Installation

I started by following the instructions for installing for Linux: PrepareLinux Here are my experiences.

  • Whenever I have to download something, I create a directory for it in my home directory, under a directory I call "installs". Then I unpack the downloaded file, which typically creates a new directory. Then I go into a separate window where I am logged in as root and move that new directory into /usr/local/src. Then I do whatever is needed to compile and install the new package. I am the only one using this machine, but I want things accessible to any future users.
  • I had no trouble installing cmake using the standard System Tools->Add/Remove Software menu; this invokes Yum.
  • There is no precompiled version of ACE for Fedora, so I had to compile from source, downloaded from Vanderbilt University. I used the instructions for a "traditional" installation. The first time, I downloaded the "Complete ACE" file with the .zip extension and unpacked it. I got some errors during compilation. The first was fairly easy to fix: one of the shell scripts had DOS style line ending characters, so the shell complained that it could not find the program "/bin/sh^M". I used the dos2unix utility to strip out the offending CR characters. But then other errors showed up that seemed to indicate that the files were corrupted. So I downloaded the file with the .tar.gz extension and unpacked that; that one compiled and installed with no problem (after carefully following the instructions to create various header files). The instructions suggest adding several commands to the bash configuration to set up some environment variables; I did this by putting them in a file I called ace.sh in directory /etc/profile.d .
  • I was able to install GTKMM and QT through Yum with no problem.
  • I was able to install GSL through Yum with no problem.
  • For OpenCV, Yum only showed the cv library, not highgui or cvaux. So I downloaded the source for OpenCV, then compiled and installed it. I assume it is OK now.
  • I tried to install the optional Ipopt package. When I first tried to do that, I realized (and the instructions warned me) that I needed to first download and install HSL (formerly the Harwell Subroutine Library). HSL is a commercial product which is free for academic use, and earlier versions are free for any use. However, to download HSL you must first register and wait for a manually-generated password to arrive by email. That can take several business days. I submitted my request on Saturday, July 9, and received a download link (good for 7 days or 3 uses) on Tuesday, July 12. In the meantime I installed gfortran through Yum without error, and moved to the next package.
  • I downloaded and installed ODE successfully as far as I can tell. However...
    • The instructions say to run "make" but do not mention doing "make install". I did both.
    • I could not find libglut3 but Yum found freeglut; I will see if that works.
  • SDL seems to have installed OK via Yum.
  • The iCub simulator is mentioned here in the instructions, but it says that YARP needs to be installed first, so I decided to wait. When I compiled the iCub software, the simulator supposedly was included.
  • I came back on Tuesday, July 12 to finish Ipopt. First I had to download MA57 from HSL. I did that and could not compile it at first. It turns out that the code uses a few Fortran 95 constructs (such as initializing multiple elements of an array in one statement), so I had to go into the Makefile; I changed the compiler from "g77" to "gcc" added "-std=f95" to the compiler flags.
  • Before I could compile Ipopt I had to run configure. This complained that it could not find the MA57 code in the Extern directory. So I merged all the .f files from the HSL MA57 directory into a single file called ma57ad.f and put it into that directory.
  • Then I went to compile Ipopt and had a lot of fatal errors due to type conversions that were not cast (the errors might only have shown up on my system because it is running 64-bit software). I fixed each of them. Then I had to solve one final problem. The tar file contains a necessary file called ipoma.f, but doing a "make clean" on Ipopt deletes it! I put a fresh copy into the Apps/CUTErInterface directory and now Ipopt compiles without error.

YARP and iCub Installation

  • Now I am ready to actually try installing the YARP and iCub software.
  • I went back to Manual and started following the instructions in Chapter 6.
  • I used svn (Subversion) to retrieve both packages from the repository.
  • I started to set up the environment variables and was not sure about something. It says that the _DIR variables must "point to the location where you installed or built the binaries." Since I am compiling from source, I am setting them to the subdirectories under /usr/local/src, which is where I build the packages. Should that be separate from where I install? Later, in the compile instructions it tells how to change the install directory. Anyway, I set YARP_ROOT to /usr/local/src/yarp2 and both YARP_DIR and YARP_CONF to ${YARP_ROOT}/build. I set these environment variables by creating new files in /etc/profile.d; then I had to open a new window to get a fresh copy of the shell with these variables set.
  • OK, now I was now about to compile. I went into the $YARP_DIR directory (/usr/local/src/yarp2/build) and ran "ccmake $YARP_ROOT". This created a Makefile one level higher in the hierarchy, namely at $YARP_ROOT. The instructions then say to stay in $YARP_DIR and run "make", but that doesn't work, because the Makefile is up in $YARP_ROOT. So I went there and ran make; that ran without error.
  • I then did "make install" and it copied the programs into /usr/local/bin, which is already in my PATH. I created a yarp.conf file and ran yarpserver. It couldn't find the ACE library, but the instructions already had a warning about that. So I went back into ccmake and set INSTALL_WITH_RPATH=ON, then hit "c" followed by "g" to save and exit. I went back up one level, did a "make clean" followed by a "make", and then "make install". Then I ran yarpserver without a problem. I pointed my Web browser at 127.0.0.1:10000 and the YARP server responded. Yay!
  • I then followed the instruction for compiling iCub. I used ccmake to set ICUB_INSTALL_WITH_RPATH=ON, then generated. This time the Makefile was in my build directory. I did a "make", then "make install", then "make install_applications". No errors.
  • I went back and tried to compile and install the iCub simulator. So far no success. The first problem was that the compiler could not find any of the SDL header files. They are in the directory /usr/include/SDL, but the Makefile is not telling the compiler to look there. I looked in CMakeLists.txt and it looked to me like it was looking for a variable called SDL_INCLUDE_DIR; I tried setting that in the environment, but it did not get into the Makefile. Unfortunately, I don't know enough about cmake to see what is happening. I worked around it by changing the source code in the simulator by changing, for example, "#include <SDL.h>" to "#include <SDL/SDL.h>". I had a link problem, but it seems to be gone now.

Linux Re-Installation

  • Because the current Fedora video driver did not support the full resolution of my video screen, I re-installed using a distribution called Aptosid, which is Debian-based. Note that the alpha release of Fedora 16 does support Intel Sandy Bridge graphics.
  • Everything went pretty smoothly. Being able to use the pre-compiled Debian packages made the process go much more quickly. The only problem I had is that libGLU.so is not in /lib64, where the iCub build expects it, but in /usr/lib/x86_64-linux-gnu/, so I created symbolic links from the required location to the real location.
  • All done!

Microsoft Windows 7 Software Installation

I will not be attempting this unless absolutely necessary.

Return to FAQ