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 25-09-2012, 08:13   #91
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Development Debugging Environment - Setup Help

The source tree is only updated by git commands, such as "git fetch" or "git reset".
Builds do not modify the source tree at all, it only works inside the build folder.

A build will update all executable files in the build folder to the latest versions from the source tree. But static data files that are not part of the build process (the 4 folders I mentioned earlier) are not touched by a build. So when new versions of the files in those arrive via Git, you need to update them manually from the source tree to your build folder. (And of course, when starting from scratch with a completely empty build folder, you need to create/copy those static data file folders manually)

One example of this: When you "git fetch"-ed the new version of the Options window earlier, you got new versions of the uidata files, and a lot of updates to the C++ source files. A build will then compile the new C++ files, and put the result in your build folder. Running this build will get you the new Options window, but the icons will be missing since you are running with an old version of styles.xml and toolicons_xxx. Copying the new versions manually from the source tree to the build folder now gives you the correct icons.
JesperWe is offline   Reply With Quote
Old 25-09-2012, 11:11   #92
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Thats very helpful, I am trying to create an additional help document on this.
Two questions:

Saving gshhs....What is this about? I don't think I had to do anything about this to get Debug Opencpn working. ...I found two locations with gshhs... Why save it? What should be saved or copied?
From: C:\<data-dir>\opencpn-git\data\gshhs
To: C:\<data-dir>\opencpn-git\build\opencppn.dir\Debug
[gshhs.obj]


Also about git, I've been reading, commits and versions can be complicated.
Problem how to stop the listings under git log and git show ?
Hit <enter> to continue the listings and <cntrl-c> and <enter> to bring up a command prompt?
Or just try executing another git command at the ":" colon or the path prompt?
What I am trying to figure out right now is how to see how current my local git repository is compared to the master? Do you know such a command? Does it have something to do with git diff? ...but I have to know what the last commit is that I have don't I?
rgleason is offline   Reply With Quote
Old 25-09-2012, 11:19   #93
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Looking for appropriate reference for the writeup
git-diff(1) - Linux man page
git diff [--options] --cached [<commit>] [--] [<path>...] This form is to view the changes you staged for the next commit relative to the named <commit>. Typically you would want comparison with the latest commit, so if you do not give <commit>, it defaults to HEAD. --staged is a synonym of --cached.

So, we should issue a command of git diff --cached (since there is no <commit> listed it defaults to HEAD?
rgleason is offline   Reply With Quote
Old 25-09-2012, 11:45   #94
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Development Debugging Environment - Setup Help

gshhs is the "Global Self-consistent, Hierarchical, High-resolution Shoreline Database"
This is where the data files for the world background are

C:\<data-dir>\opencpn-git\data\gshhs <-- Source tree original from Git
C:\<data-dir>\opencpn-git\build\opencppn.dir\Debug\gshhs <-- In build folder. This is where your Debug build will look for the files.

"git diff master origin/master" should give you what you're looking for.
JesperWe is offline   Reply With Quote
Old 25-09-2012, 11:45   #95
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Jesper, I just found this dialogue which was very helpful. Will try to condense it...

If your "git fetch --all" command is not updating to a newer beta version try the following:


How would I change the commands to fetch 3.1.915 given it is in https://github.com/OpenCPN/OpenCPN Branch: beta31_stable?
The "master" branch contains all the stuff of the "beta31_stable", plus the additional fixes after the beta.
So if you are on "master" you should see 3.1.914 when running.
git status
...will tell you which branch you are on.

If you're not on master you can
git branch master
git checkout master

And by the way, there is no need to rerun cmake every time you pull new stuff from github.
All you need to do is "git fetch", go to Visual Studio and "build"
---

Thank you Jesper for the help.

Went to:
cmd prompt
cd to opencpn-git directory
git status
Responds:
#On branch master
# Your branch is behind "origing/master" by 31 commits, and can be fast-forwarded
#
# Untracked files ...with a list
# nothing to add to commit but untracked files present (use "git add" to track)

Tried:
git branch master
Responded: fatal: a branch named 'master' already exists.

git fetch
Responded: remote: counting objects: 22, done. Then compressed and unpacked them, done....
Then it shows:
From git://github.com/OpenCPN/OpenCPN 92f9565..0651fbb master -> origin/master

git status
#On branch master
# Your branch is behind "origin/master" by 34 commits and can be fast-forwarded.
# untracked files....

Open MS VSC++ and pick Debug - Build Solution
Then pick Debug - Start Debugging
OpenCPN 3.1.814 comes up.
Stopped debugging

Highlight OpenCPN in Solution Explorer
Then pick Debug - Build Solution ...5 succeeded 0 failed...
Then pick Debug - Start Debugging ... yes to popup...
OpenCPN 3.1.814 comes up again.

What did I miss I wonder.
---
Try in cmd prompt
git fetch --all
Responds: Fetching origin. ... but no more downloads.
---
You missed the "Your branch is behind "origin/master" by 34 commits and can be fast-forwarded."
Seems you have a specific commit checked out and thus "git fetch" fetches new commits but doesn't apply them to your working directory.
Try a "git merge master"
---
Tried git merge master
Response: Already up to date.
---
OK, you can try this:

git reset --hard origin/master

...it's a bit hard for me to know since I don't know how you got to where you are.
If this doesn't help you will need to google for a solution on how to get your local git repo in sync with master.
---
It worked! Thank you!
Now I can see what everyone likes so much and give it a run.

-----
Last Resort to get it working - Start over!
If you cannot get your MS VS C++ OpenCPN.sln Project to run properly under "Debug mode" after selecting "Clean" and then "Rebuild" Jesper suggests as a final solution, you should go back to scratch:
1. Delete everything in your build directory except the 4 folders uidata, gshhs, s57data and share.
2. Go "cmake -G "Visual Studio 10" .." from there again and now you have a clean OpenCPN.sln solution you can open in VS2010 and build again.
Rick adds - If that does not work, you could start completely over by
1. Saving the 4 directories Jesper listed above.
2. Then deleting opencpn-git.
3. Then issuing the appropriate git clone command to re download
using the Open Visual Studio Command Prompt

cd C:/<data-directory>OpenCpn-git directory.
Then execute: git clone git://github.com/OpenCPN/OpenCPN.git

See
Thread Note #74 #post1023683 for more information.
rgleason is offline   Reply With Quote
Old 25-09-2012, 16:28   #96
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Copied all files and directories
From: C:\Data-Dart\Up-Soft\Navigation\opencpn-git\data\gshhs
To: C:\<data-dir>\opencpn-git\build\opencpn.dir\Debug\gshhs
MS VS C++2010 Rebuild opencpn.

Still can not get blue map outline even after force full rebuild charts several times and then set a chart path to: C:\<data-dir>\opencpn-git\build\opencpn.dir\Debug\gshhs, force full rebuid, and then try to create an Outline Chart Group and assign gshhs to that (That does not work -message chart group is empty go to all charts). There seems to be no way to get the blue gshhs outline to show up, even selecting limited BSB Group and zooming out.

No problems showing the blue map outline from gshhs in 3.0.2 even though I can't find the gshhs directory under Program Files(x86)/Opencpn or under ProgramData/Opencpn.
Code:
...         opencpn.dir\Debug\gshhs.obj
...
       FinalizeBuildStatus:
         Deleting file "opencpn.dir\Debug\opencpn.unsuccessfulbuild".
         Touching "opencpn.dir\Debug\opencpn.lastbuildstate".
     1>Done Building Project "C:\Data-Dart\Up-Soft\Navigation\opencpn-git\build\opencpn.vcxproj" (rebuild target(s)).

Build succeeded.

Time Elapsed 00:01:08.22
Any ideas about what am I doing improperly? See attached gshhs-blue-map-opencpn.log
Attached Files
File Type: doc gshhs-blue-map-opencpn.log.doc (13.0 KB, 73 views)
rgleason is offline   Reply With Quote
Old 25-09-2012, 17:32   #97
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Development Debugging Environment - Setup Help

Couple of points:

- 3.0.2 doesn't have gshhs, just the blue lines. Gshhs is new for 3.1

- Gshhs is not a chart. It can't and shouldn't be loaded in the charts window. It should load automatically.

- If it doesn't, it's your program run log (c:\ProgramData\opencpn\opencpn.log) that can maybe tell you why, not the build log. Gshhs files are just static data, not involved in the build.

The run log should have something like:
5:34:17 PM: Loading World Chart Q=4 in 873 ms.
5:34:17 PM: Background world map loaded from GSHHS datafiles found in: D:\OpenCPN\Mainline\build\Release\gshhs\

- And finally as a general observation you could save some CPU cycles by not running rebuilds in VS2010 for every problem. A Build is usually fine and a lot faster. Rebuild is only needed if you have managed to confuse VS2010 somehow.
JesperWe is offline   Reply With Quote
Old 25-09-2012, 20:18   #98
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Thanks, Still have lots to learn!
Run log from current setup, no changes.
Program run log (c:\ProgramData\opencpn\opencpn.log)
Code:
7:16:59 PM: ChartDB Cache policy:  Application target is 1024 MBytes
7:16:59 PM: Loading chart db version: V017
7:16:59 PM: Chartdb: Chart directory list follows
7:16:59 PM:   Chart directory #0: C:\Data-Dart\BSB_ROOT\03Region
7:16:59 PM:   Chart directory #1: C:\Data-Dart\CM93ed2_2010May31
7:16:59 PM:   Chart directory #2: C:\Data-Dart\Up-Soft\Navigation\opencpn-git\build\opencpn.dir\Debug\gshhs  (--going to delete)
7:16:59 PM: GPS Watchdog Timeout is: 6 sec.
7:16:59 PM: Unable to initialize background world map. No GSHHS datafiles found in C:\Data-Dart\Up-Soft\Navigation\opencpn-git\build\gshhs\   (--moving gshhs directory up to build folder)
7:16:59 PM: Loading World Chart Q=0 in 0 ms.
7:16:59 PM: GSHHS World chart files have wrong version. Found -842150451, expected 210-220.
7:16:59 PM: Loading World Chart Q=0 in 0 ms.
Just tried the gshhs changes and it works! ...that's much better than blue edge representation. I assume it's a reasonably accurate coastal edge representation up to a certain scale (27730). I notice it increases detail as you zoom down. Perhaps it will get better and more detailed over time.
I'll change the path To: appropriately in the writeup.

Ok will generally run Builds in MS VS C++2010 unless there's a problem.
rgleason is offline   Reply With Quote
Old 25-09-2012, 20:41   #99
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Jesper wrote:
Quote:
So when you build your Debug, those steps are not done, and you need to do it manually.

When at some later point styles.xml or others are updated in Git, and you pull the updates, they update your source tree, but your manually copied copies do not update. So you need to copy them again.

The same goes for all content in the folders uidata, s57data, gshhs and share.
One more question to finish the topic of directories that need to be copied.

What is the share directory for and why does it need to be copied?
-Doc and locale including copyright, and message files?

C:\Program Files (x86)\OpenCPN\share --does exist same for 3.1.814 and 3.1.919

C:\<data-dir>\opencpn-git <-- can't find Share anywhere in here and it is not under build either.

Should I copy it all somewhere?
Also what about folders like sounds (alarms) and tcdata (tides),
rgleason is offline   Reply With Quote
Old 25-09-2012, 21:02   #100
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Oddly, C:\ProgramData\opencpn\opencpn.log, in most recent logs at bottom have no mention of gshhs. ...However the world map is working fine.
Code:
11:52:47 PM: OpenGL-> Renderer String: GeForce GT 540M/PCI/SSE2
11:52:47 PM: OpenGL-> Framebuffer Objects unavailable
11:52:47 PM: OpenGL-> Using Stencil buffer clipping
11:52:47 PM: OpenGL-> Estimated Max Resident Textures: 98
11:52:47 PM: ChartDB Cache policy:  Application target is 1024 MBytes
11:52:47 PM: Loading chart db version: V017
11:52:47 PM: Chartdb: Chart directory list follows
11:52:47 PM:   Chart directory #0: C:\Data-Dart\BSB_ROOT\03Region
11:52:47 PM:   Chart directory #1: C:\Data-Dart\CM93ed2_2010May31
11:52:47 PM: GPS Watchdog Timeout is: 6 sec.
11:52:47 PM: Initializing Chart C:\Data-Dart\CM93ed2_2010May31\
rgleason is offline   Reply With Quote
Old 26-09-2012, 03:29   #101
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Development Debugging Environment - Setup Help

Gshhs detail: Look at the top of Chart Sources | Official OpenCPN Homepage, you can get even more detail there. Files are too large to be part of the default install.

"share" folder: Contains optional Help files and Language translations. "tcdata" folder: Contains optional tides and currents datasets. These are not strictly needed for OpenCPN operation. Populate those folder if you need to test those features.

...and if you always show cm93, then gshhs it not initialized because it is not needed.
JesperWe is offline   Reply With Quote
Old 30-09-2012, 20:37   #102
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Jesper, thanks again for your help. I've downloaded the Compiled version of 3.1.919 and have been trying the plugins in that version, because they do not run well in the debug version.

I think I finally understand that a Build creates an OpenCpn "Debugging Version" and that a Compiled version creates an "Executable version" for some specific operating system. Therefore it is incorrect for me to use the term Compiled with respect to a Debugging version.
rgleason is offline   Reply With Quote
Old 30-09-2012, 20:46   #103
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

Attached is an "OpenCPN Debug Environment Setup-Supplement.doc" titled:
Keeping your OpenCpn Debug version current and using 'git'.
Date: Sept 30, 2012, Rick Gleason, based on comments by Jesper Weissglas.
-This title sounds a little surreal to me right now. Hope it helps. Any comments/improvements are welcome.
Attached Files
File Type: doc OpenCPN Debug Environment Setup-Supplement.doc (49.0 KB, 105 views)
rgleason is offline   Reply With Quote
Old 20-10-2012, 21:48   #104
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Development Debugging Environment - Setup Help

In order to test plugins, you must have a Release Build because running plugins with a Debug Build is hideously complex, slow, and not productive. Jesper has patiently told me this many times.

This help Supplement No 2, using MS VS 2010 for Windows, explains how you can compile beta code into a Release Build (an executable) for the Windows environment. It is remarkably easy. See the attachments.

The last file, from Jesper, is a test AIS nmea file to be used with the VDR plugin, which illustrates that AIS is going to be an important source of information. Its is good for testing the AIS module. Get VDR from the plugin page. It is quite a show if you don't have an AIS nmea data stream.

I had to split this file into four files, zip is not accepted.
Rausch-1.doc 11000 lines
Rausch-2.doc 11000 lines
Rausch-3.doc 11000 lines
Rausch-4.doc about 7000 lines
Rausch-5.doc the remainder of lines.
Change them to txt files by changing the suffix and use your text editor to patch them together into Raush-1 with no extra carriage feeds.
Then change the suffix to Raush.nmea
Even one of these renamed gives you some idea and can serve as a test sample.
Maybe there is a better place to have this available?
Attached Files
File Type: doc OpenCPN Debug Environment Setup-Supplement No 2.doc (42.5 KB, 115 views)
File Type: doc Rausch-1.doc (346.5 KB, 157 views)
File Type: doc Rausch-2.doc (344.7 KB, 134 views)
File Type: doc Rausch-3.doc (347.5 KB, 116 views)
File Type: doc Rausch-4.doc (237.0 KB, 119 views)
File Type: doc Rausch-5.doc (351.9 KB, 114 views)
rgleason is offline   Reply With Quote
Old 21-10-2012, 01:13   #105
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Development Debugging Environment - Setup Help

Quote:
I had to split this file into four files, zip is not accepted.
Zips are fine as long as you stick a ".doc" at the end or as I have done with the complete file here, ".pdf". I found that with ".pdf" at the end a larger files can be uploaded than with ".doc" on this forum.

Thomas

Rausch.7z.pdf
cagney is offline   Reply With Quote
Reply

Tags
environment


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


Advertise Here


All times are GMT -7. The time now is 00:43.


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.