Skip to content

Add bitflag to allow resetting GMT->init.runtime_bindir - #9018

Merged
joa-quim merged 2 commits into
masterfrom
bindir2libdir
May 18, 2026
Merged

joa-quim merged 2 commits into
masterfrom
bindir2libdir

Conversation

@joa-quim

Copy link
Copy Markdown
Member

The issue is that when called from externals GMT->init.runtime_bindir is set to the binary of the external caller. For example from Julia GMT->init.runtime_bindir is set to .../Julia/bin and this is not good for example to find the Ghostscript location on Windows.

This PR adds a new GMT_SESSION_BIN2LIBDIR bit flag that can be used at the time of GMT_Create_Session() call and will set GMT->init.runtime_bindir equal to GMT->init.runtime_libdir. This latter does not seem to be affected by the guessing machinery in gmt_begin and holds the right address on Windows. Unix systems may still be affected by the issue this PR tries to address. In all cases, this should be a harmless change when the GMT_SESSION_BIN2LIBDIR bit flag is not used.

joa-quim added 2 commits May 15, 2026 13:00
The issue is that when called from externals GMT->init.runtime_bindir is set to the binary of the external caller. For example from Julia GMT->init.runtime_bindir is set to .../Julia/bin and this is not good for example to fibf the Ghostscript location on Windows.

This PR adds a new GMT_SESSION_BIN2LIBDIR bit flag that can be used at the time of GMT_Create_Session() call and will set GMT->init.runtime_bindir equal to GMT->init.runtime_libdir. This latter does not seem to be affected by the guessing machinery in gmt_begin and holds the right address on Windows. Unix systems may still be affected by the issue this PR tries to address. In all cases, this should be a harmless change when the GMT_SESSION_BIN2LIBDIR bit flag is not used.
@joa-quim
joa-quim requested a review from a team May 15, 2026 12:12
@Esteban82 Esteban82 added the enhancement Improving an existing feature label May 15, 2026

@Esteban82 Esteban82 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved without testing.

@joa-quim

Copy link
Copy Markdown
Member Author

@seisman this may have influence in PyGMT as well. Please test it.

@joa-quim
joa-quim merged commit 28b6e8c into master May 18, 2026
10 of 13 checks passed
@joa-quim
joa-quim deleted the bindir2libdir branch May 18, 2026 14:10
@seisman

seisman commented May 19, 2026

Copy link
Copy Markdown
Member

Currently, PyGMT doesn't rely on the bin directory, so it's not affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants