From RetroShare
Jump to: navigation, search

This documents how to compile the latest sources from Retroshare subversion repository on Linux.



First you need to install the packages needed for compiling RetroShare.


sudo apt-get install g++ make libgnome-keyring-dev libqt4-dev libxss-dev libssl-dev \
libupnp-dev subversion libbz2-dev libprotobuf-dev protobuf-compiler cmake \
libsqlite3-dev libspeex-dev libspeexdsp-dev libcurl4-openssl-dev libxslt1-dev 

If you just want to build retroshare-gui, you won't need "libprotobuf-dev", "protobuf-compiler", "cmake" and "libbz2-dev".

If you want to compile the VOIP plugin, you will need to also install qtmobility-dev as:

sudo apt-get install qtmobility-dev

Arch Linux

pacman -S pkg-config subversion openssl libupnp libgnome-keyring libxss qt4 protobuf cmake
  • bzip2 is in the "base" package, and thus should be installed already.
  • pkg-config is in "base-devel" and is likely to be installed, too. (Using the Raspberry-Pi-Arch-Image it seems to be necessary to install it.)
  • If you just want to build retroshare-gui, you won't need "protobuf" and "cmake".


NOTE: Building RPMs should NEVER be done with the root user. It should ALWAYS be done with an unprivileged user. Building RPMs as root might damage your system. You have been warned.

The build process is very similar to that for Debian/Ubuntu, except for:

  • package manager is called "yum"
  • if you just want retroshare-gui compiled, you do not need to download/install "protobuf" and "cmake"
  • Qt version >= 4.8
  • CentOS version = 6.5
sudo yum install rpm-build mod_dav_svn subversion openssl-devel libupnp-devel \
libgnome-keyring libXScrnSaver-devel qt4

NOTE: Please advise of any issues with this information via message.

Additional Dependencies

To build sqlcipher, you must have at least TCL 8.5 with the development files installed, as it is used by the Makefiles for generating code.


You will need sqlcipher library for encrypting the gxs local storage.

Usually you need to compile sqlcipher on your own but if your distro provides a prebuild version or a manual (AUR for Arch users) you can use this version, too. See Arch Linux (AUR)

Building sqlcipher

Using the same directory structure as above:

cd ~/lib/
git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher/
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
make -j2
sudo make install

If it doesn't work, try changing the linker flags to LDFLAGS="/usr/lib/libcrypto.a" (change the path to the location of "libcrypto.a" on your distribution).

Make a note of the directory where sqlcipher is installed and add the LIBDIR according to the directions given in the installation.

Arch Linux

There is a packet in the AUR you can use. The -git version seems not to work.
If you decide to use it you'll have to edit some files since the link to the self compiled version is hardcoded and an installed version will not be detected:

  • ~/retroshare/retroshare-gui/src/retroshare-gui.pro
  • ~/retroshare/retroshare-nogui/src/retroshare-nogui.pro

(If you don't need the nogui version you don't need to edit it)

Search for

# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a 

and replace it with

 LIBS += -lsqlcipher

If you prefer to use an explicit link, replace it with

LIBS += /usr/lib/libsqlcipher.so


Pegmarkdown is built as follows:

cd ~/retroshare/supportlibs/pegmarkdown
qmake && make clean && make -j2

Building Retroshare

Note: In the this section, you can use another directory instead of ~, too.

Note: The -j parameter to make is the number of cores used, and should be changed accordingly to fasten compilation.

Obtain latest retroshare sources from SVN

To obtain the current trunk version (0.6.*):

cd ~
svn co svn://svn.code.sf.net/p/retroshare/code/trunk retroshare

To obtain 0.5.* branch (which is not forward compatible with 0.6.*):

cd ~
svn checkout svn://svn.code.sf.net/p/retroshare/code/branches/v0.5.5/ retroshare05

You can keep the checked-out source code up-to-date by running

svn up

Now, continue with next step: Build



  • replace the "qmake" command with "qmake-qt4" on Arch Linux (and maybe other distros)
  • "make -j2" tells make to use two threads - if you have more/less CPU cores/threads feel free to change the value


Both GUI and NOGUI need these:

cd ~/retroshare/libbitdht/src && qmake && make clean && make -j2
cd ~/retroshare/openpgpsdk/src && qmake && make clean && make -j2
cd ~/retroshare/libretroshare/src && qmake && make clean && make -j2


cd ~/retroshare/retroshare-gui/src && qmake && make clean && make -j2


retroshare-nogui depends on the libssh library 0.5.4, which is used for the RPC via SSH protocol.

If your distribution already provides the current libssh version, you can install the libssh-dev package from your distribution. If your distribution does not have it, you need to download and build this library yourself:

cd ~
mkdir lib/ && cd lib/
wget https://red.libssh.org/attachments/download/41/libssh-0.5.4.tar.gz
tar zxvf libssh-0.5.4.tar.gz
cd libssh-0.5.4/
mkdir build/ && cd build/
make -j2

Now you can build retroshare-nogui:

cd ~/retroshare/rsctrl/src && make -j2
cd ~/retroshare/retroshare-nogui/src && qmake && make clean && make -j2 

You can check your libssh version provided for by your Linux System if it is provided or you need to build it.

Missing DSO on command line error

If when compiling the non-gui, you receive the following message:

//lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
/usr/bin/ld: ../../libretroshare/src/lib/libretroshare.a(rsthreads.o): undefined reference to symbol 'pthread_create@@GLIBC_2.1'
//lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

you will need to edit the Makefile created after running qmake (as shown above) and add the LDFLAGS to read as follows:

LFLAGS    =  [whatever options the qmake command puts in]
LDFLAGS   = -lpthread


Run retroshare-nogui


Run retroshare-gui


Additional Plugins

After compiling, you need to copy the *so* files produced to ~/.retroshare/extensions (version 0.5.*) or ~/.retroshare/extentions6 (version 0.6.*).

You will then need to restart RetroShare to enable the new plugins and make various settings changes, and then restart again.


You will find this plugin in

From 0.6.*, you will need to following:

sudo apt-get install libopencv-dev build-essential checkinstall cmake pkg-config yasm \
libtiff4-dev libjpeg-dev libjasper-dev qtmobility

You may need some or all of these packages to add video capturing/encoding capabilitys to the highgui module.

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev \
libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev

Note: on some systems libxine-dev is not available but is available in other formats eg libxine2-dev - use your package manager to check.

Packages needed to build the Python wrappers:

sudo apt-get install python-dev python-numpy

Install Intel TBB to enable parallel code in OpenCV.

sudo apt-get install libtbb-dev

Now Download OpenCV Open Source Computer Vision Library from http://sourceforge.net/projects/opencvlibrary/ Compile and Install ( adjust version number if different ).

tar -xvf OpenCV-2.4.10.tar.bz2
cd OpenCV-2.4.10/
mkdir build
cd build

Notice, that by adding the -D WITH_QT=ON, the highgui module will use QT instead of GTK. If you want to go with GTK just remove this. For more information on the options, look at the CMakeLists.txt file. When you are happy with the configuration you have, you can start/finish compiling the OpenCV

sudo make install

Finally, make sure that your programs can link to the OpenCV library in run-time by adding the following line at the end of your /etc/ld.so.conf:


And then configure the dynamic linker run-time bindings:

sudo ldconfig

Now with the successful compile of the OpenCV Library we can perform some quick tests using some examples in the source as well as possible small test additions.

Now for 0.6.*: (please note that the make clean is important to ensure a new compilation with all new components)

cd ~/retroshare/plugins/VOIP
make clean
cp libVOIP.so ~/.retroshare/extensions6

Reference for OpenCV

OpenCV Open Source Computer Vision Library http://sourceforge.net/projects/opencvlibrary/


You will find this plugin in


The enter the following:

make clean

What If I Have a Crash Or a Freeze?

The developers need your feedback. On Gnu/Linux, you can do this by building RetroShare using the latest trunk code as described elsewhere.

Crash Procedure

1. Run RetroShare in a special way by

gdb ./RetroShare

2. If and when it crashes, ask for a full stack trace

 bt trace full

saving the output, and making a forum post with the gdb output pasted or attached.

Freeze Procedure

If the problem is that your retroshare/freezes hangs (due to a deadlock), you might want to:


ps aux | more 
find the pid [Process Id], then launch
and then type in atthe gdb prompt/command line
attach [pid] handle SIGPIPE nostop noprint

replacing [pid] with the process id of RetroShare.

Then you can display all threads at once (necessary for detecting deadlocks) using:

thread apply all all where 

making sure you save the output, and then paste or attach to a forum post.

Read online about advanced gdb usage at https://sourceware.org/gdb/current/onlinedocs/gdb/index.html

If you want a gui for gdb try QtCreator. In QtCreator you don't have to remember line numbers to set breakpoints, you can set them with a single click.

Gnu/Linux Install After Building


cd ~/retroshare/build_scripts/Debian
sudo ./make.sh
sudo dpkg -i [the package you just made]

If you have issues with required packages missing:

tar zxvf retroshare.tgz
cd retroshare/DEBIAN
vim control

Now change the version numbers of the packages in the Depends: line to suit what you have installed on your system. For example, you make have libssl1.0.0 installed, so change libssl0.9.8 to libssl1.0.0. libupnp3 will also need changing to libupnp6.

Now, create an updated file:

cd ..
mv retroshare.tgz retroshsare.tgz.orig
tar czf retroshare.tgz retroshare

Now you need to rerun the the original make and install commands given previously.


Note - needs to be added.


You can create a rpm install package on Ubuntu computer as follows:

sudo alien -r --scripts Retroshare_Gui_0.6.0.r7577_ubuntu_i686.deb

Please note that some permissions and file ownership settings must be changed before installing.

Arch Linux

Note - needs to be added.

Personal tools

External websites