Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 30-12-2014, 18:16   #226
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,253
Re: Development Debugging Environment - Setup Help

Process:
github.com/OpenCPN ---> c:/github/OpenCPN ---> github.com/[User]/OpenCPN

Then if you have created Commits to contribute
github.com[User]/Opencpn --> github.com/OpenCPN

==========
To start over, I removed my Local Opencpn Repository using git.
Then deleted my github fork of opencpn github.com/rgleason/OpenCPN by going to
https://github.com/rgleason/OpenCPN/settings
Go down to the danger zone
"Delete this repository" , since I had not contributed any code.
------------
To Establish your own github.com/[User]/OpenCPN repository.
Go to https://github.com/OpenCPN/OpenCPN
Pick "Fork" at the top right and fork it to your local repository
https://github.com/[user]/OpenCPN/
------------
Provided you have installed the desktop program 'GitHub'
Start Github and hit the + and Clone Opencpn to your local github directory
otherwise from the command prompt, navigate to your local github directory and issue:
Code:
git clone git://github.com/[User repository]/Opencpn.git
-------
Code:
git checkout master
git branch -v         [make sure HEAD is on *master]
Code:
C:\..\GitHub\OpenCPN>git remote -v
origin  https://github.com/rgleason/OpenCPN.git (fetch)
origin  https://github.com/rgleason/OpenCPN.git (push)
Only if you do NOT have an upstream branch (see verify below)
Code:
C:\..\GitHub\OpenCPN>git remote add upstream https://github.com/OpenCPN/OpenCPN.git
Verify Upstream branch exists
Code:
C:\..\GitHub\OpenCPN>git remote -v
origin  https://github.com/rgleason/OpenCPN.git (fetch)
origin  https://github.com/rgleason/OpenCPN.git (push)
upstream        https://github.com/OpenCPN/OpenCPN.git (fetch)
upstream        https://github.com/OpenCPN/OpenCPN.git (push
======
If you already have an upstream branch to the origin as above and want to track it, do this once to establish the link as Pavel suggests. Go to Start > All Programs > Git Shell which brought up "Windows PowerShell" (normal CMD did not work for me).
Code:
C:\Users\..\GitHub\OpenCPN [master +18 ~0 -0 !]> git fetch upstream
C:\Users\..\GitHub\OpenCPN [master +18 ~0 -0 !]> git branch -u upstream/master master 
Branch master set up to track remote branch master from upstream.
and then regularly
Code:
git pull       [To update your local repository from upstream]
git push origin master  [Update your copy on github]
----
Reference

Pavel (above)

Then configure an upstream remote for a fork
https://help.github.com/articles/con...te-for-a-fork/

Syncing a Fork
https://help.github.com/articles/syncing-a-fork/

=======
Summary of Process

1. Github.com/Opencpn/Opencpn

'git pull' updates
2. C:/user/../github/OpenCPN [updated

'git push origin master' updates
3. Github.com/[User]/OpenCPN

push commit, if helping to code offer update to
4. Github.com/Opencpn/Opencpn
__________________

__________________
rgleason is offline   Reply With Quote
Old 02-01-2015, 15:54   #227
Registered User

Join Date: Dec 2014
Posts: 9
Re: Development Debugging Environment - Setup Help

OpenCPN in Code::Blocks...

Everything builds and runs including the plugins...I can set breakpoints in the OpenCPN application proper, however when I set breakpoints in the plugins I get the below. The file(s) are there at /home/eric/OpenCPN/plugins/grib_pi/src/grib_pi.cpp...so I am guessing they are not getting compiled with debug info...or that info is not being found by the debugger...been looking for a couple of days..any ideas

[debug]> break "/home/eric/OpenCPN/plugins/grib_pi/src/grib_pi.cpp:386"
[debug]No source file named /home/eric/OpenCPN/plugins/grib_pi/src/grib_pi.cpp.
[debug]Breakpoint 3 ("/home/eric/OpenCPN/plugins/grib_pi/src/grib_pi.cpp:386") pending.
[debug]>>>>>>cb_gdb:
__________________

__________________
ewzachmann is offline   Reply With Quote
Old 02-01-2015, 16:08   #228
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Development Debugging Environment - Setup Help

ewzachmann...
Two things to check:
Are you sure you are loading the debug version of the plugin and not one you have installed in /usr (= you have modified the core so that m_plugin_location has a value of "/home/eric/OpenCPN/build/plugins/grib_pi") when you put a breakpoint at line 238 in pluginmanager.cpp)? You can check the same by simply looking at the logfile.

Are you sure the plugin is properly rebuilt (they don't get compiled when you build the "opencpn" project in CodeBlocks)?

Pavel
__________________
nohal is offline   Reply With Quote
Old 02-01-2015, 16:08   #229
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,253
Re: Development Debugging Environment - Setup Help

Pavel [Nohal] will have an answer. Since the plugins were changed to compile as standalone, I have been doing that.

You could try doing that, making sure the correct opencpn.lib file is in the build directory... you will find them in the sourceforge opencpnplugins directory, then from the plugin main directory cmd window
mkdir build
cd build
cmake ..
cmake --build . ----> creates debug dll
cmake --build . --config release --->creates run dll.

Find the debug dll and copy that and any data files into the build/plugin directory then you should be able to debug...

There is a thread on this... and we should probably document the process of compiling plugins using standalone versions (which Pavel I believe just added that feature, so it should work integrated too)...
Plugin Distribution - Page 3 - Cruisers & Sailing Forums

Maybe Pavel with have a suggestion ..

-- He beat me!

Sometimes you need to delete the old dll under debug/plugins.
__________________
rgleason is offline   Reply With Quote
Old 02-01-2015, 17:43   #230
Registered User

Join Date: Dec 2014
Posts: 9
Re: Development Debugging Environment - Setup Help

20:37:43 EST: PlugInManager searching for PlugIns in location /usr/local/lib/opencpn

from opencpn.log...so that is it...my built plugin(s) are in...

/home/eric/OpenCPN/build/plugins/grib_pi

as you suggested...so how do you set the plugin directory if you want to be able to debug all the plugins?

Maybe I'm not doing this right? What is the better way to debug plugins?

Thanks
E
__________________
ewzachmann is offline   Reply With Quote
Old 02-01-2015, 17:58   #231
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Development Debugging Environment - Setup Help

E...
My "standard" way to debug plugins directly from the IDE while working on them is to simply add
Code:
m_plugin_location = _T("/home/eric/OpenCPN/build/plugins/grib_pi");
to pluginmanager.cpp, line 237
If I need to debug more than one at a time, I copy the relevant libXXX_pi.so to that path.
I admit, not overly elegant, but so far not annoying enough to resolve it completely in the core...

Pavel
__________________
nohal is offline   Reply With Quote
Old 03-01-2015, 06:26   #232
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,253
Re: Development Debugging Environment - Setup Help

That sounds like a decent way to do it Pavel,
The following is for Windows.

If compiling using MSVC++ and plugins with main program
Example:
Path to Debug dll
C:\..\GitHub\OpenCPN\build\plugins\grib_pi\Debug\g rib.dll
Which has to be copied two directories up into
C:\..\GitHub\OpenCPN\build\plugins

When compiling Plugins as Standalone or Independent Compile
For Climatology, for Example, from
C:\..\o-plugin\

git clone git://github.com/seandepagnier/climatology_pi.git

cd C:\..\o-plugin\climatology_pi

mkdir build

Then copy the Opencpn-3-2-2.lib into the build directory.
Find the file here
Sourceforge opencpnplugins -
Browse /opencpn_lib/3.2.2 at SourceForge.net

Then from
C:\..o-plugin\climatology_pi\build
compile normally.

If you have NSIS installed you can make the plugin into a package exe.
__________________
rgleason is offline   Reply With Quote
Old 03-01-2015, 06:59   #233
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Development Debugging Environment - Setup Help

Rick...
Your post might be a bit confusing and not much to the point.
When doing the same thing on Windows (debugging a plugin inside an IDE without having to copy stuff all over the place all the time), you have to do exactly the same as on Linux, add one line to pluginmanager.cpp. The only difference is the format of the path - it looks like
Code:
m_plugin_location = _T("C:\\OpenCPN\\build\\plugins\\grib_pi\\Debug");
Mixing the "standalone" package build procedure into it is plain unfortunate - in that case you can't debug anything at all...

Pavel
__________________
nohal is offline   Reply With Quote
Old 03-01-2015, 07:02   #234
Registered User

Join Date: Dec 2014
Posts: 9
Re: Development Debugging Environment - Setup Help

Thanks Pavel,

That is pretty much what I thought...and it is workable. YAQ (Yet Another Qestion): I've used eclipse for many years, but it has been easier to get Code::Blocks running for OpenCPN. However, I am not understanding how to view/change variables for an object...or even in a function. I've used the Watch window, but something does not seem right there is that when I start the watch there is "" in the watch variable. I'm using Code::Blocks 13.12 in linux. I've found documentation for Code::Blocks 10.xx but that has been little help.

Eric
__________________
ewzachmann is offline   Reply With Quote
Old 03-01-2015, 07:28   #235
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,253
Re: Development Debugging Environment - Setup Help

Quote:
Mixing the "standalone" package build procedure into it is plain unfortunate - in that case you can't debug anything at all...
Sorry if I was not clear. I just wanted to get the Standalone Independent Plugin Compile into to thread, did not intent to confuse people. Thanks for the added windows line above.
__________________
rgleason is offline   Reply With Quote
Old 03-01-2015, 07:34   #236
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Development Debugging Environment - Setup Help

Eric...
When you set a breakpoint and reach it, you should see something like this.
You can edit the variable values in the second column.
To get m_pGribDialog (or any other pointer type) properties, I had to right-click on it and select "Dereference m_pGribDialog".
If you think the values are not there and they should, there is an "Update" option in the right-click menu in Watches window.
At least this is how CB works for me - I always use the nightlies from
Code:
deb http://apt.jenslody.de/testing jessie main
but it should make no difference.

Pavel
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2015-01-03 09:25:14.png
Views:	66
Size:	109.9 KB
ID:	94797  
__________________
nohal is offline   Reply With Quote
Old 05-01-2015, 16:06   #237
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 3,489
Re: Development Debugging Environment - Setup Help

I am trying to move my build environment from Vista to a Windows 7 machine. I have run into an issue where I downloaded the latest version of CMake but it does not find wxWidgets 2.8.12 (I have set WXWIN environment variable to the right folder). I looked at the cmake text files and they list several versions of wxWidgets up to 2.8.9 but version 2.8.12 is not found in the cmake files. Has anyone encountered this before?
__________________
transmitterdan is offline   Reply With Quote
Old 05-01-2015, 16:19   #238
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Development Debugging Environment - Setup Help

transmitterdan...
Is C:\${WXDIR}\lib\vc_dll in your PATH? Did you restart the VS terminal since adding it there? Did you build both the Debug and Release version of wxWidgets?
If done all of the above, try purging your build directory, especially CmakeCache.txt

The version is not a problem, 2.8.12 is found just fine on W7 if you did everything right according to the build instructions.

Pavel
__________________
nohal is offline   Reply With Quote
Old 05-01-2015, 17:42   #239
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 3,489
Re: Development Debugging Environment - Setup Help

Pavel,

Thank you for the reply.

Quote:
Is C:\${WXDIR}\lib\vc_dll in your PATH?
My path includes this variable C:\wxWidgets-2.8.12\lib\vc_dll and that folder really exists. Also this variable exists:

WXWIN=C:\wxWidgets-2.8.12
Quote:
Did you restart the VS terminal since adding it there?
Yes.
Quote:
Originally Posted by nohal View Post
Did you build both the Debug and Release version of wxWidgets?
Yes, and they built with no errors.
Quote:
Originally Posted by nohal View Post
If done all of the above, try purging your build directory, especially CmakeCache.txt
Tried that but no help. I think it is an issue with Cmake V3.1. This is the output I see:

C:\Storage\opencpn\master\OpenCPN\build>cmake -G "Visual Studio 10" ..
-- *** Build Architecture is i386
-- *** Staging to build opencpn 3.3.2503 ***
-- *** Package will include documentation ***
-- *** Package will include GSHHS basechart level: CRUDE ***
-- *** Package will include tide and current data ***
-- Found OpenGL...
-- Lib: glu32opengl32
-- Include:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find wxWidgets (missing: wxWidgets_FOUND)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindwxWidgets.cmake:870 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:286 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!


I think the problem is in FindwxWidgets.cmake. Here is an extract and I see than 2.8.12 is no where listed anymore:

PATH_SUFFIXES
wxWidgets-3.0.2
wxWidgets-3.0.1
wxWidgets-3.0.0
wxWidgets-2.9.5
wxWidgets-2.9.4
wxWidgets-2.9.3
wxWidgets-2.9.2
wxWidgets-2.9.1
wxWidgets-2.9.0
wxWidgets-2.8.9
wxWidgets-2.8.8
wxWidgets-2.8.7
wxWidgets-2.8.6
wxWidgets-2.8.5
wxWidgets-2.8.4
wxWidgets-2.8.3
wxWidgets-2.8.2
wxWidgets-2.8.1
wxWidgets-2.8.0
wxWidgets-2.7.4
wxWidgets-2.7.3
wxWidgets-2.7.2
wxWidgets-2.7.1
wxWidgets-2.7.0
wxWidgets-2.7.0-1
wxWidgets-2.6.4
wxWidgets-2.6.3
wxWidgets-2.6.2
wxWidgets-2.6.1
wxWidgets-2.5.4
wxWidgets-2.5.3
wxWidgets-2.5.2
wxWidgets-2.5.1
wxWidgets
__________________
transmitterdan is offline   Reply With Quote
Old 05-01-2015, 18:07   #240
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Development Debugging Environment - Setup Help

Don't think so, it works just fine here and if you look a little higher in the same file you will see
Code:
 # Look for an installation tree.
  find_path(wxWidgets_ROOT_DIR
    NAMES include/wx/wx.h
    PATHS
      ENV wxWidgets_ROOT_DIR
      ENV WXWIN
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]"  # WX 2.6.x
      C:/
      D:/
      ENV ProgramFiles
You can try to also set the wxWidgets_ROOT_DIR environment variable to C:\wxWidgets-2.8.12 (Although it is definitely not needed on my machines)

All this of course assumes that you actually have wxWidgets in C:\wxWidgets-2.8.12

I have just upgraded my cmake from some earlier beta to 3.1 final, purged the build dir and tested if it still works and it does.

Good luck

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Reply

Tags
environment

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



Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 19:44.


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.