The following instructions have been compiled and tested for Slackware 13.1 & 13.37 using both CTurtle and Diamondback.
Due to its simple vanilla-linux setup and highly customizable design Slackware is a great distribution to pair with ROS when building a custom robot. Unfortunately, it will require a little more setup work from the end-user due to the lack of a proper package-management system. ROS assumes we have multiple non-standard packages installed already, many which Slackware does not currently include. These instructions should help you get past the major initial hurdles. After completing these steps you should be able to run through the ROS/Tutorials without any compile or run-time errors.
SVN Based Install (download-and-compile)
- install mercurial? (need some details on this new step for diamondback)
Get super-user access. You will need your system administrator to give you sudo access. If you can login as root yourself you can add sudo access to your account by running:
echo 'your_username ALL=(ALL) ALL' >> /etc/sudoers
- Install libyaml from source
cd /opt sudo wget http://pyyaml.org/download/libyaml/yaml-0.1.3.tar.gz sudo tar -xzf yaml-0.1.3.tar.gz cd ./yaml-0.1.3 && sudo ./configure && sudo make && sudo make install
You can now sudo rm /opt/yaml-0.1.3.tar.gz if you want to.
- Build and install python-setuptools from source:
cd /opt sudo wget http://slackbuilds.org/slackbuilds/13.1/development/pysetuptools.tar.gz sudo tar -xzf pysetuptools.tar.gz cd pysetuptools sudo wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz sudo chmod +x pysetuptools.SlackBuild sudo ./pysetuptools.SlackBuild
The output you see from building should end with something like: Slackware package /tmp/pysetuptools-0.6c11-i486-1_SBo.tgz created. Now create a directory where you will keep your compiled packages, and move this created package there for safekeeping and install it:
sudo mkdir /opt/installed_tgz sudo mv /tmp/pysetuptools-0.6c11-i486-1_SBo.tgz /opt/installed_tgz/ sudo /sbin/installpkg /opt/installed_tgz/pysetuptools-0.6c11-i486-1_SBo.tgz
You can now sudo rm -rf /opt/pysetuptools and the tar.gz file if you want to.
- Build and install logcxx from source:
cd /opt sudo wget http://www.gtlib.gatech.edu/pub/apache//logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz sudo tar -xzf apache-log4cxx-0.10.0.tar.gz cd apache-log4cxx-0.10.0
Unfortunately there are some issues currently between logcxx and the most recent version of gcc that Slackware uses. We will need to modify the logcxx code as follows.
First download the following two patch files to your log4cxx directory and apply them by issuing these commands:
sudo wget https://issues.apache.org/jira/secure/attachment/12439514/exampleFolder_stringInclude.patch --no-check-certificate sudo wget https://issues.apache.org/jira/secure/attachment/12439513/cppFolder_stringInclude.patch --no-check-certificate sudo patch -p1 -i cppFolder_stringInclude.patch sudo patch -p1 -i exampleFolder_stringInclude.patch
Now you will need to prepend one line that the makers of log4cxx forgot to include in one of the example header files. Do this with the little trick below, or just use your text editor:
sudo touch console_temp.cpp && sudo chmod 777 console_temp.cpp && echo "#include <stdio.h>" | sudo tac src/examples/cpp/console.cpp - | sudo tac > console_temp.cpp && sudo mv console_temp.cpp src/examples/cpp/console.cpp
Now, finally we can build and install log4cxx:
sudo ./configure --prefix=/usr sudo make sudo make install
You can now rm the .tar.gz file we downloaded if you want to.
- easyinstall pyyaml
sudo easy_install pyyaml
Build and install wxWidgets (Optional). Many of the ROS graphical tools (turtlesim,rviz,gazebo,pr2_dashboard) assume you have a working installation of wxWidgets. In order to compile and use these tools build and install wxWidgets as follows:
cd /opt sudo wget http://slackbuilds.org/slackbuilds/13.1/libraries/wxPython.tar.gz sudo tar xvf wxPython.tar.gz cd wxPython sudo wget http://downloads.sourceforge.net/wxpython/wxPython-src-126.96.36.199.tar.bz2 sudo chmod +x wxPython.SlackBuild sudo ./wxPython.SlackBuild sudo mv /tmp/wxPython-188.8.131.52-i486-1_SBo.tgz /opt/installed_tgz/ sudo /sbin/installpkg /opt/installed_tgz/wxPython-184.108.40.206-i486-1_SBo.tgz
You can now sudo rm -rf /opt/wxPython and the .tar.gz file if you want to.
The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.
First install rosinstall:
sudo easy_install -U rosinstall
There are many different libraries and tools in ROS. We provided four default configurations to get you started.
Desktop-Full Install: (Recommended): ROS Full, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
rosinstall -n ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop-full&overlay=no"
Desktop Install: : ROS Full, rviz, and robot-generic libraries
rosinstall -n ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop&overlay=no"
ROS-Full: ROS package, build, communication, and graphical tools.
rosinstall -n ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-full&overlay=no"
ROS-Base: (Bare Bones) ROS package, build, and communication libraries.
rosinstall -n ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-base&overlay=no"
NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.
You'll now need to update your environment. You can do this by typing:
It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:
echo "source ~/ros/setup.bash" >> ~/.bashrc . ~/.bashrc
For Zsh users, change the last line of ~/ros/setup.zsh to
before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with
echo "source ~/ros/setup.zsh" >> ~/.zshrc . ~/.zshrc
Since rosdep cannnot detect the Slackware OS any rosmake commands will will throw dependency errors. You will need to build packages manually without dependencies using the --no-rosdep flag like in the example below. Compiling rostest and many other simple packages should work for you at this point:
rosmake --no-rosdep rostest
Now, to test your installation, please proceed to the ROS Tutorials.