This installation has been confirmed to work on macOS from 10.9 on with Homebrew.
To compile anything on macOS (including YARP), you'll need to have Xcode installed. This can be done through the App Store.
Once installed, you need to install the 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
Once this is done, you can now continue with the next installation steps.
Please install Homebrew using the following commands or visit and follow the official installation steps
After the installation, you can run the following command to check if your setup has been successful:
Once you have installed the prerequisites, you can now proceed to install YARP choosing between two options:
In any case, you have to update and upgrade your Homebrew version.
If you had Homebrew already installed on your system, update and upgrade:
Also, you will need to add the homebrew-science tap:
Run on your terminal:
The following options are also available:
After the installation, you will need to set your Environment variables configuration.
If the options above are not enough and you want to install YARP with additional options or in a difference location, you can compile it from source, directly from the repository. First install the dependencies, download the code from the repository and then proceed with the installation.
Here we provide information for installing the YARP dependencies via Homebrew. In order to install the YARP dependencies enter the following command in a terminal:
For compiling the required bindings (LUA, JAVA, PYTHON etc) you need swig
and the following for yarpbuilder:
For compiling the Qt5 GUIS:
Now, add the environmental variable for Qt5
and copy the following line
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:
In the directory where you would like to store your code, e.g. /Users/your_user_name/Dev/ run the following git command to clone YARP on your system
Now move into the source folder and create the build directory
You can now compile and install YARP with (at least) two different methods: GNU Makefile and Xcode. The former is simpler, while the latter creates an Xcode project which can come in handy if you wish to contribute to the YARP development.
If not stated differently (e.g. we are compiling YARP on a robot environment which can have different policies), we strongly suggest to install YARP after the compilation. Note that, by default, YARP is installed in /usr/local. We strongly suggest to change this folder to a non-system one.
In this case, you simply have to issue the cmake command
configure it correctly by enabling the following flags (simple solution):
and, if you want to install YARP, by changing the path pointed by the CMake variable
configure (press 'c' until all the * disappears) & generate ('g'), then:
If you want to install issue also a
(Note: if the install directory is a system directory you may need administrator privileges, e.g. you have to use sudo).
After the installation, you will need to set your Environment variables configuration.
In order to generate and Xcode project do the following:
As before, configure the project and the install directory:
This will generate a YARP.xcodeproj file which can be opened with Xcode. Build it by clicking Product -> Build or cmd+B shortcut. One can also compile the Release binaries by clicking Product -> Archive.
Alternatively, it is possible to directly compile the project on the command line by
If no options are specified the ALL_BUILD target is compiled in Debug configuration. In general the following command will build and install YARP in release mode:
After the installation, you will need to set your Environment variables configuration.
In order to follow the KISS principle we are using the native mac editor Textedit. Please feel free to use whichever tool/editor you prefer.
Add the YARP environment variable in
If the following command result in an error: The file .... does not exist, do the following first:
If you installed from Homebrew:
To refresh and load these environment settings type:
Now you can check if YARP has been properly installed by running a Quick YARP run test.
If you installed from source:
In the following we assume that YARP has been installed. In case you are using the build version, instead, the YARP_DIR path should point to the build directory.
Notice that if you did not install AND you used the Xcode version the last line becomes
Now setup YARP_DATA_DIRS by adding this to the .bash_profile:
To refresh and load these environment settings type:
Check if YARP has been properly installed by running a Quick YARP run test.
Now to quickly test the system run this in a terminal:
and you should get something like:
If this test run properly, you can proceed with the following link: Check your installation.