Difference between revisions of "Homebrew Mavericks"

From Wiki for iCub and Friends
Jump to: navigation, search
 
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This installation has been confirmed to work on OSX Mavericks with Homebrew.
+
'''The YARP section of the page is outdated. Up to date instructions for installing YARP on OS X can be found at''' http://wiki.icub.org/yarpdoc/install_yarp_mac.html
Latest update and testing: 18/07/2014 - using OS X 10.9.4 with or without Xcode 5.1.1
+
 
 +
This installation has been confirmed to work on OSX Mavericks and Yosemite with Homebrew.
 +
Latest update and testing: 21/10/2014 - using OS X 10.10 with or without Xcode 6.1
  
 
= Installing Xcode =
 
= Installing Xcode =
Line 11: Line 13:
 
   
 
   
 
'''If you do not see the option install Command Line Tools''',  run the following on a terminal
 
'''If you do not see the option install Command Line Tools''',  run the following on a terminal
   xcode-select —install
+
   xcode-select --install
  
 
Once this is done, you can now continue with the installation steps
 
Once this is done, you can now continue with the installation steps
Line 17: Line 19:
 
= Installing X11 =
 
= Installing X11 =
  
In OS X 10.8 Mountain Lion and later, X11 is not provided anymore. You need to install XQuartz, from [http://xquartz.macosforge.org/landing/ http://xquartz.macosforge.org/landing/].
+
In OS X 10.8 Mountain Lion and later, '''X11''' is not provided anymore. You need to install '''XQuartz''', from [http://xquartz.macosforge.org/landing/ http://xquartz.macosforge.org/landing/].
In earlier version of OS X, this is not stricly necessary, but recommended as XQuartz is more robust and updated that the system-provided X11.
+
In earlier versions of OS X, this is not strictly necessary but recommended as XQuartz is more robust and updated that the system-provided X11.
  
 
= Installing Homebrew =
 
= Installing Homebrew =
  
Before proceeding with the installation we recommend installing '''wget''' using curl (can also be done in Homebrew)
+
Installing homebrew with the following commands or visit the following site  [https://github.com/mxcl/homebrew/wiki/installation official installation steps]
 +
 
 +
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 +
 
 +
After the installation, you can run the following command to check if your setup is good :
 +
  brew doctor
 +
 
 +
If you had Homebrew already installed on your system, update and upgrade :
 +
  brew update
 +
  brew upgrade
 +
 
 +
Before proceeding with the installation we recommend installing '''wget''' using curl '''(can also be done in Homebrew with the following command: brew install wget)'''
 
   cd ~/Downloads
 
   cd ~/Downloads
 
   curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
 
   curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
Line 33: Line 46:
 
   sudo make install
 
   sudo make install
  
Installing homebrew ([http://mxcl.github.com/homebrew/ http://mxcl.github.com/homebrew/]) is very simple, just follow the [https://github.com/mxcl/homebrew/wiki/installation official installation steps].
+
= Installing Yarp =
 +
Up to date instructions for installing YARP on OS X can be found at''' http://wiki.icub.org/yarpdoc/install_yarp_mac.html.
 +
Remember to explicitly check out the latest YARP release according to the instructions in [[Software Versioning Table]].
  
After the installation, you can run the following command to check if your setup is good :
+
= Installing iCub =
  brew doctor
+
Here we provide information for installing the '''iCub''' dependencies via '''Homebrew''' and getting and compiling '''iCub''' from the repository.
 +
Install YARP dependencies 
 +
  brew install sdl sdl_gfx sdl_image
 +
  brew install ode --enable-double-precision --with-trimesh=gimpact
 +
Now gcc is needed to correctly install gfortran. Of course, there are other ways of installing gfortran but this is the easiest way to do it.
 +
  brew install gcc
  
If you had Homebrew already installed on your system, update and upgrade :
+
Download '''OPENCV''' @ http://opencv.org and set it properly, at the time of writing this documentation the latest version was '''opencv-2.4.9'''
  brew update
+
  cd $code
  brew upgrade
+
  wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
 +
  unzip opencv-2.4.9.zip
 +
  cd opencv-2.4.9.zip
 +
  mkdir build
 +
  cd build
 +
  ccmake ..
 +
  make
 +
Now you need to set the '''environmental variables''':
 +
  cd ~
 +
  open -a TextEdit .bash_profile
 +
  and copy the following lines:
 +
export OpenCV_DIR=/Users/your_user_name/Dev/opencv-2.4.9/build
  
= Installing Yarp =
+
Download and setup '''IPOPT''' at the time of writing of this documentation the latest version tested was '''Ipopt-3.12.1'''
 +
  cd $code
 +
  wget http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.zip
 +
  unzip Ipopt-3.12.1.zip
 +
Create a build directory
 +
cd $code
 +
cd Ipopt-3.12.1
 +
mkdir build
  
Here we provide information for installing the '''YARP''' dependencies via '''Homebrew''' and getting and compiling '''YARP''' from the repository.
+
Now you need to set the '''environmental variables''':
Install YARP dependencies
 
  brew install `brew deps --1 yarp | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'`
 
and the following for yarpbuilder
 
  brew install goocanvas
 
Now you would need to configure pkg-config
 
Add this to the .bash_profile in order to correctly do this:
 
 
   cd ~
 
   cd ~
 
   open -a TextEdit .bash_profile
 
   open -a TextEdit .bash_profile
and copy the following line:
+
and copy the following lines:
   export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig/:$PKG_CONFIG_PATH
+
   export IPOPT_DWN_DIR=/Users/your_user_name/Dev/Ipopt-3.12.1
 +
  export IPOPT_DIR=/Users/your_user_name/Dev/Ipopt-3.12.1/build
  
Programs that require this GDK PIXBUF need to set the environment variable correctly. Just to be on the safe side add this to the .bash_profile
+
To refresh and load these environment settings type:
  export GDK_PIXBUF_MODULEDIR="/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders"
+
  source ~/.bash_profile  
  
In the directory where you would like to store your code, e.g. /Users/your_user_name/Dev/ run the following
+
open a new terminal and:
   git clone YARP @ https://github.com/robotology/yarp.git
+
  cd $IPOPT_DWN_DIR/ThirdParty/Blas && ./get.Blas
Compile YARP :
+
  cd $IPOPT_DWN_DIR/ThirdParty/Lapack && ./get.Lapack
   cd yarp
+
  cd $IPOPT_DWN_DIR/ThirdParty/Mumps && ./get.Mumps
 +
  cd $IPOPT_DWN_DIR/ThirdParty/Metis && ./get.Metis
 +
  cd $IPOPT_DWN_DIR/ThirdParty/ASL && ./get.ASL
 +
  cd $IPOPT_DIR && $IPOPT_DWN_DIR/configure --prefix=/usr/local
 +
  cd $IPOPT_DIR 
 +
  make
 +
  make test
 +
if the tests have passed then
 +
  sudo make install
 +
In the directory where you would like to store your code, e.g. /Users/your_user_name/Dev/ run the following to clone YARP on your system:
 +
   git clone https://github.com/robotology/icub-main.git
 +
Check out the correct tag as described in [[Software Versioning Table]]:
 +
   cd icub-main
 +
  git checkout <tag>
 +
Compile iCub:
 
   mkdir build
 
   mkdir build
 
   cd build
 
   cd build
 
   ccmake ..
 
   ccmake ..
 +
Enable the following flags
 +
  ENABLE_icubmod_cartesiancontrollerclient
 +
  ENABLE_icubmod_cartesiancontrollerserver
 +
  ENABLE_icubmod_gazecontrollerclient
 
configure it correctly and  
 
configure it correctly and  
 
   make  
 
   make  
 
In order to generate and Xcode project do the following  
 
In order to generate and Xcode project do the following  
   cd yarp
+
   cd icub-main
 
   mkdir build
 
   mkdir build
 
   cd build
 
   cd build
 
   ccmake .. -G Xcode
 
   ccmake .. -G Xcode
This will generate a YARP.xcodeproj file which can be opened with Xcode.  
+
Enable the following flags
 +
  ENABLE_icubmod_cartesiancontrollerclient
 +
  ENABLE_icubmod_cartesiancontrollerserver
 +
  ENABLE_icubmod_gazecontrollerclient
 +
This will generate a ICUB.xcodeproj file which can be opened with Xcode.  
  
 
Build it by clicking Product -> Build or cmd+B shortcut
 
Build it by clicking Product -> Build or cmd+B shortcut
 
Then create the Release binaries by clicking Product -> Archive
 
  
 
Now you need to set the environmental variables:
 
Now you need to set the environmental variables:
Line 83: Line 136:
 
   open -a TextEdit .bash_profile
 
   open -a TextEdit .bash_profile
 
and copy the following lines:
 
and copy the following lines:
   export code=/Users/your_user_name/Dev
+
   export ICUB_ROOT=/Users/your_user_name/Dev/icub-main
  export YARP_ROOT=/Users/your_user_name/Dev/yarp
+
   export ICUB_DIR=/Users/your_user_name/Dev/icub-main/build
   export YARP_DIR=/Users/your_user_name/Dev/yarp/build
+
   export PATH=$ICUB_DIR/bin/Debug:$PATH
   export PATH=$YARP_DIR/bin/Release:$PATH
 
  
 
Notice that if you used the terminal version without Xcode the last line becomes:
 
Notice that if you used the terminal version without Xcode the last line becomes:
   export PATH=$YARP_DIR/bin:$PATH
+
   export PATH=$ICUB_DIR/bin:$PATH
Now setup YARP_DATA_DIRS by adding this to the .bash_profile
 
  export YARP_DATA_DIRS=/Users/your_user_name/Dev/yarp/build/share/yarp:/Users/your_user_name/Dev/icub-main/build/share/iCub:$ICUBcontrib_DIR/share/ICUBcontrib/
 
 
 
Now to quickly test the system run this in a terminal
 
  yarp
 
and you should get something like
 
  This is the YARP network companion.
 
  Call with the argument "help" to see a list of ways to use this program.
 
 
 
= Installing Yarp Bindings=
 
To correctly install the YARP bindings you will need '''swig'''
 
  brew install swig
 
  
Once YARP is correctly installed you can now proceed with the '''iCub''' installation
+
To refresh and load these environment settings type:
= Installing iCub =
+
  source ~/.bash_profile
Here we provide information for installing the '''iCub''' dependencies via '''Homebrew''' and getting and compiling '''iCub''' from the repository.
 
Install YARP dependencies  
 
  brew install sdl sdl_gfx sdl_image
 
  brew install ode --enable-double-precision
 
  brew install --with-qt3support qt
 
Now gcc is needed to correctly install gfortran. Of course there are other ways of installing gfortran but this is the easiest way to do it.
 
  brew install gcc
 
  
Download '''OPENCV''' @ http://opencv.org and set it properly, at the time of writing this documentation the latest version was '''opencv-2.4.9'''
+
You should now be ready to run any code from the iCub repository.
  cd $code
 
  wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
 
  unzip opencv-2.4.9.zip
 
  cd opencv-2.4.9.zip
 
  mkdir build
 
  cd build
 
  ccmake ..
 
  make
 
Now you need to set the environmental variables:
 
  cd ~
 
  open -a TextEdit .bash_profile
 
  and copy the following lines:
 
export OpenCV_DIR=/Users/your_user_name/Dev/opencv-2.4.9/build
 

Latest revision as of 09:41, 29 September 2019

The YARP section of the page is outdated. Up to date instructions for installing YARP on OS X can be found at http://wiki.icub.org/yarpdoc/install_yarp_mac.html

This installation has been confirmed to work on OSX Mavericks and Yosemite with Homebrew. Latest update and testing: 21/10/2014 - using OS X 10.10 with or without Xcode 6.1

Installing Xcode

To compile anything on OS X (including YARP), you'll need to have Xcode (http://developer.apple.com/xcode/) installed. This can be done through the App Store. Once installed, you need to install Command Line Tools.

To do this, open XCode, go to XCode->Preferences->Downloads and install Command Line Tools.

If you do not see the option install Command Line Tools, run the following on a terminal

 xcode-select --install

Once this is done, you can now continue with the installation steps

Installing X11

In OS X 10.8 Mountain Lion and later, X11 is not provided anymore. You need to install XQuartz, from http://xquartz.macosforge.org/landing/. In earlier versions of OS X, this is not strictly necessary but recommended as XQuartz is more robust and updated that the system-provided X11.

Installing Homebrew

Installing homebrew with the following commands or visit the following site official installation steps

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After the installation, you can run the following command to check if your setup is good :

  brew doctor

If you had Homebrew already installed on your system, update and upgrade :

  brew update
  brew upgrade

Before proceeding with the installation we recommend installing wget using curl (can also be done in Homebrew with the following command: brew install wget)

 cd ~/Downloads
 curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
 tar -zxvf wget-1.15.tar.gz
 cd wget-1.15/
 ./configure

if you get a error configuring: error: --with-ssl was given, but GNUTLS is not available, use the following command.

 ./configure --with-ssl=openssl
 make
 sudo make install

Installing Yarp

Up to date instructions for installing YARP on OS X can be found at http://wiki.icub.org/yarpdoc/install_yarp_mac.html.
Remember to explicitly check out the latest YARP release according to the instructions in Software Versioning Table.

Installing iCub

Here we provide information for installing the iCub dependencies via Homebrew and getting and compiling iCub from the repository. Install YARP dependencies

 brew install sdl sdl_gfx sdl_image
 brew install ode --enable-double-precision --with-trimesh=gimpact

Now gcc is needed to correctly install gfortran. Of course, there are other ways of installing gfortran but this is the easiest way to do it.

 brew install gcc

Download OPENCV @ http://opencv.org and set it properly, at the time of writing this documentation the latest version was opencv-2.4.9

 cd $code
 wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
 unzip opencv-2.4.9.zip 
 cd opencv-2.4.9.zip 
 mkdir build
 cd build
 ccmake ..
 make 

Now you need to set the environmental variables:

 cd ~
 open -a TextEdit .bash_profile
 and copy the following lines:

export OpenCV_DIR=/Users/your_user_name/Dev/opencv-2.4.9/build

Download and setup IPOPT at the time of writing of this documentation the latest version tested was Ipopt-3.12.1

 cd $code
 wget http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.zip
 unzip Ipopt-3.12.1.zip

Create a build directory

cd $code
cd Ipopt-3.12.1
mkdir build

Now you need to set the environmental variables:

 cd ~
 open -a TextEdit .bash_profile

and copy the following lines:

 export IPOPT_DWN_DIR=/Users/your_user_name/Dev/Ipopt-3.12.1
 export IPOPT_DIR=/Users/your_user_name/Dev/Ipopt-3.12.1/build

To refresh and load these environment settings type:

source ~/.bash_profile 

open a new terminal and:

 cd $IPOPT_DWN_DIR/ThirdParty/Blas && ./get.Blas
 cd $IPOPT_DWN_DIR/ThirdParty/Lapack && ./get.Lapack
 cd $IPOPT_DWN_DIR/ThirdParty/Mumps && ./get.Mumps
 cd $IPOPT_DWN_DIR/ThirdParty/Metis && ./get.Metis
 cd $IPOPT_DWN_DIR/ThirdParty/ASL && ./get.ASL
 cd $IPOPT_DIR && $IPOPT_DWN_DIR/configure --prefix=/usr/local
 cd $IPOPT_DIR  
 make 
 make test

if the tests have passed then

 sudo make install

In the directory where you would like to store your code, e.g. /Users/your_user_name/Dev/ run the following to clone YARP on your system:

 git clone https://github.com/robotology/icub-main.git

Check out the correct tag as described in Software Versioning Table:

 cd icub-main
 git checkout <tag> 

Compile iCub:

 mkdir build
 cd build
 ccmake ..

Enable the following flags

 ENABLE_icubmod_cartesiancontrollerclient
 ENABLE_icubmod_cartesiancontrollerserver
 ENABLE_icubmod_gazecontrollerclient

configure it correctly and

 make 

In order to generate and Xcode project do the following

 cd icub-main
 mkdir build
 cd build
 ccmake .. -G Xcode

Enable the following flags

 ENABLE_icubmod_cartesiancontrollerclient
 ENABLE_icubmod_cartesiancontrollerserver
 ENABLE_icubmod_gazecontrollerclient

This will generate a ICUB.xcodeproj file which can be opened with Xcode.

Build it by clicking Product -> Build or cmd+B shortcut

Now you need to set the environmental variables:

 cd ~
 open -a TextEdit .bash_profile

and copy the following lines:

 export ICUB_ROOT=/Users/your_user_name/Dev/icub-main
 export ICUB_DIR=/Users/your_user_name/Dev/icub-main/build
 export PATH=$ICUB_DIR/bin/Debug:$PATH

Notice that if you used the terminal version without Xcode the last line becomes:

 export PATH=$ICUB_DIR/bin:$PATH

To refresh and load these environment settings type:

source ~/.bash_profile 

You should now be ready to run any code from the iCub repository.