-
Notifications
You must be signed in to change notification settings - Fork 16
Building robogen simulator on Mac
Here is some feedback for installing the software on my mac (I use a macbook on OS X Mountain Lion 10.8.3). I cannot guarantee that this will work the same way for everyone but I hope it helps.
First step: install cmake and dependencies.
Instead of doing everything by hand, I used a package manager. I choosed brew (http://mxcl.github.com/homebrew/index.html) but I guess it's also possible with macport or fink. So:
- Install brew:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
- Read some help:
brew help
- Check if things are ok (and fix it, or not):
brew doctor
Ok now our package manager is ready to run, let's install things:
- Cmake:
brew install cmake
- zLib is already install and mac OS
- libpng:
brew install libpng
- Boost:
brew install boost
- Google protobuf:
brew install protobuf
- OpenSceneGraph (can take quite a long time):
brew install open-scene-graph
- ODE (don't forget double precision argument):
brew install ode --enable-double-precision
One last big thing is gcc. My version of gcc was 4.2.1 (run gcc -v to check) as it was installed trough Xcode's command line tools. This is not certain but, I had some issue compiling the simulator project and updating my gcc solve some of them. Also at least gcc 4.7 is needed to compile ParadisEO, a dependency of robogen-ea. Thus to update my gcc I used: https://sites.google.com/site/dwhipp/tutorials/mac_compilers
For my case (Mountain Lion, other version please check instructions on website):
- Get the archive (might take some time):
curl -L -O http://sourceforge.net/projects/hpc/files/hpc/gcc/gcc-mlion.tar.gz
- Open the file:
gunzip gcc-mlion.tar.gz
- Install (copy to your /usr/local/ folder):
sudo tar xvf gcc-mlion.tar -C /
- And make it default (note that they use .bashrc in the instructions but that didn't worked for me):
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
- You can now cleanup:
rm gcc-mlion.tar
You can check that you have gcc 4.8 by running gcc -v
.
Our library and compiler should be correctly installed and linked in /usr/local/. Let's start with the simulator.
- If you haven't done it yet, move to the folder where you want to install have the code:
cd /path/to/dir/
- And clone the repo locally (you may have to enter your login/pass):
git clone https://github.com/amaesani/robogen-simulator.git
- You may want to check the CustomPath.cmake for the path to utils:
open src/cmake/CustomPath.cmake
I have (line 5): set(UTILS_PATH "/usr/local")
- Then we need to create a folder to build (I called it simu):
mkdir simu && cd simu
- Now we are ready to compile (and don't forget to specify to cmake to use gcc):
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/bin/gcc ../src/
make -j4
You may see a lot of warnings outputs, don't worry too much, just check if you have "[100%] Built ..." at the end.
We are now ready to test, with robogen-file-viewer
- Don't forget to copy locally the models:
cp -r ../models/ models/
- Fetch the files for the example:
cp ../examples/r1.txt ../examples/conf.txt ../examples/obstacles.txt ../examples/startPos.txt .
- Run the file viewer (you should have a window poping with a 3d view):
./robogen-file-viewer r1.txt conf.txt
- And do some cleanup when you're done:
rm r1.txt conf.txt startPos.txt obstacles.txt
Hopefully you've been able to build the simulator on your mac and you're now able to move forward with the project. Please don't hesitate to improve this little help page, but you should open an issue if there are things not working on your side.