Problems installing on CentOS 7 using yum repo

I installed gmt from the repo, using yum as instructed on https://github.com/GenericMappingTools/gmt/blob/master/INSTALL.md#rhelcentos. Everything seemed to go smoothly as there were no errors during installing. The executible /usr/bin/gmt is present. But I get no output. Typing “gmt” or “gmt blockmean” produces nothing: no error, no documentation, just a blank. Suggestions?

Please run gmt --version -Vd and post the output.

image

Garrett, those instructions are for GMT 6.0.0 but your terminal is showing GMT_5.4 stuff. Mixup of instructions and previous GMT version installed?

OK, the problem is, you have some old GMT4 files in the /usr/share/GMT_4.5 directory. For some unknown reasons, GMT6 is trying to read the old GMT4 share directory, which causes corruptions. A possible reason is that you have environmental variable GMT_SHAERDIR set to /usr/share/GMT_4.5. The simplest solution is to remove the old GMT4 share directory.

@pwessel for such case, is it possible to let GMT report error messages instead of a silent crash

Suggestions for how? We could check if “5.4” is part of any of the environmental parameters and use that?

I remembered there was a VERSION file in GMT’s share directory, but it’s not there now.

Actually, I don’t understand why GMT6 fails when using GMT5 share directory. The contents of share directory are almost the same for GMT5 and GMT6, right?

So gmt reports “Enter: PSL_beginsession” and crashes. Something must happen in the PSL_beginsession. If GMT can catch it, then it can report some useful messages.

THANK you. I removed the problematic environmental variables and all seems to be working.

FYI GMT6 would not install using yum with GMT5 on the computer (got a conflict with a GMT 5 library)

There is a call to psl_init_fonts that reads and initializes fonts but if the path is not found there is no error message, and it may quietly crash further down because it sets

PSL->internal.N_FONTS = n_PSL_fonts = i = PSL_N_STANDARD_FONTS;

but if the path is not found then things may be uninitialized.

It’s weird. I set GMT_SHAREDIR to GMT4 or GMT5’s share directory, and ran the gmt command from GMT6. Both work without any crashes.

gmt_init says

	/* Then any custom fonts:
	   To add additional fonts, create a file called PSL_custom_fonts.txt
	   in GMT/share/postscriptlight and add your extra font information there.
	   The fontheight below is the height of A for unit fontsize.
	   Encoded = 0 if we may re-encode this font as needed. */

so since it found a dir called share/postscriptlight it is trying to find the PSL_custom_fonts.txt file and maybe it finds something, who knows.