Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glib.h not found #1484

Open
anbj opened this issue Oct 22, 2024 · 13 comments
Open

glib.h not found #1484

anbj opened this issue Oct 22, 2024 · 13 comments

Comments

@anbj
Copy link
Contributor

anbj commented Oct 22, 2024

Tested on git head and 5.8.1.

I'm getting an error which is new to me:

[ 73%] Building C object src/mbaux/CMakeFiles/mbaux.dir/mb_readwritegrd.c.o
[ 73%] Built target mb_read_init_test
[ 77%] Built target mbview
In file included from /usr/local/include/gmt/gmt_dev.h:157,
                 from /home/anbj/MB-System/src/mbaux/mb_readwritegrd.c:39:
/usr/local/include/gmt/gmt_glib.h:36:10: fatal error: glib.h: No such file or directory
   36 | #include <glib.h>
      |          ^~~~~~~~
compilation terminated.

It seems to come from a gmt header file. I've installed the dependencies.

This 'error' may not belong to MB-System, but creating this report in hope for some tips. @joa-quim, do you know of any changes lately that may lead to this?

@joa-quim
Copy link
Contributor

It seems that somehow this is related to what triggered GenericMappingTools/gmt#8577
But gmt_glib.h:36 has

#ifdef HAVE_GLIB_GTHREAD
#include <glib.h>

So, if HAVE_GLIB_GTHREAD is set that means the location of glib.h should be know too. Don't understand the failure.

@dwcaress
Copy link
Owner

dwcaress commented Oct 23, 2024 via email

@anbj
Copy link
Contributor Author

anbj commented Oct 23, 2024

It's a recent thing at least. I'm pretty sure I successfully compiled MB-system just a few weeks/months ago (with bleeding edge GMT). I know for sure it worked in May, so the reason you refer to @joa-quim seems probable.

@anbj
Copy link
Contributor Author

anbj commented Dec 9, 2024

I checked out an arbitrary GMT commit some months ago and started git bisect.
I ended up with this commit:

20cbbffe6396749b563d0c335e3f8116d14ffa47 is the first bad commit
commit 20cbbffe6396749b563d0c335e3f8116d14ffa47
Author: Joaquim <[email protected]>
Date:   Wed Jun 19 13:46:54 2024 +0100

    Use all cores by default in grdfilter (#8523)
    
    * Let x option synopsis be printed in grdfilter independently of having OMP or not.
    
    * Let all 3 modules built with Glib use max number of cores by default like the OMP case.
    
    * Do not use multi-threads with -Ff (custom filter). It's broken.
    
    * Use API->n_cores instead of gmtlib_get_num_processors() to see if it pleases Mac
    
    * Do not use all cores by default in potential modules. Some tests are failing.
    
    Integrate the ideas of #8319
    
    * Remove mention to -x option (not in current surface module).
    
    Variable filter width (grdfilter) does not support -x

 doc/rst/source/explain_core.rst_ |  4 +++-
 src/gmt_dev.h                    |  1 +
 src/gmt_glib.h                   |  1 +
 src/gmt_init.c                   | 20 ++++++++++++--------
 src/grdfilter.c                  | 18 ++++++++++++++++--
 src/potential/gmtgravmag3d.c     |  2 +-
 src/potential/grdgravmag3d.c     |  2 +-
 src/surface.c                    |  4 ++--
 8 files changed, 37 insertions(+), 15 deletions(-)

@joa-quim, do you know how to fix this?

@joa-quim
Copy link
Contributor

But that I understand this, there is nothing to fix in the GMT side!

@anbj
Copy link
Contributor Author

anbj commented Dec 11, 2024

Oh, sorry!

@anbj
Copy link
Contributor Author

anbj commented Dec 16, 2024

Just for the record: compiling MB-System works with GMT 6.5.0, but after the commit in the GMT repo on Jun 19., the fatal error: glib.h: No such file or directory error appears.

@dwcaress
Copy link
Owner

dwcaress commented Jan 4, 2025

Today I tried, but failed, to replicate the glib.h not found build error using the current beta distribution of MB-System (5.8.2beta18) and the current master branch of the GMT repository (which shows a version 6.6.0). I removed the prior GMT installation (6.5.0), installed GMT 6.6.0 from source, and then built and installed MB-System. This worked successfully on MacOs Ventura 13.40 and on Ubuntu 24.04.1 LTS. I double checked that the GMT 6.5.0 headers and libraries were fully removed and that MB-System was building using the GMT 6.6.0 headers and libraries.

@anbj
Copy link
Contributor Author

anbj commented Jan 5, 2025

That's very strange. I'll test again when I have the chance.

@dwcaress
Copy link
Owner

dwcaress commented Jan 5, 2025 via email

@anbj
Copy link
Contributor Author

anbj commented Jan 6, 2025

Thanks @dwcaress. What would a permanent fix be?

@dwcaress
Copy link
Owner

dwcaress commented Jan 6, 2025 via email

@anbj
Copy link
Contributor Author

anbj commented Jan 9, 2025

I see. I'll leave the issue open a while longer. Thanks Dave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants