GMT6 install problems

I’m having problems installing 6.0.0 on ubuntu 18.04 (linuxmint 19.3). Installed all supporting packages AKAIK.

Problems 1:

cmake … command in build directory gave no errors, nor did make and make install.

But when I type “gmt” I get this:

/usr/local/src/gmt/gmt-6.0.0/build % gmt
ERROR: Caught signal number 11 (Segmentation fault) at
Stack backtrace:

Problem 2:

typing “make docs_man” goes ok, then this:

[ 43%] Built target gmt
Scanning dependencies of target gmt_for_img_convert
[ 43%] Built target gmt_for_img_convert
Scanning dependencies of target _docs_html_scripts_fig
[ 43%] Generating …/rst/_source/_images/GMT_App_M_2.png
ERROR: Caught signal number 11 (Segmentation fault) at
Stack backtrace:
doc/scripts/CMakeFiles/_docs_html_scripts_fig.dir/build.make:206: recipe for target ‘doc/rst/_source/_images/GMT_App_M_2.png’ failed
make[3]: *** [doc/rst/_source/_images/GMT_App_M_2.png] Error 1
CMakeFiles/Makefile2:1168: recipe for target ‘doc/scripts/CMakeFiles/_docs_html_scripts_fig.dir/all’ failed
make[2]: *** [doc/scripts/CMakeFiles/_docs_html_scripts_fig.dir/all] Error 2
CMakeFiles/Makefile2:1074: recipe for target ‘doc/rst/CMakeFiles/docs_man.dir/rule’ failed
make[1]: *** [doc/rst/CMakeFiles/docs_man.dir/rule] Error 2
Makefile:446: recipe for target ‘docs_man’ failed
make: *** [docs_man] Error 2

I’ve built many gmt versions, never had these problems before.

All seems to start a libpthread but that’s strange because I don’t remember that GMT is using pthreads. It does optionally use gthreads. Try adding -DGMT_USE_THREADS=FALSE to the cmake build line.

In build directory tried cmake -DGMT_USE_THREADS=FALSE … ; make; make install, then …/bin/gmt

same result. Tried uncommenting the “set (GMT_USE_THREADS TRUE)” in the cmake config file, no difference.

Built version 5.4.5 successfully, no problems.

There is a post with similar error messages. Maybe caused by the same reason? BTW, can you run gmt -Vd and post the full debug messages?

Here’s the output from gmt -Vd. (tried uploading the text file, the reply window only accepts image files). I looked at the post you recommended, but don’t see anything to try. But looks like it can’t find something it needs.

/usr/local/src/gmt/gmt-6.0.0/bin % ./gmt -Vd
gmt [DEBUG]: Obtained the ppid from parent: 32003
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = /usr/local/src/gmt/gmt-6.0.0/share
gmt [DEBUG]: GMT->session.HOMEDIR = /home/roland
gmt [DEBUG]: GMT->session.USERDIR = /home/roland/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = /home/roland/.gmt/cache [created]
ERROR: Caught signal number 11 (Segmentation fault) at
Stack backtrace:

Do you know how to debug with a debugger? Otherwise I’m afraid it’s going to be difficult because we need to able to reproduce the problem.

Can you try this? In gmt_io.c find the function gmt_replace_backslash_in_path() (about line 8752) and add this before the while (dir[k]) line

if (dir == NULL) {
     fprintf (stderr, "Caller name: %pS\n", __builtin_return_address(0));

If it works, it won’t avoid the crash but maybe will point us to the right direction

Tried that- here’s what I get:

/usr/local/src/gmt/gmt-6.0.0/bin % gmt
Caller name: 0x145c70fc23a9S
ERROR: Caught signal number 11 (Segmentation fault) at
Stack backtrace:

Damn it. That’s not what I was expecting to see. An hex address tell us nothing. It’s the function’s name that we need.

I think you just need to print the string __SOURCE_LINE_FUNC