Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix GSHHGDIR and DCWDIR #984

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: Fix GSHHGDIR and DCWDIR #984

wants to merge 2 commits into from

Conversation

seisman
Copy link
Member

@seisman seisman commented Jun 19, 2019

@PaulWessel Can you check if this works for you.

@PaulWessel
Copy link
Member

OK trying now.

@seisman
Copy link
Member Author

seisman commented Jun 19, 2019

In this function, GMT tries to find DCW in GMT->session.DCWDIR (if set) first, then search via gmt_getsharepath.

gmt/src/gmt_dcw.c

Lines 71 to 77 in f75038a

GMT_LOCAL bool dcw_get_path (struct GMT_CTRL *GMT, char *name, char *suffix, char *path) {
bool found = false;
/* This is the order of checking:
* 1. Check in GMT->session.DCWDIR, if set
* 2. Look via gmt_getsharepath.
*/

When COPY_DCW is set to TRUE, we know that DCW data must be in SHAREDIR/dcw, so we should skip searching in GMT->session.DCWDIR.

Now the problem is, GMT->session.DCWDIR is always set to DCW_INSTALL_PATH:

gmt/src/gmt_init.c

Lines 5473 to 5475 in f75038a

if (GMT->session.DCWDIR)
gmt_M_str_free (GMT->session.DCWDIR);
GMT->session.DCWDIR = strdup (DCW_INSTALL_PATH);

And DCW_INSTALL_PATH is always set to DCW_PATH in

gmt/src/config.h.in

Lines 68 to 69 in f75038a

/* Name of DCW path */
#define DCW_INSTALL_PATH "@DCW_PATH@"
.

@PaulWessel
Copy link
Member

Your first change worked for me. Do I need to try ff7f807 as well?

@seisman
Copy link
Member Author

seisman commented Jun 19, 2019

The first commit breaks CI, because we don't set "COPY_GSHHG" and "COPY_DCW" in our CI.

@seisman seisman changed the title Fix GSHHGDIR and DCWDIR WIP: Fix GSHHGDIR and DCWDIR Jun 19, 2019
@PaulWessel
Copy link
Member

We still need this merged too, no?

@seisman
Copy link
Member Author

seisman commented Jun 19, 2019

No. #983 already works. This PR tries to make it better.

I think we can leave it after rc1.

@seisman seisman changed the base branch from sharedirpathfix to 6.0 June 25, 2019 02:22
@seisman seisman added this to the 6.0.0 milestone Sep 11, 2019
@codecov-io
Copy link

Codecov Report

Merging #984 into 6.0 will decrease coverage by 1.84%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              6.0     #984      +/-   ##
==========================================
- Coverage   58.27%   56.42%   -1.85%     
==========================================
  Files         230      230              
  Lines      132468   132469       +1     
==========================================
- Hits        77201    74751    -2450     
- Misses      55267    57718    +2451
Impacted Files Coverage Δ
src/gmt_init.c 58.64% <ø> (-0.36%) ⬇️
src/testapi_matrix.c 0% <0%> (-100%) ⬇️
src/testapi_vector.c 0% <0%> (-100%) ⬇️
src/pssolar.c 0% <0%> (-63.86%) ⬇️
src/kml2gmt.c 0% <0%> (-56.37%) ⬇️
src/grdlandmask.c 24.48% <0%> (-48.69%) ⬇️
src/gmt2kml.c 0% <0%> (-36.48%) ⬇️
src/mgd77/mgd77track.c 0% <0%> (-27.52%) ⬇️
src/gmt_shore.c 50.22% <0%> (-27.12%) ⬇️
src/pscoast.c 46.74% <0%> (-18.5%) ⬇️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6ac126...aaea978. Read the comment docs.

@seisman seisman modified the milestones: 6.0.0, 6.0.1 Oct 31, 2019
@seisman seisman modified the milestones: 6.0.1, 6.1.0 Jan 15, 2020
@seisman seisman closed this Jan 16, 2020
@joa-quim joa-quim deleted the fix-gshhg-dcw branch January 16, 2020 16:15
@seisman seisman restored the fix-gshhg-dcw branch January 16, 2020 16:52
@seisman seisman reopened this Jan 16, 2020
@seisman seisman changed the base branch from 6.0 to master January 16, 2020 16:53
@seisman seisman modified the milestones: 6.1.0, 6.2.0 Mar 25, 2020
@seisman seisman removed this from the 6.2.0 milestone Apr 19, 2021
obaney pushed a commit to obaney/gmt that referenced this pull request Aug 18, 2021
@joa-quim
Copy link
Member

Ping on this. Implement it (after conflict solving)? Looks OK to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants