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
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.
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)
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.
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:
(If you don't need the nogui version you don't need to edit it)
# 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
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.
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
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/ cmake -DWITH_STATIC_LIB=ON .. make -j2
Now you can build retroshare-nogui:
cd ~/retroshare/rsctrl/src && make -j2 cd ~/retroshare/retroshare-nogui/src && qmake && make clean && make -j2
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
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.
VoipYou will find this plugin in
Call qmake and make
Note: The qtmobility development library is needed on Debian.
In version 0.6.*, there are some additional requirements:
sudo apt-get install libopencv-dev sudo apt-get install build-essential checkinstall cmake pkg-config yasm sudo apt-get install libtiff4-dev libjpeg-dev libjasper-dev
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.
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 # if different ).
tar -xvf OpenCV-2.4.0.tar.bz2 cd OpenCV-2.4.0/ mkdir build cd build cmake -D WITH_QT=ON -D WITH_XINE=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D BUILD_EXAMPLES=ON ..
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
make 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:
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 qmake make clean make 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:
qmake make clean make
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.
1. Run RetroShare in a special way by
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.
If the problem is that your retroshare/freezes hangs (due to a deadlock), you might want to:
ps aux | morefind the pid [Process Id], then launch
gdband then type in atthe gdb prompt/command line
attach [pid] handle SIGPIPE nostop noprint run
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.
Note - needs to be added.