To the owners of OpenCPN,
I am not comfortable to fool around in wiki. Please feel free to copy my contribution to where you want to have it or not.
Compiling OpenCPN for Raspberry 2 or 3B
Make sure that you have:
A decent power supply. The Pi is power hungry and especially for multi-core
compilations and later on moving and sizing maps, you'll need full power.
A 1.5 Amps mobile phone charger
won't do it, most of the 2 Amps neither,
especially in combination with ultra thin wired USB signal cables!
A quality Class 10 SD-Card. Most of instablities or latencies come from lousy SD-Cards
You might wonder, where to put your chart files. Either, buy a bigger SD card (32 Gb),
or leave the SD card for Jessie and the app and add a decent USB Memory stick. The Pi mounts
memory sticks automatically under /media/... The Pi is picky concerning mem sticks!
Make sure, you are on the latest OS version
$sudo apt-get update
$sudo apt-get dist-upgrade
Use RASPI-CONFIG to enable OpenGL
$ sudo raspi-config
=> Advanced Options, “GL Driver”, enable
Add the following lines to /boot/config.txt
$sudo vi /boot/config.txt
Getting the sources:
$ git clone git://github.com/OpenCPN/OpenCPN.git
this seems to be the "official" source of sources
In case you have already done this some time before, you can get an update by
$ git pull
Getting the middleware:
OpenCPN depends on many other SW-packages, to get them:
$ sudo apt-get install build-essential cmake gettext git-core \
libgps-dev wx-common libwxgtk3.0-dev libglu1-mesa-dev libgtk2.0-dev \
wx3.0-headers libbz2-dev libtinyxml-dev libportaudio2 portaudio19-dev \
libcurl4-openssl-dev libexpat1-dev libcairo2-dev liblzma-dev libelf-dev
Be aware the you also have to make provisions for the HW you want to
connect to the Pi, to give you GPS
etc. and where and how you want
to connect these to the Pi:
In most cases you may have to add: gpsd gpsd-clients to the list above.
There is an awful lot of things to consider when adding HW to the Pi,
which has nothing to do with compiling OpenCPN for Pis. OpenCPN is just using'em.
If that scares you away, consider to use OpenPlotter, which is a pretty
nice fully integrated HW & SW solution for amazingly affordable HW prices. May be bitTorrent wasn't the luckiest choice as distribution channel, but for those who are scared for security
, you could buy their prepopulated SD Card for small money
The same applies for the question, how you want later to access the Pi and OpenCPN, underway and away from your home router/LAN. Considering to use the Pi as WiFi
The above mentioned git clone command will create a new directory below
the dir, where you launch the commnd. Hence think from where you do this.
I suggest that you build your 1st compilation with the GSHHS crude model; you
might later decide to go for full.
Make sure that you have the libgtk2.0-dev installed! Otherwise you will get in trouble!!
Compiling the beast:
Once you've got all prerequisites in place you can attempt to compile.
$ cd OpenCPN
$ mkdir build
$ cd build
You have to run cmake with a few compilation switches
$ cmake -DBUNDLE_DOCS=ON -DBUNDLE_TCDATA=ON -DBUNDLE_GSHHS=CRUDE ../
don't be afraid of tons of cryptic messages running over the screen
Then you can make it; you can decide to use more than 1 core
With 1 core
you may end up with 2h of compile time. You can speed this up by
using 2 cores. In principle you could use all 4 cores, but everybody until
now experienced crashes, doing so. I observed a Pi RAM usage of up to 800 MB using
2 cores. With 3, I got over the built in 1 Gb of RAM. Hence the command is:
$ make -j2
or simply make, if you have the patience to wait a little longer
time for a coffee...
Once your compilation has finished w/out noticable errors or crashes, you can give it a
preliminary shot by launching it from your build directory
Hope 4u, that it will run, - it should...
You can then proceed to install it
$ sudo make install
If you don't want to repeat this all the time, make a package:
$ sudo make package
You still have to create the directory for the charts
and copy them there.
To later load the package you made again, there is a handy tool called gdebi, hence:
$sudo apt-get install gdebi