Compiling GoldenCheetah on Raspberry Pi 4 with Raspbian Buster – free bicycle trainer/analysis software

Ok, I’m still testing, but I have instructions to get GoldenCheetah to compile and run on a Raspberry Pi 4. Please share if you have anything to add/improve. Hopefully this will start the process of getting official Rpi4 instructions added to the project…

If you are not familiar, GoldenCheetah is open source software that will control a smart trainer (wahoo kickr, tacx, etc…) via Ant+ or bluetooth. It will sync rides to/from strava and others. It has amazing (way beyond my ability or interest) performance analysis functions! It can download ride profiles from the free ERG repository. It really does too much to list here. I highly recommend it. Warts and all it still a great piece of software that some great people work hard to support, and it does most everything I need trainer software to do. Oh… and it doesn’t cost me $10 a month in subscription fees. So If I can build a dedicated computer out of a Rpi4 that will run GoldenCheetah for less than $100, then I’m a happy lad!

Links:

The main website is GoldenCheetah.org. The project code is on github. Discussion is on Google Groups.

GoldenCheetah install on Raspberry pi 4 with – Raspbian Buster. I consider this the preferred way to do it. 

I used the 2019-09-26 version from raspberrypi.org – the middle size software ~ 1.1gigs.

You will need to follow the generic instructions to create a clean Raspbian boot SD card.

IMPORTANT NOTE: This only works for the current release version of GoldenCheetah V3.5.0. The newer betas require some modules that have not been added to the repository for the pi. I will update this article when the modules are available and I can get the pi to compile the current code.

Then let’s get the software up to date:

     $ sudo apt update     {if you have never run apt update it may fail saying library date is in future, just run it again}
     $ sudo apt -yf full-upgrade
     $ sudo apt-get -y --purge autoremove  {that is two dashes in front of purge "--purge"}
     $ sudo apt-get autoclean

     $ sudo timedatectl set-timezone America/Chicago {pick your own time zone, see them all by typing $ timedatectl list-timezones}
     $ sudo reboot now

Install QT sdk and libraries
     $ sudo apt-get install qt5-default qtcreator libqt5svg5-dev libqt5serialport5-dev libqt5charts5-dev qtmultimedia5-dev qtconnectivity5-dev

     $ sudo apt-get install libqt5webkit5-dev libusb-1.0-0-dev libical-dev libvlc-dev libvlccore-dev bison flex

Modify the USB device so you can use your ANT+ USB stick {no need if you are only going to use bluetooth}

     $ cd /etc/udev/rules.d

     $ sudo nano 52-garmin-usb.rules

  • Add (copy/paste) the following six lines to the file:  {there are no spaces before the lines
  • # Garmin ANT+ – USB1
    ATTRS{idVendor}==”0fcf”, ATTRS{idProduct}==”1004″, MODE=”0666″
    # Garmin ANT+ – USB2
    ATTRS{idVendor}==”0fcf”, ATTRS{idProduct}==”1008″, MODE=”0666″
    # hLine USB2 ANT2
    ATTRS{idVendor}==”0fcf”, ATTRS{idProduct}==”1009″, MODE=”0666″
  • exit and save the file

     $ sudo reboot now

Now download the code, make a few changes and start compiling!

     Git should already be installed if not ‘$ sudo apt-get install git’
     $ cd ~
     $ mkdir projects
     $ cd projects
     $ git clone git://github.com/GoldenCheetah/GoldenCheetah.git
     $ git clone git://github.com/GoldenCheetah/GoldenCheetah.git --branch release_3.5.0

     $ cd GoldenCheetah
     $ cd src
     $ cp gcconfig.pri.in gcconfig.pri
     $ nano gcconfig.pri    

  • uncomment line #CONFIG += release
  • uncomment line #QMAKE_LRELEASE = /usr/bin/lrelease
  • uncomment line #QMAKE_CXXFLAGS += -03
  • comment out the line QMAKE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 by added a ‘#’ in front of it
  • uncomment line #ICAL_INSTALL =
  • Change the value Of the ICAL_INSTALL = (line above this one) to “ICAL_INSTALL = /usr/lib”
  • uncomment line #LIBUSB_INSTALL = /usr/local
  • Change the value Of the LIBUSB_INSTALL (line above this one) to “= /usr/lib” instead of “= /usr/local”
  • uncomment line #LIB_USE_V_1
  • uncomment line #LIBZ_LIBS = -lz

     $ cd ~/projects/GoldenCheetah/qwt

     $ cp qwtconfig.pri.in qwtconfig.pri

     $ cd ~/projects/GoldenCheetah
     $ qmake -recursive  {if you see a bunch (22 or so) of translation language and missing file errors… you can ignore them}

     $ make

Now just sit back and wait. Should take about 1.5 hours with a good heat sink on a 2 gig Rpi4 :)
When it is all done you will have a GoldenCheetah executable file in your projects/GoldenCheetah/src directory. You can copy it wherever you like, if you want to run it from the command line here just type:

     $ ~/projects/GoldenCheetah/src/GoldenCheetah

I made a Desktop icon on Raspbian by doing the following:

     $ cd ~/Desktop

     $ nano GoldenCheetah.desktop

  • Add (copy/paste) the following ten lines to the file:
  • [Desktop Entry]
    Name=GoldenCheetah
    Comment=Built for suffering
    Icon=/usr/share/pixmaps/openbox.xpm
    Exec=/home/pi/projects/GoldenCheetah/src/GoldenCheetah
    Type=Application
    Encoding=UTF-8
    Terminal=false
    StartUpNotify=true
    Categories=None;
  • exit and save

Every time you use the desktop icon it will ask what you want to do with it. Select execute. You can disable this in Raspbian config files, but that is beyond the scope of this howto…..

Enjoy!  :)

 

18 Responses to “Compiling GoldenCheetah on Raspberry Pi 4 with Raspbian Buster – free bicycle trainer/analysis software”

  1. FreindlyDBA says:

    Nice blog i will have to visit more often and keep up

  2. EvilT says:

    Edited to add support for the iCal (libical). So the diary screen shows now.

  3. KMCdn says:

    Thanks for this guide! I followed it to the letter, but the qmake and make fail with issues relating to some missing QT5 packages. They were widgets, position, and webkit related. I tried various package installs but could only resolve the position issue.

    This is using the larger base OS, but otherwise the same.

    Thanks in advance!

  4. EvilT says:

    I’ve seen this. The current reason is that you are probably trying to compile the current beta code. Unfortunately these modules are not yet available in the pi’s repositories. You can only build the current release version 3.5.0.

    So your ‘git clone’ statement should be
    $ git clone git://github.com/GoldenCheetah/GoldenCheetah.git –branch release_3.5.0

    I hope the webkit etc, will be available soon for the Pi. I can already see versions available for armhf in the Debian beta repositories. I will update here and on the GC Wiki when I can get 3.6.0 to compile.

  5. Alain Soucy says:

    Compile first try !
    Good instructions.

    It take approx. 30 minutes with ‘make -j4’ and a Pi4, 4G, a fan, heat sinks. Temperature: 65C.

    GoldenCheetah run realy well.

  6. garrop says:

    Hi there,

    I had been looking for a way to do this for a while now… Thanks for sharing such a complete guide.

    I have not been able to locate “uncomment line #LIBS += -lz” on my gcconfig.pri file. I have uncommented “LIBZ_LIBS = -lz” instead, although not sure I did the right thing.

    The make went swell and GC is up and running. Trying to connect my KICKR Core over BT right now, but it won’t work. Will try later over ANT+ if I manage to find my dongle.

    The purpose of this install is to use for indoor training, so the effort will be mod if the connection is not achieved.

    Just wanted to show my kindest thanks.

  7. EvilT says:

    You are correct sir, it should be ‘LIBZ_LIBS = -lz’. Thanks for the feedback. I will update the post.
    I don’t think the Wahoo supports the FTMS protocol required for standards based BT control. That said, I’m not sure if GC supports trainer control via BT. I still have testing of BT (for sensors only) on my to-do list.
    Should work just fine with ANT+.

  8. Teruel deCampo says:

    git clone git://github.com/GoldenCheetah/GoldenCheetah.git ––branch release_3.5.0

    fatal: Too many arguments.

  9. Teruel deCampo says:

    Hi EvilT;

    1. I want to thank you for all of your work as well as the very detail step by step installation. I am very aware that takes knowledge and time. So again my sincere thanks.

    2. The only minor change I have to do

    git clone git://github.com/GoldenCheetah/GoldenCheetah.git -b V3.5

    The branch changed to -b V3.5 instead from -b release_3.5.0

    ref:
    Hardware : BCM2711
    Revision : c03111
    Serial : 100000009fa6348a
    Model : Raspberry Pi 4 Model B Rev 1.1

    NAME=”Raspbian GNU/Linux”
    VERSION_ID=”10″
    VERSION=”10 (buster)”
    VERSION_CODENAME=buster

  10. EvilT says:

    The branch changed to -b V3.5 instead from -b release_3.5.0
    git clone git://github.com/GoldenCheetah/GoldenCheetah.git -b V3.5

    Glad to hear it is still working. :)
    From the error you had it looks like the two dashes in front of “–branch” in the git close command had been turned into one long dash. I’ve updated the post to make that a code segment, so hopefully wordpress will stop turning double dashes into single long dashes. As far as I can see release_3.5.0 is still a valid branch. I believe your second version worked because you changed the command to “-b” instead of the “–branch”.

    As a fun side note…
    I’ve been able to get the 3.6 dev version to compile on a Pi 4b running Ubuntu 20.10, but haven’t posted the instructions yet, as I really feel it is a bit slow. I’ve been trying everything possible to get other distros running GC, but I’ve run into two main problems…
    1. The version of bison they use in the GoldenCheetah project is very old…
    2. The QT libraries you can get with even the most recent Raspberry Pi OS repositories are very very old.

    I can get most the way there with the Manjaro linux for raspberry pi, but cannot find a way to downgrade bison to 3.5.1 so GC will compile. Even if I figure out the format of the pacman command, I cannot find an arm64 version of bison 3.5.1 for Manjaro… If anyone knows how to get a bison 3.5.1 arm64 installed on Manjaro, please let me know. Manjaro was much zippier than Ubuntu Desktop.

    If I try to compile QT from scratch on Raspberry Pi OS I can get just about everything but qtwebengine to compile, so cannot use Raspberry Pi OS…

    I’ve tried almost every permutation of Ubuntu 20.10 server with a QT capable desktop, but they are all missing components or I cannot get the desktop to load on Ubuntu Server 20.10…

    I need to go back and try all the same with Server 20.04, but I’m really about to give up for 2021 and just subscribe to TrainerRoad for a year. Hopefully all the pieces will be there again later. I would save so much of my spare time…

    That said. I’ve loaded Ubuntu Desktop 20.10 again and I’m stripping out all the bloatware and reinstalling to see if it is fast enough… :)

  11. erik says:

    Thx for guide!
    Working on Rpi 3B+ . Compile with ‘make -j1’ because of memory usage.

  12. Derek says:

    Thanks ET for putting together such a comprehensive guide to GC!

    Got most of the way there, but failed during qmake -recursive. Any ideas?

    Code:
    pi@raspberrypi:~/projects $ cd GoldenCheetah
    pi@raspberrypi:~/projects/GoldenCheetah $ cd src
    pi@raspberrypi:~/projects/GoldenCheetah/src $ cp gcconfig.pri.in gcconfig.pri
    pi@raspberrypi:~/projects/GoldenCheetah/src $ nano gcconfig.pri
    pi@raspberrypi:~/projects/GoldenCheetah/src $ cd ~/projects/GoldenCheetah/qwt
    pi@raspberrypi:~/projects/GoldenCheetah/qwt $ cp qwtconfig.pri.in qwtconfig.pri
    pi@raspberrypi:~/projects/GoldenCheetah/qwt $ cd ~/projects/GoldenCheetahpi@raspberrypi:~/projects/GoldenCheetah $ qmake -recursive
    qmake: could not exec ‘/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake’: No such file or directory

  13. EvilT says:

    Not an expert here, but it looks like you are trying to execute qmake from a qt4 directory. The instructions install qt5… Have you typed in your error and looked at what the web has to say?

    This is old, but looks pertinent:
    https://www.raspberrypi.org/forums/viewtopic.php?p=877481

    Were you installing on a clean Raspbian? If so what was the date of the distribution? The one above is the 2019-09-26 version.

    All that said, I compiled the whole thing under ubuntu 20.10 on the pi and it works great… The ubuntu is a little slow on the desktop, but you won’t notice any lag if you are using GC as training software.

  14. Brandon says:

    Package qt5-default is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    And…

    brandon@raspberrypi:~/projects/GoldenCheetah $ qmake -recursive
    Info: creating stash file /home/brandon/projects/GoldenCheetah/.qmake.stash
    Reading /home/brandon/projects/GoldenCheetah/qwt/qwt.pro
    Reading /home/brandon/projects/GoldenCheetah/qwt/src/src.pro
    Project ERROR: Unknown module(s) in QT: SVG

    I thought perhaps running qt6 would help, but to no avail
    https://www.qt.io/blog/qt-6-build-system

    (shrug) any suggestions would be helpful

  15. EvilT says:

    Brandon, are you using the specified version?
    git clone git://github.com/GoldenCheetah/GoldenCheetah.git –branch release_3.5.0
    I don’t think that version used the SVG Scalable Vector Graphics in newer versions of QT.

    If you are trying to build the new GC code I cannot help you. I had an old mac mini someone gave me and I just put it up to be the GC computer. So I haven’t compiled it on the pi in a while. Let me know if the old code base for the 3.5.0 branch still works.

  16. FrisbeeEmily says:

    Brandon,

    I just compiled on a 3B+ with Debian 11 (bullseye) last week.

    # in place of qt5-default:
    sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

    #more of qt5 and a few extra things
    sudo apt-get install qtcreator libqt5svg5-dev libqt5serialport5-dev libqt5charts5-dev qtmultimedia5-dev qtconnectivity5-dev
    sudo apt-get install libqt5webkit5-dev libusb-1.0-0-dev libical-dev libvlc-dev libvlccore-dev

    # With this version of QT, there were all kinds of errors in the build with missing refs to qpainterpath.
    # I fixed these by making 1 change in the beloW files of GoldenCheetah/qwt/src/
    #add this at top (to include additional headers), minus the quotes:

    “#include ”

    qwt_compass_rose.h qwt_painter_command.h qwt_plot_glcanvas.h qwt_plot_renderer.h
    qwt_null_paintdevice.cpp qwt_painter.h qwt_plot.h qwt_widget_overlay.h

    I also had to temporarily increase swap size to build the code because it crapped out the first time. Worked after that though.

  17. FrisbeeEmily says:

    That was supposed to be:
    ” #include “

  18. FrisbeeEmily says:

    #include qpainterpath.h

Leave a Reply

Line and paragraph breaks automatic.
XHTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Comments Protected by WP-SpamShield Spam Filter