trying to compile for raspberrypi

Get help for specific problems
Gustutu
Posts: 4
Joined: 15 Mar 2019

Post by Gustutu • 15 Mar 2019, 12:34

Hello,

I'm trying to compile freefilesync for raspberrypi but get following error

~/Downloads/ffsync/FreeFileSync/Source $ make

mkdir -p /tmp/FreeFileSync_armv7l_Make/ffs/src/base/
g++ -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -DLIBSSH2_OPENSSL -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread `pkg-config --cflags openssl` `pkg-config --cflags libcurl` `pkg-config --cflags libssh2` `pkg-config --cflags gtk+-2.0` -isystem/usr/include/gtk-2.0 -c base/algorithm.cpp -o /tmp/FreeFileSync_armv7l_Make/ffs/src/base/algorithm.cpp.o
/bin/sh: 1: wx-config: not found
In file included from ../../zen/string_tools.h:18:0,
from ../../zen/i18n.h:13,
from <command-line>:0:
../../zen/stl_tools.h:16:20: fatal error: optional: Aucun fichier ou dossier de ce type

^
compilation terminated.
Makefile:127 : la recette pour la cible « /tmp/FreeFileSync_armv7l_Make/ffs/src/base/algorithm.cpp.o » a échouée
make: *** [/tmp/FreeFileSync_armv7l_Make/ffs/src/base/algorithm.cpp.o] Erreur 1

Gustutu
Posts: 4
Joined: 15 Mar 2019

Post by Gustutu • 15 Mar 2019, 12:34

could you help please :)

jmsxl
Posts: 19
Joined: 5 Oct 2018

Post by jmsxl • 15 Apr 2019, 03:23

It appears that you don't have dependency wxWidgets installed ("wx-config: not found")

cjmssmd
Posts: 1
Joined: 9 Jul 2019

Post by cjmssmd • 09 Jul 2019, 12:27

I'm curious, did you ever get this to work?

jmsxl
Posts: 19
Joined: 5 Oct 2018

Post by jmsxl • 20 Jul 2019, 21:29

Here's a web page that shows the steps to build on Linux: https://github.com/jeffli678/build-FreeFileSync

That page references another page https://solarianprogrammer.com/2016/10/07/building-gcc-ubuntu-linux/ that shows how to build a newer version of gcc, which you'll likely need to do as well. When building gcc on the Pi, here are the configure options I used:
../gcc-9.1.0/configure -v --prefix=/usr/local/gcc-9.1 --program-suffix=-9.1 --enable-languages=c,c++ --disable-multilib --without-included-gettext --enable-threads=posix --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release
Many of those are probably the build defaults for gcc but I included them based on the output of the older gcc already installed with raspbian ("gcc -v") just to be sure. Building gcc on the Pi takes a long time.

bgstack15
Posts: 86
Joined: 7 Jan 2018

Post by bgstack15 • 22 Jul 2019, 13:58

So, once you have all the build dependencies in place, FreeFileSync builds and runs correctly on the ARMv7 architecture? This is good news!

jmsxl
Posts: 19
Joined: 5 Oct 2018

Post by jmsxl • 23 Jul 2019, 03:49

So, once you have all the build dependencies in place, FreeFileSync builds and runs correctly on the ARMv7 architecture? bgstack15
Yes. I recently built FFS v10.14 on a Raspberry Pi 3B+ running Raspbian released July, 2019 based on Debian Buster.

No exhaustive testing, but an interactive mirror sync from the Pi to a Samba share works just fine. RealTimeSync not tested.

Following the recipes given in the links above, packages I installed:

# apt install build-essential libgtk-3-dev libboost-dev libssl-dev libcurl4-openssl-dev libssh2-1-dev

Then:
  • Build and install gcc v9.1.0
  • Build and install wxWidgets v3.1.2
  • In the FFS Makefile, change gtk+-2.0 to gtk+-3.0 and add "-latomic" to the end of LINKFLAGS
Required ~ 4GB of space to build everything (gcc is huge) But not so much when installed.

Really hammered the uSD card. Next time I would build everything on an attached USB external (magnetic) drive.

jper
Posts: 6
Joined: 28 Jul 2018

Post by jper • 09 Nov 2019, 00:50

I tried to build gcc v9.1.0 per your instructions. However after executing "make -j 2", the compiling terminated with error after less than an hour. Sad. I would have loved to use freefilesync on raspberry pi 3 as my workhorse to upload my gigabytes of home video production to my google cloud and leave my i7 computer to authoring the video. Is it possible to get your binary executable?

User avatar
Zenju
Site Admin
Posts: 5125
Joined: 9 Dec 2007

Post by Zenju • 09 Nov 2019, 08:31

Have you tried simply running the precompiled FreeFileSync version on Raspbian? It's Debian-based so I'd say chances are good it might just work.

User avatar
Zenju
Site Admin
Posts: 5125
Joined: 9 Dec 2007

Post by Zenju • 09 Nov 2019, 13:04

Have you tried simply running the precompiled FreeFileSync version on Raspbian? It's Debian-based so I'd say chances are good it might just work. Zenju, 09 Nov 2019, 08:31
Ah forget my remark, it's ARM architecture not x86.

jmsxl
Posts: 19
Joined: 5 Oct 2018

Post by jmsxl • 11 Nov 2019, 03:20

Is it possible to get your binary executable? jper, 09 Nov 2019, 00:50
Sure. Message me jmsxl19307 at gmail dot com . Assuming I can find a drop zone that can handle ~90MB because you'll need the gcc shared libs too.

jper
Posts: 6
Joined: 28 Jul 2018

Post by jper • 11 Nov 2019, 06:21

https://solarianprogrammer.com had a new update to install gcc 9.1 which did not require a build. I did that and everything else worked except FreeFileSync. I tried 10.17 source, but it would not work with gtk 3; so I installed gtk 2 but that crashed with /usr/include/gtk-2.0/gdk/gdktypes.h:114:39: error: conflicting declaration ‘typedef struct _GdkDrawable GdkWindow’ 114 | typedef struct _GdkDrawable GdkWindow;. Is there a way to get the older source? In any case, I will email you.

jper
Posts: 6
Joined: 28 Jul 2018

Post by jper • 11 Nov 2019, 19:19

Thanks to jmsxl I was able to create an executable FreeFileSync using 10.14 source.

The 10.17 has hooks in it that prevent you from using gtk 3.0, since it is still at gtk 2.0. I have not fully tried FFS, but it did execute with lots of gtk and glib warnings and errors.

I followed the steps in the below link (he updated it in June) to get gcc-9.1 working within an hour or so.
https://solarianprogrammer.com/2017/12/08/raspberry-pi-raspbian-install-gcc-compile-cpp-17-programs/

then installed software:
sudo apt install build-essential libgtk-3-dev libboost-dev libssl-dev libcurl4-openssl-dev libssh2-1-dev

next installed wxWidgets per https://github.com/jeffli678/build-FreeFileSync
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.tar.bz2
tar xf wxWidgets-3.1.2.tar.bz2
cd wxWidgets-3.1.2/
mkdir gtk-build # or any other name you like
cd gtk-build
../configure --disable-shared --enable-unicode
make
sudo make install # use sudo if necessary

taking the FFS source 10.14 which jmsxl provide for me. I make the following changes:

The Makefile is at FreeFileSync_10.14_Source/FreeFileSync/Source/Makefile. We need to change all occurrances (there should be two) of "g++" to "g++-9.1" .
also per jmsxl you need to: change gtk+-2.0 to gtk+-3.0 and add "-latomic" to the end of LINKFLAGS

In "afs/sftp.cpp", add at line 58:
#define MAX_SFTP_OUTGOING_SIZE 30000
#define MAX_SFTP_READ_SIZE 30000
also In "afs/sftp.cpp", add at line 1662 (just before the #if)
#define LIBSSH2_SFTP_DEFAULT_MODE -1

Run "make" in folder FreeFileSync_10.14_Source/FreeFileSync/Source. It will take roughly hour plus.

The binary should be waiting for you in FreeFileSync_10.14_Source/FreeFileSync/Build/Bin.
I opened it in a terminal and executed: ./FreeFileSync_armv7l

jper
Posts: 6
Joined: 28 Jul 2018

Post by jper • 11 Nov 2019, 20:22

I tried 10.15 and 10.16 (and 10.17 before) and both failed for different reasons. So 10.14 is the latest one that works with the current hooks. But the ability to access Google Drive fails, because client-id is not specified.
As I stated before, it would great to a have raspbian version of FFS to able to use a very cheap computer to be the workhorse in uploading files to cloud and and updating other harddrives; while using the expensive computers to do productive work.

jmsxl
Posts: 19
Joined: 5 Oct 2018

Post by jmsxl • 12 Nov 2019, 14:26

Thanks much for the update. Hopefully we can get the current sources running on the Pi soon, and keep things working. The Pi 4 is a mighty little beast and would be a great platform for FFS.