Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 03-02-2012, 14:22   #1
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Trying to Build Mac Version

And the link to the xcode project is MIA. Any help?

FWIW, I'm a developer interested in getting my hands dirty on mac and ios versions.
AuroraGH is offline   Reply With Quote
Old 03-02-2012, 22:25   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

AuroraGH...
There's no xcode project - cmake should generate it for you.
Follow the instructions at Compiling - Mac OS X | Official OpenCPN Homepage
I'm not sure whether it's up to date or whether it works at all with the current codebase, but it should get you at least to a point where we can try to help you.

Pavel
nohal is offline   Reply With Quote
Old 04-02-2012, 04:16   #3
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Re: Trying to Build Mac Version

Quote:
Originally Posted by nohal View Post
AuroraGH...
There's no xcode project - cmake should generate it for you.
Follow the instructions at Compiling - Mac OS X | Official OpenCPN Homepage
I'm not sure whether it's up to date or whether it works at all with the current codebase, but it should get you at least to a point where we can try to help you.

Pavel
OK, so why is this on that page:


There is now a much more complete build that includes plugins, language and has fixed the toolbar problem.
It uses the MacPorts library & packages the dylibs into the app bundle so that it is self-contained.
The Xcode project files can be downloaded from here. To set up the build environment for this follow these steps:

1. Install Mac Developer Tools (Xcode)
2. Install MacPorts.
3. Open terminal window and then:
sudo port selfupdate
sudo port install glib2 +universal
sudo port install wxwidgets +universal
4. Start Xcode and open OpenCPN.xcodeproj in the sources build directory.

It is also possible to build a Mac OS X version of OpenCPN using the current 2.3.1 release sources, although with
limited functionality. It uses the libwx_macud-2.8 libraries that are distributed with Snow Leopard. This build does
not include any plugins and the toolbar overlays the chart display.
AuroraGH is offline   Reply With Quote
Old 04-02-2012, 04:36   #4
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Re: Trying to Build Mac Version

Quote:
Originally Posted by nohal View Post
AuroraGH...
There's no xcode project - cmake should generate it for you.
Follow the instructions at Compiling - Mac OS X | Official OpenCPN Homepage
I'm not sure whether it's up to date or whether it works at all with the current codebase, but it should get you at least to a point where we can try to help you.

Pavel
Nevermind, figured out how to generate the xcode project. That page needs editing though.

However, now I get errors on several files in several targets - generally looking like:

clang: error: unsupported option '--cflags'
clang: error: unsupported option '--libs'
clang: error: no such file or directory: '`pkg-config'
clang: error: no such file or directory: 'gtk+-2.0`'
Command /Developer/usr/bin/clang failed with exit code 1

Snow Leopard 10.6.8

Tried the LLVM GCC 4.2, it fails for a whole host of other reasons, mostly complaining about unknown command line options fcflags and flibs.

Some targets build, but grib_pi, among others, does not.
AuroraGH is offline   Reply With Quote
Old 04-02-2012, 05:33   #5
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

AuroraGH...
Because we have exactly 0 Mac developers who take care of updating the wiki?
Please use the steps for cmake build and get to me with a problem I can perhaps help you with. Providing a .xcodeproj file is unfortunately not such a thing.

Thanks

Pavel
nohal is offline   Reply With Quote
Old 04-02-2012, 10:47   #6
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Re: Trying to Build Mac Version

Quote:
Originally Posted by nohal View Post
get to me with a problem I can perhaps help you with.
Any ideas on the compiler errors above?
AuroraGH is offline   Reply With Quote
Old 04-02-2012, 23:10   #7
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

Aurora...
Which source tree are you trying to build? If not latest from git, please switch to it as it's the only one that matters.
The following please don't take for granted, I really have never touched a Mac in my life...
GCC is our compiler on Linux and I would suppose it will make way less problems than CLang on a Mac.
Which other targets are not building and what's the exact output from the build? If I were you, I would not be very worried about grib_pi - it needs some work on other platforms as well.

There is some (outdated and abandoned) Mac specific work done in the following places:
https://github.com/patg/OpenCPN
https://github.com/OpenCPN/OpenCPN/tree/macosx
https://github.com/balp/OpenCPN/tree/macos_snowleopard
Some of it has probably been submitted and integrated into the trunk, but I really don't know which parts.

It would be great if you could update the Mac build instructions in the wiki if you manage to succeed.

Thanks for patience

Pavel
nohal is offline   Reply With Quote
Old 05-02-2012, 01:58   #8
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Trying to Build Mac Version

Quote:
Originally Posted by nohal View Post
Because we have exactly 0 Mac developers who take care of updating the wiki?
There have been a lot of Mac developers in the past which all tries to help bcat.
They all have abandoned the project. I better don't talk about the reasons why...
CarCode is offline   Reply With Quote
Old 05-02-2012, 02:29   #9
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

Gerhard...
Nice to see you around. As far as I understood from your comments a while back in another thread, you are able to build on MacOS. It would be very nice if you could share some info with us poor people just starting or not having this system at hand at all.

TIA

Pavel
nohal is offline   Reply With Quote
Old 05-02-2012, 17:32   #10
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Re: Trying to Build Mac Version

Quote:
Originally Posted by nohal View Post
GCC is our compiler on Linux and I would suppose it will make way less problems than CLang on a Mac.
There is a GCC fronted clang, that produces even more "errors" although all of the errors are complaints about invalid compiler flags. Seems like that ought to be a warning.

Most failures look kind of like this:

CompileC build/OpenCPN.build/Debug/GARMINHOST.build/Objects-normal/x86_64/gpsprot.o src/garmin/jeeps/gpsprot.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/AuroraGH/Projects/opencpn
setenv LANG en_US.US-ASCII
/Developer/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -O2 -Wno-return-type -Wparentheses -Wswitch -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-shorten-64-to-32 "-DCMAKE_INTDIR=\"Debug\"" -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -DUSE_GLU_TESS -DUSE_S57 -DUSE_GARMINHOST -isysroot /Developer/SDKs/MacOSX10.6.sdk -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -Wno-sign-conversion -I/Users/AuroraGH/Projects/opencpn/build/Debug/include -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/wx-2.8 -I/Users/AuroraGH/Projects/opencpn/include -I/Users/AuroraGH/Projects/opencpn/src -I/Users/AuroraGH/Projects/opencpn/src/nmea0183 -I/Users/AuroraGH/Projects/opencpn/src/mygdal -I/Users/AuroraGH/Projects/opencpn/src/garmin/jeeps -I/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include -I/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/GL -I/Users/AuroraGH/Projects/opencpn/build/OpenCPN.build/Debug/GARMINHOST.build/DerivedSources/x86_64 -I/Users/AuroraGH/Projects/opencpn/build/OpenCPN.build/Debug/GARMINHOST.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/AuroraGH/Projects/opencpn/build/Debug -arch i386 -O2 -arch i386 -Wall -fexceptions -rdynamic -g -fno-strict-aliasing "`pkg-config" --cflags --libs "gtk+-2.0`" -MMD -MT dependencies -MF /Users/AuroraGH/Projects/opencpn/build/OpenCPN.build/Debug/GARMINHOST.build/Objects-normal/x86_64/gpsprot.d -c /Users/AuroraGH/Projects/opencpn/src/garmin/jeeps/gpsprot.c -o /Users/AuroraGH/Projects/opencpn/build/OpenCPN.build/Debug/GARMINHOST.build/Objects-normal/x86_64/gpsprot.o

clang: error: unsupported option '--cflags'
clang: error: unsupported option '--libs'
clang: error: no such file or directory: '`pkg-config'
clang: error: no such file or directory: 'gtk+-2.0`'

grib-i18n - ok
GARMINHOST - fails
grib-pot-update - ok
NMEA0183 - fails
dashboard-i18n - ok
dashboard-pi - fails
dashboard-po-update - fails
po-update - ok
grib-po-update - ok
S57ENC - fails (Verify exit code of build task 'CompileC mygeom.cpp'
Build task failed without generating error messages.)
grib-pi - fails
pot-update - fails
i18n - ok
dashboard-pot-update - ok
AuroraGH is offline   Reply With Quote
Old 05-02-2012, 23:29   #11
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

Aurora...
Try commenting out line 163 in CMakeLists.txt
It should say:
Code:
ADD_DEFINITIONS("`pkg-config --cflags --libs gtk+-2.0`")
Pavel
nohal is offline   Reply With Quote
Old 06-02-2012, 09:19   #12
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Thumbs up Re: Trying to Build Mac Version

Quote:
Originally Posted by nohal View Post
Aurora...
Try commenting out line 163 in CMakeLists.txt
It should say:
Code:
ADD_DEFINITIONS("`pkg-config --cflags --libs gtk+-2.0`")
Pavel
Oh that was excellent advice. The next trick is to specify building for 32 bit architectures rather than my native 64 because a few of the bundled libraries are only compiled for 32 bit. With that I get very far indeed with only a single link error.

Undefined symbols for architecture i386:
"_int_locate_endpoint_a", referenced from:
_int_construct_trapezoids in libS57ENC.a(tri.o)
_int_add_segment in libS57ENC.a(tri.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

which I manage to fix by removing the inline declaration from the function (seems the definition is not available soon enough for certain callers to be inlined but I was unable to make it all work by moving it around in the file.

And so I have a build that runs and generates an endless stream of assertion failed modal dialogs from wxwidgets. At least I have something to debug now.

Thanks for your help.
AuroraGH is offline   Reply With Quote
Old 06-02-2012, 09:51   #13
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

Aurora...
Good that you are going. I suppose there are more tricks about the Mac build, as it's possible to build a version that actually works to some (for some of course unsatisfiable) extent. But I'm unfortunately not able to tell you how it's done. Anyway, Dave should be back in the reach of internet in a couple of weeks, so if no Mac devs around here will have compassion until then, he will sure be able to tell you how he built the 2.6.1223 beta.

Pavel
nohal is offline   Reply With Quote
Old 12-02-2012, 19:03   #14
Registered User

Join Date: Feb 2012
Location: La Paz, Mexico
Boat: Cape George 36
Posts: 127
Images: 3
Re: Trying to Build Mac Version

FWIW, I have made a couple changes to a couple files that allow the project to be built more or less "out of the box" on Snow Leopard. I would be pleased to see them integrated into the main build. I have created a pull request from my project.

I still get massive numbers of complaints from wxwidgets though. Is this "normal"?
AuroraGH is offline   Reply With Quote
Old 12-02-2012, 22:55   #15
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Trying to Build Mac Version

AuroraGH...
On Windows and Linux, there are no complaints from wxWidgets at all, so as far as I can tell it's not normal. What are they about?
Thanks for the patch, will have a look at it later today.

Pavel
nohal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Version 2.6 Beta Build 1310 bdbcat OpenCPN 79 16-02-2012 02:22
OpenCPN Version 2.6 Beta Build 1223 bdbcat OpenCPN 38 30-12-2011 05:38
OpenCPN Version 2.4 Beta Build 628 bdbcat OpenCPN 63 15-07-2011 18:17
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31
OpenCPN Version 2.4 Beta Build 708 bdbcat OpenCPN 34 12-07-2011 13:20

Advertise Here


All times are GMT -7. The time now is 13:35.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.