# opencpn



## goprisko (Sep 8, 2016)

Hi,

I want to convert from using Mageia 5 to BSD.

A critical application I use every day is openCpn.  That because I work and live aboard a ship.
The source is available.
How different will the compilation be from a linux compilation?
Suggestions please to [_Mod: email address redacted_].....

INDY


----------



## Phishfry (Sep 8, 2016)

Really would help to actually explain what OpenCPN is:
http://opencpn.org/ocpn/
Open Chart Plotter is a marine mapping software that interfaces with GPS devices.


----------



## Phishfry (Sep 8, 2016)

https://lists.freebsd.org/pipermail/freebsd-ports/2016-July/103974.html


----------



## Phishfry (Sep 8, 2016)

The link there in that post did not work for me.

Try This:
`git clone https://github.com/OpenCPN/OpenCPN.git /OpenCPN`


----------



## Phishfry (Sep 8, 2016)

Well first off it needs `cmake` and second it fails at wxWidgets missing. Still working on it.


----------



## Phishfry (Sep 9, 2016)

So this post has a port of OpenCPN
https://lists.freebsd.org/pipermail/freebsd-ports/2016-July/103968.html

http://www.netfence.it/download/OpenCPN_port.tbz


----------



## cpm@ (Sep 9, 2016)

Phishfry said:


> So this post has a port of OpenCPN
> https://lists.freebsd.org/pipermail/freebsd-ports/2016-July/103968.html
> 
> http://www.netfence.it/download/OpenCPN_port.tbz



See and follow-up: PR 211199.


----------



## goprisko (Sep 9, 2016)

Thank you for your attention to my problem.........
The snippet of code mentioned in one reference is a sub-routine expressly testing the availability of a serial port.

Use of the serial port is somewhat archaic.  It is used to  communicate with a GPS receiver, external to the computer running openCpn, and with autopilots.  The program runs fine in it's absence.  Today few computers come with serial ports, and communication is mostly via USB.

The answer lies in how you test existence of a serial port in BSD...... It's been a long time......... but isn't that a simple task involving a call??

The PR 211199 post contains a makefile...... not mentioned explicitly is the version of openCpn to which this applies....  also openCpn is available as a tarball......
one would only use GitHub to get bleeding edge stuff.

If anyone knows the version used....... I'll try to compile it........ or will try installing the version in the tbz.......  which ever is recommended.

BTW......... I use openCpn everyday........... I have worldwide charts for it..........  I have navigated the world with it.........

Warmly,

INDY


----------



## SirDice (Sep 9, 2016)

goprisko said:


> The PR 211199 post contains a makefile...... not mentioned explicitly is the version of openCpn to which this applies.... also openCpn is available as a tarball...... One would only use GitHub to get bleeding edge stuff.


Looks like you're not understanding our ports system. 


```
PORTNAME=	OpenCPN
PORTVERSION=	4.4.0
CATEGORIES=	misc
MASTER_SITES=	https://github.com/OpenCPN/OpenCPN/archive/ \
		http://netfence.it/download/
```

I highly recommend reading the Porter's Handbook to understand how ports are made.


----------



## goprisko (Sep 9, 2016)

I did a search for a port labeled OpenCPN in the "misc" category........
However nothing comes up................
So..........
Does this port exist???
If not...........
It   would seem that I need to build myself my own private executible.......


----------



## SirDice (Sep 9, 2016)

No, it doesn't exist. That's what the PR is for, to add it.


----------



## goprisko (Sep 9, 2016)

So, is my interim move best a move to DebianKfreeBSD????

or........

Do I have a shot at compiling it???


----------



## SirDice (Sep 9, 2016)

Try the port in the PR and report any issues you have with it. That way it can be improved and, eventually, be added to the ports system.

Please note that ports are a community effort. Nobody is getting paid to create ports, it's all voluntary.


----------



## goprisko (Sep 9, 2016)

Ok........ Thanks.............


----------



## Phishfry (Sep 10, 2016)

So just right-click the hyperlink titled "Port skeleton" on the PR to download the diff file.

Then run this:
`patch -u < ./OpenCPN.diff`

It will create a port skeleton which you can run `make install` on under the /usr/OpenCPN directory.


----------



## Phishfry (Sep 10, 2016)

I have trouble with the port. First it error-ed out on wxSVG then I installed that via `pkg` and it got further along but dropped at more wx stuff. Something about a pi-plugin. If I knew more I would say drop the plugin from the build and it might work somewhat.


----------



## goprisko (Sep 13, 2016)

Hi, 
I got the build to continue until it errored out building the plugins.........
Apparently a header file is missing or corrupt, because the same error occurs in multiple builds

I'm going to try the other port

INDY
PS: Just to make sure.......... I git cloned the latest from OpenCPN and sucessfully built it on my Mageia 5 system, then sucessfully installed it there.  So the Makefile and files distributed by the vendor work on Linux.


----------



## Phishfry (Sep 13, 2016)

That sounds like the same spot I ran into. Being a plugin I wonder if we could plow past it.

Have you commented on the PR page?? The author could help. All you need to do is sign up. All relevant comments welcome. Use supporting documentation if possible. Yell if you need help.


----------



## Phishfry (Sep 14, 2016)

Are you going to write this up or do you want me to help you? The port's author may have no idea anything is wrong unless someone speaks up.
I don't mind commenting if you don't want to.

All you really need to do is include a snip of the last dozen lines of text including the errors..


----------



## Phishfry (Sep 14, 2016)

One question is -have you tried this on FreeBSD 10.3? My testing was done on FreeBSD 11 RC2.
Before complaining I like to have my facts in line. Will try it myself if not.

I am assuming the earlier port version you tried did not build as well?


----------



## Phishfry (Sep 14, 2016)

I think I had to massage the file location as well...It was not finding it at the locations in the makefile.


----------



## goprisko (Dec 20, 2016)

Hi,
I would like to thank everyone for their help, and most particularly
those who ported OpenCpn-4.4.0 to BSD.

INDY


----------



## Phishfry (Dec 22, 2016)

Looking good. Still trying to figure out how to use a cellular modems GPS signal with it. Looks like maybe via GPSD.


----------



## Phishfry (Dec 22, 2016)

Looks like the serial ports are not correct under connections. They are showing as ttyU0.0. FreeBSD uses cuaU0.0 scheme.
Will have to use astro/gpsd.


----------



## tingo (Dec 25, 2016)

both ttyU* and cuaU* is good for FreeBSD...


----------



## SirDice (Dec 29, 2016)

```
FILES
     /dev/ttyu?       for callin ports
     /dev/ttyu?.init
     /dev/ttyu?.lock  corresponding callin initial-state and lock-state
                      devices

     /dev/cuau?       for callout ports
     /dev/cuau?.init
     /dev/cuau?.lock  corresponding callout initial-state and lock-state
                      devices
```
From uart(4).


----------

