dwcaress / MB-System

MB-System is an open source software package for the processing and display of bathymetry and backscatter imagery data derived from multibeam, interferometry, and sidescan sonars.
https://www.mbari.org/products/research-software/mb-system/
Other
127 stars 43 forks source link

Problem compiling MB-System: fatal error: gmt_common_byteswap.h: No such file or directory #1250

Closed anbj closed 2 years ago

anbj commented 2 years ago

I'm trying to build git head of MB-System. I'm using git head of GMT.

During make, I get this:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I/usr/local/include/gmt -I/usr/include/gdal -I/usr/include -I/usr/include/tirpc -g -O2 -I/usr/include/tirpc -MT mb_intersectgrid.lo -MD -MP -MF .deps/mb_intersectgrid.Tpo -c mb_intersectgrid.c -o mb_intersectgrid.o >/dev/null 2>&1
depbase=`echo mb_readwritegrd.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src/mbio  -I../../src/mbio  -I/usr/local/include/gmt -I/usr/include/gdal -I/usr/include  -I/usr/include/tirpc    -g -O2 -I/usr/include/tirpc -MT mb_readwritegrd.lo -MD -MP -MF $depbase.Tpo -c -o mb_readwritegrd.lo mb_readwritegrd.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I/usr/local/include/gmt -I/usr/include/gdal -I/usr/include -I/usr/include/tirpc -g -O2 -I/usr/include/tirpc -MT mb_readwritegrd.lo -MD -MP -MF .deps/mb_readwritegrd.Tpo -c mb_readwritegrd.c  -fPIC -DPIC -o .libs/mb_readwritegrd.o
In file included from mb_readwritegrd.c:29:
/usr/local/include/gmt/gmt_dev.h:127:10: fatal error: gmt_common_byteswap.h: No such file or directory
  127 | #include "gmt_common_byteswap.h"    /* Byte-swap inline functions */
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

The problem seems obvious: gmt_common_byteswap.h from gmt is not found. Maybe related to https://github.com/GenericMappingTools/gmt/pull/6091?

dwcaress commented 2 years ago

Did you run the configure script so that the Makefiles reflect the currently installed version of GMT?

What version of GMT is installed? What operating system and version are you using?

Cheers, Dave

On Dec 7, 2021, at 2:53 AM, anbj @.***> wrote:

I'm trying to build git head of MB-System. I'm using git head of GMT.

During make, I get this:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I/usr/local/include/gmt -I/usr/include/gdal -I/usr/include -I/usr/include/tirpc -g -O2 -I/usr/include/tirpc -MT mb_intersectgrid.lo -MD -MP -MF .deps/mb_intersectgrid.Tpo -c mb_intersectgrid.c -o mb_intersectgrid.o >/dev/null 2>&1 depbase=echo mb_readwritegrd.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I/usr/local/include/gmt -I/usr/include/gdal -I/usr/include -I/usr/include/tirpc -g -O2 -I/usr/include/tirpc -MT mb_readwritegrd.lo -MD -MP -MF $depbase.Tpo -c -o mb_readwritegrd.lo mb_readwritegrd.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I/usr/local/include/gmt -I/usr/include/gdal -I/usr/include -I/usr/include/tirpc -g -O2 -I/usr/include/tirpc -MT mb_readwritegrd.lo -MD -MP -MF .deps/mb_readwritegrd.Tpo -c mb_readwritegrd.c -fPIC -DPIC -o .libs/mb_readwritegrd.o In file included from mb_readwritegrd.c:29: /usr/local/include/gmt/gmt_dev.h:127:10: fatal error: gmt_common_byteswap.h: No such file or directory 127 | #include "gmt_common_byteswap.h" / Byte-swap inline functions / | ^~~~~~~ compilation terminated.

The problem seems obvious: gmt_common_byteswap.h from gmt is not found. Maybe related to GenericMappingTools/gmt#6091?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.


David W. Caress Principal Engineer Seafloor Mapping Lab

Monterey Bay Aquarium Research Institute 7700 Sandholdt Road Moss Landing, CA 95039

@.*** http://www.mbari.org/~caress/

Phone: 831-775-1775

anbj commented 2 years ago

I'm sorry I haven't looked up things that I should've looked up. No, I did not run the configure script.

$ gmt --version
6.4.0_f344f2e_2021.12.05

On Debian Bullseye:

$ uname -a
Linux nuc8 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux
anbj commented 2 years ago

Maybe I misunderstood. If you mean the configure script as in ./configure, then yes. I did run that.

anbj commented 2 years ago

This was fixed (I think) in gmt; so configuring and installing MB-system seems to go OK.

However, after installing, I'm getting this:

$ mbdatalist -v
mbdatalist: error while loading shared libraries: libmbio.so.0: cannot open shared object file: No such file or directory
anbj commented 2 years ago

And this is no problem at all on my other computer. I'm confused.

dwcaress commented 2 years ago

Sometimes it is necessary to use the environment variable LD_LIBRARY_PATH to designate locations where shared libraries can be found. On some systems /usr/local/lib is searched by default, on others it is not - there is great variability in this between Linux distributions and between versions of the same distribution. A better approach is to use the linker option -rpath to hard-encode shared library locations - the autoconf build system should do this but does not in all cases. The quick fix is probably to put something like: export LD_LIBRARY_PATH:/usr/local/lib:$LD_LIBRARY_PATH into one of the files that defines your environment, such as ~/.bashrc if you use bash.

anbj commented 2 years ago

Thanks dwcaress, and sorry for messy post. The strange thing is that I use completely (except for some locally installed packages) identical systems; Debian 11. Maybe I messed around with something I shouldn't mess with.

export LD_LIBRARY_PATH:/usr/local/lib:$LD_LIBRARY_PATH

did the trick.

tezzer commented 1 year ago

To benefit others searching for this same issue, sudo ldconfig will update the link path and solve this more permanently, as described here: https://askubuntu.com/questions/350068/where-does-ubuntu-look-for-shared-libraries