Although you can get Synergy through the package manager, it is an older version that may be incompatible with newer Synergy server versions. We are forced to compile Synergy ourselves to ensure that it is using the latest protocol and runs on Raspberry Pi's ARMv6 processor.
Download the source code tarball from Synergy's download page, it must be the .tar.gz file. Save it to /home/pi/downloads (make sure that folder exists first)
Alternatively, use wget through the terminal
cd /home/pi/downloads sudo wget http://synergy.googlecode.com/files/synergy-1.4.15-Source.tar.gz
Extract the tarball
sudo tar -xzf synergy-1.4.15-Source.tar.gz
Raspbian does not come with some of the tools you might need, use the APT package manager to install the required tools. The following command will take some time and eat up some disk space.
sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install gcc cmake libx11-dev libxtst-dev
Navigate into the source code directory
cd synergy-1.4.15-Source
Right now, what you should be doing is running cmake, which should generate a makefile. But at this point, cmake will fail with an error regarding not being able to find some header files. An error like "Missing header: X11/Xlib.hX11/XKBlib.h" might show up. This is because Synergy's CMakeList.txt file is looking for header files inside /usr/local/include , but in Raspbian, it should be looking inside /usr/include. We'll fix that by editing CMakeList.txt.
sudo nano CMakeLists.txt
Use the nano text editor to look for the line
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
and change it to
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/include")
and close nano, the hot-key for closing nano should be CTRL-X
It will ask you to save before closing, you must save it
It will ask you to save before closing, you must save it
Inside the directory synergy-1.4.15-Source/tools , there is a zip file called cryptopp562.zip containing the Crypto++ library, which you must extract into the directory synergy-1.4.15-Source/tools/cryptopp562 , if you don't do this, you will eventually run into an error looking for the files inside. Do this from the terminal
sudo unzip ./tools/cryptopp562.zip -d ./tools/cryptopp562
There's a bit of strangeness inside the synergy-1.4.15-Source/tools/CMakeList.txt file, it wants the C compiler to compile for the native architecture, but this will cause an error when the compiler doesn't understand what the word native means. We need to change this to ARMv6 since we are on a Raspberry Pi. Open the file using nano
sudo nano ./tools/CMakeLists.txt
Look for the line
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
and edit it to the following on a Pi 1
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv6zk")
for the Pi 2, do this instead:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv7-a")
and close nano, the hot-key for closing nano should be CTRL-X
It will ask you to save before closing, you must save it
It will ask you to save before closing, you must save it
We have now done all of the steps to preemptively prevent the errors you will face.
Now we can use cmake to configure our makefile build
Now we can use cmake to configure our makefile build
sudo cmake .
This will take a while... grab a coffee. After it finishes, it should say:
-- Configuring done -- Generating done -- Build files have been written to: /home/pi/download/synergy-1.4.15-Source
What it did was check over your system to see if you have all of the required files, and see what kind of tools are available. It uses this information to generate a makefile for you.
Now you can use make to build the source code according to the makefile
Now you can use make to build the source code according to the makefile
sudo make
This time, nuke some popcorn and watch a movie, this literally took a few hours. Nobody claimed that the 700MHz Raspberry Pi was very fast.
When it finishes with no errors, a new directory at synergy-1.4.15-Source/bin should exist, and inside should be several executables files. Install these by using the copy command to copy the files into the /usr/bin directory
When it finishes with no errors, a new directory at synergy-1.4.15-Source/bin should exist, and inside should be several executables files. Install these by using the copy command to copy the files into the /usr/bin directory
sudo cp -a ./bin/. /usr/bin
Page last edited December 09, 2013
Text editor powered by tinymce.