Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-01-2010, 02:42   #1
Registered User
 
Erwin's Avatar

Join Date: Jan 2010
Location: Netherlands
Boat: X-332 Sport
Posts: 15
Images: 3
OpenCPN on OS X 'Snow Leopard'

Hi all,

After several (frustrating) days of tweaking, I've been able to build OpenCPN for the Mac.



One of the first thing I noticed when running (also with the 1.3.0 precompiled version on Sourceforge) is that the window bar is under the Mac Menu. The second thing is a little more obvious: all black window contents. No world coastline.

If I add some charts it turns to grey, like this:


I will investigate and try some things, but I was so happy that it actually starts that I really wanted to report my progress!
__________________

__________________
Erwin is offline   Reply With Quote
Old 02-01-2010, 02:53   #2
Registered User
 
Erwin's Avatar

Join Date: Jan 2010
Location: Netherlands
Boat: X-332 Sport
Posts: 15
Images: 3
Ok, some details about the things I ran into:

Snow Leopard is by default a 64-bit OS. wxWidgets still uses the old Carbon frameworks, which is only available in 32-bits version. Details here:
Development: wxMac - WxWiki
So you need to 'convince' all compilers and linkers to go to 32-bit. This applies to building wxWidgets and OpenCPN. I used wx version 2.8.10.

I wasn't able to get a statically compiled version of wxWidgets to link against OpenCPN. In the end it was always complaining about 3 missing symbols ('_fopen$UNIX2003'). These functions are implemented in libSystem.dylib, but I wasn't able to tell the compiler that (using -l and all other options).

Thus, I used a dynamically compiled version of wx, which is the default when compiling wx.

In the end I created an Xcode project containing all the necessary code (there are a lot of unused files in the codebase) and managed to get a running (not really functioning) application.
__________________

__________________
Erwin is offline   Reply With Quote
Old 02-01-2010, 03:12   #3
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
Impressed with your efforts, sounds like a bit of a nightmare. I hear linux runs on macs these days so... come to the dark side, luke?
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 02-01-2010, 03:51   #4
Registered User
 
Erwin's Avatar

Join Date: Jan 2010
Location: Netherlands
Boat: X-332 Sport
Posts: 15
Images: 3
Quote:
Originally Posted by idpnd View Post
Impressed with your efforts, sounds like a bit of a nightmare. I hear linux runs on macs these days so... come to the dark side, luke?
Trust me, I've been on EVERY side

Well, just had a small breakthrough:


The build should contain some data directories.

I wanted to have the Mac OSX version for on my laptop at home. No way I will be using a laptop on my boat. My goal is to run OpenCPN on this:
gumstix - dream, design, deliver
That is tiny ARM-based motherboard running Linux. It has all the serial/USB/etc. output I need. Including DVI-D...

In the mean time I'll be using Linux or Windows on my boat on a Mini-ITX I have lying around.

Current state:
  • the world shoreline does not load yet, still black when started
  • the vector charts do load now
The story continues, still have some crashes to resolve.
__________________
Erwin is offline   Reply With Quote
Old 02-01-2010, 04:31   #5
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
I have just built a fanless mini-itx with ssd hdd for those purposes. it's an ion, so it also plays videos etc. i guess the arm processor would use even less electricity?

You may wish to contribute your macos build as advertised at opencpn.org..
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 02-01-2010, 05:44   #6
Registered User
 
Erwin's Avatar

Join Date: Jan 2010
Location: Netherlands
Boat: X-332 Sport
Posts: 15
Images: 3
Quote:
Originally Posted by idpnd View Post
I have just built a fanless mini-itx with ssd hdd for those purposes. it's an ion, so it also plays videos etc. i guess the arm processor would use even less electricity?
Yes, way less electricity. From the site:
The Gumstix Overo COM draws 250 mA @ 4v (with wifi & bluetooth switched off).
That is about 1 Watt. Add to that some power for a flash disk, power converter. And of course a display, but with some nice audio alerts that would not have to be always on for my usage.

If I calculate the power consumption of my Mini-ITX setup on Mini-Box.Com Power Calculator
my consumption is about 27 Watt. When I install this on my boat I'll remove the slim-line DVD drive and possibly replace the HD with a Flash Drive. This takes the consumption down to about 17 Watt.

The Gumstix power consumption is in the order of a normal navigation display like a log, gps-repeater etc...


Quote:
Originally Posted by idpnd View Post
You may wish to contribute your macos build as advertised at opencpn.org..
I will. First I'll have to remove all absolute build paths from my project definition. Currently the app links against a locally installed version of wx. I want wx to be packaged inside the app and dynamically link against those libs. That requires some arcane commands in the project definition. I have not been that adventurous yet
__________________
Erwin is offline   Reply With Quote
Old 04-01-2010, 01:18   #7
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
Interesting!

Would this compile on an arm processor without further ado?
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 04-01-2010, 11:59   #8
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
250mW!
This just blows my mind. I would just so much like to have a nav system with the flexibility of a personal computer (be it win/mac or linux) and the power consumption of a plotter.

My idea has been an IntelAtom mini-itx like this:
Kontron KTUS
This mini-itx uses the US15 chipset which reduce the power consumption of this board to about 10W.
Unfortunatelly I have not been able to find anywhere to buy it - Kontron doesnt sell to end users directly...
Other usefull stuff: 4com ports. (GPS, AIS, Navtex and instrument system ports)
USB-RS232 is to my experience shaky at best.

Please keep us posted on your progress with your Gumstix project!

/Jonas
__________________
jonasaberg is offline   Reply With Quote
Old 04-01-2010, 12:52   #9
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
As I said above, I've got an ION board, which is atom plus nvidia for video decoding, so I can watch HD movies etc. Power consumption is alledgedly something like 8W, plus SSD plus screen. This would certainly be my main onboard computer.

I may however look into an arm-based system for enroute navigation.
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 04-01-2010, 15:57   #10
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
Idpnd,
Exactly which ION board did you get? I cant find anyone stating 8W. Link?

I would prefer to find a board with native RS232 ports but maybe I will have to make due with USBs and converters allthough in my experience they are not 100% stable.
The kontron board seems great - but is not easily availlable...

/J
__________________
jonasaberg is offline   Reply With Quote
Old 04-01-2010, 23:02   #11
Registered User
 
Psyches's Avatar

Join Date: Apr 2008
Location: SF Bay Area
Boat: Tartan 30 - Bluegrass
Posts: 187
Send a message via Yahoo to Psyches Send a message via Skype™ to Psyches
Quote:
Originally Posted by Erwin View Post
Ok, some details about the things I ran into:

Snow Leopard is by default a 64-bit OS. wxWidgets still uses the old Carbon frameworks, which is only available in 32-bits version. Details here:
Development: wxMac - WxWiki
So you need to 'convince' all compilers and linkers to go to 32-bit. This applies to building wxWidgets and OpenCPN. I used wx version 2.8.10.

I wasn't able to get a statically compiled version of wxWidgets to link against OpenCPN. In the end it was always complaining about 3 missing symbols ('_fopen$UNIX2003'). These functions are implemented in libSystem.dylib, but I wasn't able to tell the compiler that (using -l and all other options).

Thus, I used a dynamically compiled version of wx, which is the default when compiling wx.

In the end I created an Xcode project containing all the necessary code (there are a lot of unused files in the codebase) and managed to get a running (not really functioning) application.
Erwin, as idpnd said, sounds like a bit of a nightmare, and good work. I also found many unused files when working on a Win32 build. I talked with Dave, and he was/is planning to remove them. Also sounds like a bit of restructuring would be useful, along with some revised build notes, including yours, if you don't mind posting them.

So it sounds like you're up and going now, after adding the needed data?

I've been away for a few weeks, sorry I'm just coming back around.

Mark
__________________
Psyches is offline   Reply With Quote
Old 05-01-2010, 06:09   #12
Registered User
 
Erwin's Avatar

Join Date: Jan 2010
Location: Netherlands
Boat: X-332 Sport
Posts: 15
Images: 3
Quote:
Originally Posted by Psyches View Post
Also sounds like a bit of restructuring would be useful, along with some revised build notes, including yours, if you don't mind posting them.

So it sounds like you're up and going now, after adding the needed data?
Well, as can be seen in my last screenshot it is up and running. But very unstable, after some zooming in and out, get a "ERR_BAD_ACCESS" which is basically a referencing a pointer to 'nowhere'. Somewhere deep in the Wx bit-blitting code. Need to check that...

Other things I want to do in the next weeks:
  • make a nicely packaged version and upload it somewhere
    (this requires moving the Wx libs into the bundled app);
  • uploading the Xcode project definition and some build notes;
  • make it buildable automagically on the command-line (autoconf);
  • find an ARM board to check if all neccessary code actually compiles
    (this requires setting up a cross-compilation toolchain which is usually even worse than what I did for this OS/X build)
So, I'll be busy. For the ARM/Gumstix thing I'll create a seperate thread to keep it a little clean here...

Erwin
__________________
Erwin is offline   Reply With Quote
Old 05-01-2010, 19:06   #13
Registered User
 
Psyches's Avatar

Join Date: Apr 2008
Location: SF Bay Area
Boat: Tartan 30 - Bluegrass
Posts: 187
Send a message via Yahoo to Psyches Send a message via Skype™ to Psyches
Erwin, thanks. Yeah I'm painfully familiar with ERR_BAD_ACCESS category errors. Sounds like a good list - good luck, we're all plugging for you. wxWidgets is pretty good but can have rough edges here or there; so it's possible you've discovered one, or something with the particular way OpenCPN is using it.

Mark
__________________
Psyches is offline   Reply With Quote
Old 24-01-2010, 17:40   #14
Registered User
 
CarinaPDX's Avatar

Join Date: Jan 2010
Location: Portland, Oregon, USA
Boat: 31' Cape George Cutter
Posts: 1,673
Hi Erwin,

Thanks for working on the Mac port. I would like to help if I could; the problem is that the last time I did any programming was 35 years ago with FORTRAN in a timesharing environment. I am trying to sort out the modern world, but it is quite a bit to take in at one time. At a minimum, if you would like a tester please let me know.

For the last 3 years, sailing the Med and across the Atlantic (nasty weather last year) to the Caribbean and New York to the Great Lakes, I have used my 17" MBP on board. Sadly I have had to use Boot Camp a lot more than I would like. Needless to say the 'Book stayed below and I am paranoid about liquids getting near it.

A couple of years ago I looked into a mini-ITX computer. At the time Nobeltec (Windows) software displayed many chart formats, and esp. the free US ENC and BSB charts, as well as AIS, and radar from a scanner they OEM'ed. By the time my radar died last year that option was no longer available - Nobeltec only uses proprietary CMap charts now (surprise: both Nobeltec and CMap are owned by Jeppeson). If only OpenCPN or something similar supported radar scanners we could have an economical nav system without having to pay a lot of money for proprietary MFDs and proprietary charts. And the same hardware could be used for Airmail, etc. A bit off topic, sorry...

Please let me know if I can be of help.

Greg
__________________
CarinaPDX is offline   Reply With Quote
Old 25-01-2010, 13:47   #15
Registered User
 
Erwin's Avatar

Join Date: Jan 2010
Location: Netherlands
Boat: X-332 Sport
Posts: 15
Images: 3
Ok, I've managed to build a version that is complete. The Wx libs are bundled inside the app.

On my system it crashes regularly...

I have uploaded a zip file to my server. It is here. Please give it a shot...
__________________

__________________
Erwin is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN 1.3.6 And Betas kerrydeare OpenCPN 1 28-12-2009 03:25
Snow Birds Heading South Rickwig Atlantic & the Caribbean 2 02-11-2009 09:50
OpenCPN bdbcat OpenCPN 1343 19-09-2009 16:59
Snow!!!! What do I need to check? denmanislander Construction, Maintenance & Refit 10 07-01-2009 17:26



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 04:02.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.