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 24-10-2014, 01:52   #1
Registered User

Join Date: Oct 2014
Posts: 6
Compiling Plugin for OSX

Hi All,

First there is a problem that I'd like to remedy with the build scripts for the OpenCPN package in that it doesn't create the folder:

~/OpenCPN.app/Contents/PlugIns

But once this is created the plugins are found when the setting pane is open.

Code:
git clone https://github.com/seandepagnier/climatology_pi
cd climatology_pi/
mkdir build
cd build
cmake ..
make
Output from the cmake .. is as follows:

Code:
Hughs-MacBook-Pro:build hmacread$ cmake ..
-- The C compiler identification is AppleClang 6.0.0.6000054
-- The CXX compiler identification is AppleClang 6.0.0.6000054
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- *** Staging to build climatology_pi ***
-- Found wxWidgets: TRUE  
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework  
-- Found OpenGL...
--     Lib: /System/Library/Frameworks/AGL.framework/System/Library/Frameworks/OpenGL.framework
--     Include: /System/Library/Frameworks/OpenGL.framework
-- Found Gettext: /usr/local/bin/msgmerge (found version "0.19.3") 
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5") 
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   climatology_pi

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/hmacread/code/OpenCPN/currentbuild/plugins/climatology_pi/build
Include error from make:

Code:
[ 30%] Building CXX object CMakeFiles/climatology_pi.dir/src/ClimatologyOverlayFactory.cpp.o
In file included from /Users/hmacread/code/OpenCPN/currentbuild/plugins/climatology_pi/src/ClimatologyOverlayFactory.cpp:28:
In file included from /usr/local/include/wx-3.0/wx/wx.h:15:
In file included from /usr/local/include/wx-3.0/wx/object.h:19:
In file included from /usr/local/include/wx-3.0/wx/memory.h:15:
In file included from /usr/local/include/wx-3.0/wx/string.h:46:
/usr/local/include/wx-3.0/wx/strvararg.h:30:18: fatal error: 'tr1/type_traits' file not found
        #include <tr1/type_traits>
                 ^
1 error generated.
hmacread is offline   Reply With Quote
Old 24-10-2014, 03:40   #2
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Compiling Plugin for OSX

Regarding strvararg.h you see:
Quote:
#if defined(HAVE_TYPE_TRAITS)
#include <type_traits>
#elif defined(HAVE_TR1_TYPE_TRAITS)
#ifdef __VISUALC__
#include <type_traits>
#else
#include <tr1/type_traits>
#endif
#endif
So check your config.log build by configure for wxWidgets. You should see something like that:
Quote:
configure:21689: checking type_traits usability
configure:21689: g++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.9 -c conftest.cpp >&5
configure:21689: $? = 0
configure:21689: result: yes
configure:21689: checking type_traits presence
configure:21689: g++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.9 -E conftest.cpp
configure:21689: $? = 0
configure:21689: result: yes
configure:21689: checking for type_traits
configure:21689: result: yes

#define HAVE_TYPE_TRAITS 1
There might be something wrong with your wxWidgets build I suppose.

Again my advise to Mac users: use Xcode and you have help anywhere. Cmake cannot offer this.

Gerhard
CarCode is offline   Reply With Quote
Old 07-11-2014, 02:49   #3
Registered User

Join Date: Jan 2010
Location: Harlingen, NL
Boat: KMY Stadtship 56
Posts: 516
Re: Compiling Plugin for OSX

The traits error occurs if you are trying to build for OSX 10.9 or 10.10 instead of 10.7.

Are you sure you configured wxWidgets with: ../configure --enable-unicode --with-osx-cocoa --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/ --with-macosx-version-min=10.7 --enable-aui --disable-debug --enable-opengl --without-liblzma

and have set

export MACOSX_DEPLOYMENT_TARGET=10.7

before running cmake ../

as instructed on Compiling - Mac OS X | Official OpenCPN Homepage ?

Note that in Xcode I still needed to go to the Project settings and change the deployment target in the UI to 10.7, even when the project was generated for 10.7.
merrimac is offline   Reply With Quote
Old 07-11-2014, 05:15   #4
Registered User

Join Date: Jan 2010
Location: Harlingen, NL
Boat: KMY Stadtship 56
Posts: 516
Re: Compiling Plugin for OSX

Now that I have built my plugin, I ran into the next problem -- the plugin has dependencies on /usr/local/lib/wx*.dylib, but they should be relative to the package path.

For now I'm using install_name_tool to fix up the library after building, but shouldn't this be part of the make process?

for i in `otool -L libbr24radar_pi.dylib | awk '/\/usr\/local\/lib/ { print $1; }'`; do echo $i; install_name_tool -change $i @executable_path/../MacOS/`echo $i | sed 's/3.0.dylib/3.0.0.3.0.dylib/'`; done
merrimac is offline   Reply With Quote
Old 10-11-2014, 05:36   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Compiling Plugin for OSX

That's great you are compiling plugin Climatology, I hope it works out. Please record your steps here and in the development manual for others, so that the process can be repeated and improved. Thanks.
rgleason is offline   Reply With Quote
Reply

Tags
plug


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 and Mac OSX mskl OpenCPN 9 27-03-2014 08:41
Connecting IP AIS on OSX baerentp OpenCPN 14 26-07-2012 15:24
GPSD not working - OSX baerentp OpenCPN 20 17-07-2012 15:42
OpenCPN 2.5 (Mac OSX) Crashes on Start Up ? farmerboy OpenCPN 4 31-12-2011 04:55
OpenCPN on Mac OSX 10.7 (Lion) jeroen OpenCPN 1 11-10-2011 09:16

Advertise Here


All times are GMT -7. The time now is 11:15.


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.