# GMT6 install problems

**URL:** <https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164>\
**Category:** Q&A\
**Created:** [January 2, 2020, 12:04am UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164 "2020-01-02T00:04:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlaforge](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rlaforge/32/89_2.png) [@rlaforge](https://forum.generic-mapping-tools.org/u/rlaforge)\
**Post date:** [January 2, 2020, 12:04am UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/1 "2020-01-02T00:04:57Z")

</div>

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  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x13)[0x14b43a147da3]  
[0x0]  
Stack backtrace:  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig\_handler+0x2b1)[0x14b43a0dc921]  
/lib/x86\_64-linux-gnu/libpthread.so.0(+0x12890)[0x14b439e96890]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x13)[0x14b43a147da3]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x153379)[0x14b43a1f6379]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_begin+0x2e)[0x14b43a1f6fce]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT\_Create\_Session+0x1cd)[0x14b43a0ec7cd]  
gmt(main+0xa0e)[0x5643483d796e]  
/lib/x86\_64-linux-gnu/libc.so.6(\_\_libc\_start\_main+0xe7)[0x14b439ab4b97]  
gmt(\_start+0x2a)[0x5643483d7eaa]

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  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x13)[0x14e391d42da3]  
[0x0]  
Stack backtrace:  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig\_handler+0x2b1)[0x14e391cd7921]  
/lib/x86\_64-linux-gnu/libpthread.so.0(+0x12890)[0x14e391a91890]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x13)[0x14e391d42da3]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x153379)[0x14e391df1379]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_begin+0x2e)[0x14e391df1fce]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT\_Create\_Session+0x1cd)[0x14e391ce77cd]  
/usr/local/src/gmt/gmt-6.0.0/build/./src/gmt(main+0x14f)[0x558baa6630af]  
/lib/x86\_64-linux-gnu/libc.so.6(\_\_libc\_start\_main+0xe7)[0x14e3916afb97]  
/usr/local/src/gmt/gmt-6.0.0/build/./src/gmt(\_start+0x2a)[0x558baa663eaa]  
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.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [January 2, 2020, 4:01pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/2 "2020-01-02T16:01:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rlaforge](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rlaforge/32/89_2.png) [@rlaforge](https://forum.generic-mapping-tools.org/u/rlaforge)\
**Post date:** [January 3, 2020, 5:53pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/3 "2020-01-03T17:53:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [January 4, 2020, 7:00am UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/4 "2020-01-04T07:00:38Z")

</div>

There is [a post](https://flint.soest.hawaii.edu/t/compilation-of-gmt6-from-src-on-mac-os/112) with similar error messages. Maybe caused by the same reason? BTW, can you run `gmt -Vd` and post the full debug messages?

---

<div class="post-metadata">

**Author:** ![rlaforge](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rlaforge/32/89_2.png) [@rlaforge](https://forum.generic-mapping-tools.org/u/rlaforge)\
**Post date:** [January 5, 2020, 6:21pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/5 "2020-01-05T18:21:31Z")

</div>

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  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x13)[0x1456eb717da3]  
[0x0]  
Stack backtrace:  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig\_handler+0x2b1)[0x1456eb6ac921]  
/lib/x86\_64-linux-gnu/libpthread.so.0(+0x12890)[0x1456eb466890]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x13)[0x1456eb717da3]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x153379)[0x1456eb7c6379]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_begin+0x2e)[0x1456eb7c6fce]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT\_Create\_Session+0x1cd)[0x1456eb6bc7cd]  
./gmt(main+0x14f)[0x5564f1b4b0af]  
/lib/x86\_64-linux-gnu/libc.so.6(\_\_libc\_start\_main+0xe7)[0x1456eb084b97]  
./gmt(\_start+0x2a)[0x5564f1b4beaa]

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [January 5, 2020, 7:14pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/6 "2020-01-05T19:14:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [January 5, 2020, 7:41pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/7 "2020-01-05T19:41:38Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![rlaforge](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rlaforge/32/89_2.png) [@rlaforge](https://forum.generic-mapping-tools.org/u/rlaforge)\
**Post date:** [January 7, 2020, 8:13pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/8 "2020-01-07T20:13:02Z")

</div>

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  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x1b)[0x145c70f13dab]  
[0x0]  
Stack backtrace:  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig\_handler+0x2b1)[0x145c70ea8921]  
/lib/x86\_64-linux-gnu/libpthread.so.0(+0x12890)[0x145c70c62890]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_replace\_backslash\_in\_path+0x1b)[0x145c70f13dab]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x1533a9)[0x145c70fc23a9]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt\_begin+0x2e)[0x145c70fc2ffe]  
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT\_Create\_Session+0x1cd)[0x145c70eb87cd]  
gmt(main+0xa0e)[0x55b55ae2196e]  
/lib/x86\_64-linux-gnu/libc.so.6(\_\_libc\_start\_main+0xe7)[0x145c70880b97]  
gmt(\_start+0x2a)[0x55b55ae21eaa]  
/

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [January 8, 2020, 7:48pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/9 "2020-01-08T19:48:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [January 8, 2020, 8:09pm UTC](https://forum.generic-mapping-tools.org/t/gmt6-install-problems/164/10 "2020-01-08T20:09:38Z")

</div>

I think you just need to print the string \_\_SOURCE\_LINE\_FUNC
