GMT 6.1.1 compiled and was built without any difficulties.
However when I try to run a program I get the following error message:
$ gmt gmt [ERROR]: Failure while loading core GMT shared library: No such file or directory
This message is generated more or less first thing when the program starts. It would be good to know what it is not finding.
gmt-config also generates the same error message (4 times) before printing the usage message.
The PATH has been set using gmtswitch and points to the correct bin folder:
$ echo $PATH .:/home/cff/this_gmt/bin:/home/cff/SeisUnix/bin:/usr/local/bin:/usr/bin: etc.
My guess is that the shared lib (libgmt.so) is in a directory not seek by LD_LIBRARY_PATH. … or something else because Cygwin is tricky and we abandoned testing it long time ago.
I have been wondering about the Windows binaries. I have written several programs that use the GMT C API (under Cygwin) that access the same files through the network as our Linux server. Is the API included in the binaries and what about compilers? I have also been assuming that the Windows binaries use the Windows End-of-Line convention. I have therefore not ventured down that path.
I also tried Bash for Windows a few years back, but at the time I could not access the network drives through that. I have not tried since.
Cygwin has had its hiccups, but has, on the whole, worked well. The Linux server does not yet have GMT 6.
Hmm, the EOL thing would probably not be an issue because GMT should be insensitive to that, but writing programs to access the GMT API that will pose the compilers problem. I don’t think gcc in Cygwin will be able to link against the lib created with Visual Studio. MinGW’s gcc perhaps but Cygwin’s, almost sure it wont. But Cygwin can have the MinGW’s compatibility so … I don’t know.
The main issue with Cygwin build is probably the WIN32 vs _WIN32 macro duality. Their scope is very confuse and we tend to use them freely. It is not impossible that sometimes we are letting a Windows behavior slipping into Cygwin’s Posix environment. It’s not impossible that the trouble you found with the dll comes from that reason, though I’m not seeing how.
I re-installed the project after editing the build/src/config.h file line 62 to: #define GMT_CORE_LIB_NAME “libgmt-6.dll”
wirh:
cmake --build . --target install
after that all worked fine.
For the record the old line was: #define GMT_CORE_LIB_NAME “libgmt.dll”
OK, I think that is what I did initially, but I am not sure. It seemed to work until I changed directory.
I suppose I can re-install with the original “libgmt.dll” and test to make sure.
# Get name of GMT core library
get_target_property (_name gmtlib RUNTIME_OUTPUT_NAME)
get_target_property (_prefix gmtlib PREFIX)
set (GMT_CORE_LIB_NAME ${_prefix}${_name}${_lib_suffix})
You can try also to make a true copy or rename the libgmt-6.dll to libgmt.dll. This wouldn’t work in true Windows because the dlls have their names embedded but perhaps it does on Cygwin