Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 07-07-2014, 10:55   #1
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Building O's plug-ins with Codeblocks on Ubuntu

Don't know what to do to build a plug in for OpenCPN. I've gotten Codeblocks installed and can build O on Ubuntu 12.04, but don't know what to do to configure a build for the plug in.

The near term goal is to compile the Lowrance radar plug in to run on my Ubuntu pc on the boat.

This is probably just a configuration issue, but maybe someone who's done this can save me a few hours of blind searching.

Thanks again
dave777 is offline   Reply With Quote
Old 07-07-2014, 17:57   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Dave...
I suppose you are already able to build OpenCPN itself, so all you should need to do is to follow the instructions in README at https://github.com/canboat/BR24radar_pi

After you clone the plugin source, go back to the build directory and do the build as normally - the plugin library (libbr24radar_pi.so) will then be in build/plugins/BR24radar_pi

Assuming you will start in the main OpenCPN source directory, all you should need is
Code:
cd plugins
git clone git://github.com/canboat/BR24radar_pi.git
cd ../build
cmake ..
cmake --build .
sudo cp plugins/BR24radar_pi/libbr24radar_pi.so /usr/lib/opencpn
No need to use CodeBlocks if all you need is to build. The last time I looked at the plug-in, there were some glitches in the GUI apparent on Linux, but I did not look any deeper into it as there is zero radar scanners around my living room.

Pavel
nohal is offline   Reply With Quote
Old 09-07-2014, 12:35   #3
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Re: Building O's plug-ins with Codeblocks on Ubuntu

Quote:
Originally Posted by nohal View Post

Assuming you will start in the main OpenCPN source directory, all you should need is[code]cd plugins
git clone git://github.com/canboat/BR24radar_pi.git
cd ../build
cmake ..
cmake --build .
Hi Pavel,

I had partial success.
(I think that you meant cd .. instead of cmake .. but I really don't know Linux command line or the standard development directory structure)
I was able to rebuild O outside of Codeblocks, but BR24 plug in was not built.
That is to say, the .so file is not in /usr/lib/opencpn

I tried cd to the BR24 plugin directory and typing cmake .. and got a compile error. I think my configuration is wrong, or perhaps I shouldn't have type cd ..
dave777 is offline   Reply With Quote
Old 09-07-2014, 12:43   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Dave...
I meant exactly what I wrote. The plug-in gets built as part of OpenCPN build process, not separately.

Pavel
nohal is offline   Reply With Quote
Old 09-07-2014, 19:24   #5
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Re: Building O's plug-ins with Codeblocks on Ubuntu

Quote:
Originally Posted by nohal View Post
Dave...
I meant exactly what I wrote. The plug-in gets built as part of OpenCPN build process, not separately.

Pavel
IIRC, there was some sort of compile error or file not found issue when I copy and pasted as written. Which is why I guessed there may have been a typo.

Your confirmation of the command gives me something to poke around at.

Thanks again
dave777 is offline   Reply With Quote
Old 09-07-2014, 19:38   #6
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Dave...
If there is an error, we need to see the exact output you get.

Pavel
nohal is offline   Reply With Quote
Old 10-07-2014, 13:07   #7
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Re: Building O's plug-ins with Codeblocks on Ubuntu

Quote:
Originally Posted by nohal View Post
Dave...
If there is an error, we need to see the exact output you get.

Pavel
"Could not load cache" is the error, though all preceding lines completed.

Code:
cmake --build .

Error: could not load cache
dave777 is offline   Reply With Quote
Old 10-07-2014, 13:15   #8
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Dave...
Are you sure you are in the build directory where you have just run
Code:
cmake ..
?


Pavel
nohal is offline   Reply With Quote
Old 10-07-2014, 13:30   #9
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Re: Building O's plug-ins with Codeblocks on Ubuntu

Quote:
Originally Posted by nohal View Post
Dave...
Are you sure you are in the build directory where you have just run
Code:
cmake ..
?


Pavel
yes, the prompt was the same for both.

Code:
~/dev/OpenCPN/build$
Perhaps a prior attempt messed up the directory hierarchy, or the Codeblocks setup created a faulty cmake list?
dave777 is offline   Reply With Quote
Old 10-07-2014, 13:59   #10
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Dave...
The easiest to do, while still being in ~/dev/OpenCPN/build
Code:
rm -rf *
cmake ..
cmake --build .
You have to see something pretty similar to
Code:
nohal@knut:~/source/opencpn/build$ rm -rf *
nohal@knut:~/source/opencpn/build$ cmake ..
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- 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
-- *** Build Architecture is amd64
-- *** Staging to build opencpn 3.3.1824 ***
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so  
-- Found OpenGL...
--     Lib: /usr/lib/x86_64-linux-gnu/libGLU.so/usr/lib/x86_64-linux-gnu/libGL.so/usr/lib/x86_64-linux-gnu/libSM.so/usr/lib/x86_64-linux-gnu/libICE.so/usr/lib/x86_64-linux-gnu/libX11.so/usr/lib/x86_64-linux-gnu/libXext.so
--     Include: /usr/include
-- Found wxWidgets: TRUE  
-- Found wxWidgets...
-- -L/usr/lib/x86_64-linux-gnu;-pthread;-Wl,-z,relro;;-L/usr/lib/x86_64-linux-gnu;;;-lwx_baseu-2.8;-lwx_gtk2u_core-2.8;-lwx_baseu_net-2.8;-lwx_baseu_xml-2.8;-lwx_gtk2u_html-2.8;-lwx_gtk2u_adv-2.8;-lwx_gtk2u_aui-2.8;-lwx_gtk2u_gl-2.8
-- 
-- *** Staging to build opencpn  ***
-- Build type: Release
-- *** Will install to /usr/local  ***
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so  
-- Found GTK2_GTK: /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so  
-- Found GTK2
-- Found Portaudio: /usr/lib/x86_64-linux-gnu/libportaudio.so
-- Portaudio Found
-- Found Gettext: /usr/bin/msgmerge (found version "0.18.3") 
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit in /usr/lib/x86_64-linux-gnu/libbz2.so
-- Looking for BZ2_bzCompressInit in /usr/lib/x86_64-linux-gnu/libbz2.so - found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found TinyXML: /usr/include  
-- Building with tinyxml includes
-- S57 ENC support: enabled
-- Garmin Host Mode support: enabled
-- Compiling texture compression library with sse support
-- 
-- *** Staging to build PlugIns ***
-- *** Staging to build grib_pi ***
-- 
-- *** Staging to build dashboard_pi ***
-- *** Staging to build wmm_pi ***
-- Found OpenGL...
--     Lib: /usr/lib/x86_64-linux-gnu/libGLU.so/usr/lib/x86_64-linux-gnu/libGL.so/usr/lib/x86_64-linux-gnu/libSM.so/usr/lib/x86_64-linux-gnu/libICE.so/usr/lib/x86_64-linux-gnu/libX11.so/usr/lib/x86_64-linux-gnu/libXext.so
--     Include: /usr/include
-- *** Staging to build tiles_pi ***
-- *** Staging to build piman_pi ***
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.37.0") 
-- Writing spec file...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nohal/source/opencpn/build
nohal@knut:~/source/opencpn/build$ cmake --build .
Scanning dependencies of target GARMINHOST
[  0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsapp.c.o
[  0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpscom.c.o
[  0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsmath.c.o
[  0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsmem.c.o
[  1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsprot.c.o
[  1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsread.c.o
[  1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsdevice.c.o
[  1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsdevice_ser.c.o
[  2%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsdevice_usb.c.o
[  2%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsrqst.c.o
........
Pavel
nohal is offline   Reply With Quote
Old 10-07-2014, 15:42   #11
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Re: Building O's plug-ins with Codeblocks on Ubuntu

Code:
rm -rf *
cmake ..
That worked and had similar results ending with

Code:
-- Generating done
-- Build files have been written to: /home/dave/dev/OpenCPN
but same error

Code:
~/dev/OpenCPN/build$ cmake --build .
Error: could not load cache
dave777 is offline   Reply With Quote
Old 10-07-2014, 15:45   #12
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Well... Hard to say why the files are written where they are written, but the solution is obvious:
Code:
cd /home/dave/dev/OpenCPN
cmake --build .
nohal is offline   Reply With Quote
Old 10-07-2014, 15:54   #13
Registered User
 
dave777's Avatar

Join Date: Feb 2011
Posts: 279
Re: Building O's plug-ins with Codeblocks on Ubuntu

Quote:
Originally Posted by nohal View Post
Well... Hard to say why the files are written where they are written
Probably my original download of the source setup for CodeBlocks was atypical.

make build files ok until it got to the br24 stuff and here are the errors:

Code:
[ 77%] Building CXX object plugins/BR24radar_pi/CMakeFiles/br24radar_pi.dir/src/br24radarcontrol.cpp.o
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp: In member function ‘virtual void RadarControlButton::SetValue(int)’:
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:248:60: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:248:60: error: cannot pass objects of non-trivially-copyable type ‘const class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:250:53: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp: In member function ‘virtual void RadarControlButton::SetAuto()’:
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:263:44: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp: In member function ‘int RadarRangeControlButton::SetValueInt(int)’:
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:289:64: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:289:64: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:292:57: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:292:57: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:295:158: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp: In member function ‘void BR24ControlsDialog::UpdateGuardZoneState()’:
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:498:86: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
/home/dave/dev/OpenCPN/plugins/BR24radar_pi/src/br24radarcontrol.cpp:501:86: error: cannot pass objects of non-trivially-copyable type ‘class wxString’ through ‘...’
make[2]: *** [plugins/BR24radar_pi/CMakeFiles/br24radar_pi.dir/src/br24radarcontrol.cpp.o] Error 1
make[1]: *** [plugins/BR24radar_pi/CMakeFiles/br24radar_pi.dir/all] Error 2
make: *** [all] Error 2
dave777 is offline   Reply With Quote
Old 10-07-2014, 16:02   #14
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Building O's plug-ins with Codeblocks on Ubuntu

Dave...
Better. The error is a problem with string formatting we have seen many times before. Windows compiler is a bit less picky than gcc doing the implicit conversions.
Needs a simple addition of .c_str() to all the variables it is complaining about.

Pavel
nohal 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
Changes on the Plug-in Download page & new plug-in packages nohal OpenCPN 8 04-07-2014 07:15
Plug Ins for Mac OSX kas_1611 OpenCPN 40 30-03-2014 07:51
Wood That Won't Warp For Building Entire Kitchen Counter, and Advice On Building Hatc albergsailor Monohull Sailboats 30 25-09-2012 09:15
Plug-ins and ".pot" Gilletarom OpenCPN 2 01-06-2011 13:39
Is There an "Plug Ins for Dummies" Guide? Tom.B OpenCPN 6 22-04-2011 15:24

Advertise Here


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


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.