Homebrew-core: Can't build GDAL - Missing members from system cmath header

Created on 10 Oct 2018  ยท  25Comments  ยท  Source: Homebrew/homebrew-core

  • [ ] are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • [x] have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [ ] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [ ] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • I'm trying to install GDAL 2.3.1.
  • I've got build errors relating to missing members in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath. See https://gist.github.com/palmerj/bfc73cf28d4413a73b7d277ef3f73b9e
  • What you expected to happen
  • I've tried to install GDAL using the following command brew install gdal --with-complete

My OS is 10.13.6 and Xcode is Xcode 10.0, Build version 10A255.

outdated

Most helpful comment

Seeing the same error. If it helps, here is brew gist-logs gdal for me: https://gist.github.com/ccaviness/b162d98b6ba71d26de27ebdf81815a30

All 25 comments

An old (fixed) gdal ticket where this came up:
https://trac.osgeo.org/gdal/ticket/6489

Some discussion of a similar issue in a different codebase:
https://github.com/Automattic/node-canvas/issues/863

This comment seems to suggest it may be fixable by reordering build dependencies rather than changing application code:
https://github.com/Andersbakken/rtags/issues/937#issuecomment-293459813

Please post the output of brew gist-logs

I can reproduce. Here is the brew gist-logs https://gist.github.com/1f2dd78da4e18038a5d343465f53c9fc

I hit the same problem when building pitivi.rb. The pitivi.rb formula has a lot of dependencies but what's failing is the matplotlib pip package installed using Language::Python::Virtualenv. See the gist-logs when installing pitivi.rb.

Seeing the same error. If it helps, here is brew gist-logs gdal for me: https://gist.github.com/ccaviness/b162d98b6ba71d26de27ebdf81815a30

Does adding ENV["SDKROOT"] = MacOS.sdk_path at the beginning of the install block in the formula help?

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Same problem here!

@fxcoudert how to add this. I tried SDKROOT="MacOS.sdk_path" brew install gdal --with-complete but did not work.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Looks like the following command worked for me.

$ SDKROOT="MacOS.sdk_path" brew install gdal --with-complete

$ gdalinfo --version
GDAL 2.3.1, released 2018/06/22

This error still occurs for me even with SDKROOT="MacOS.sdk_path" brew install gdal --with-complete

Had the same issue and above suggestions did not help. However what did help was to follow the instructions on https://sites.google.com/site/eospansite/installinggdalonmacosx and downloading the framework manually.

@peetkes @lony could you please try:

SDKROOT="MacOS.sdk_path" brew install gdal --with-complete --build-from-source

Can I still with the latest brew version?

โฏ brew --version
Homebrew 1.8.4
Homebrew/homebrew-core (git revision 3a957; last commit 2018-12-06)
Homebrew/homebrew-cask (git revision 91b0f; last commit 2018-12-06)

Looks not like it

..
/bin/sh /private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/libtool --mode=compile --silent --tag=CXX clang++ -std=c++11 -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/port -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/gcore -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/alg -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/ogr -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/ogr/ogrsf_frmts -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/gnm -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wimplicit-fallthrough    -DGNM_ENABLED -I/usr/local/Cellar/gdal/2.3.1_2/include -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/port -I/usr/local/include -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/Cellar/netcdf/4.6.1_4/include -I/usr/local/opt/giflib -I/usr/local/opt/giflib/include -I/usr/local/opt/jpeg -I/usr/local/opt/jpeg/include -I/usr/local/opt/libgeotiff/include -I/usr/local/opt/libtiff/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr/local -I/usr/local/include -I/usr/local/opt/zstd/include  -DGDAL_COMPILATION -DHAVE_XERCES -I/usr/local/include -I/usr/local/include/xercesc -I/usr/local/Cellar/gdal/2.3.1_2/include -I/private/tmp/gdal-20181207-17113-7g8fr/gdal-2.3.1/port -I/usr/local/include -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local/Cellar/netcdf/4.6.1_4/include -I/usr/local/opt/giflib -I/usr/local/opt/giflib/include -I/usr/local/opt/jpeg -I/usr/local/opt/jpeg/include -I/usr/local/opt/libgeotiff/include -I/usr/local/opt/libtiff/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr/local -I/usr/local/include -I/usr/local/opt/zstd/include  -DGDAL_COMPILATION -DUSE_IN_GDAL -Ilibcsf -c -o ../o/pcrasterutil.lo pcrasterutil.cpp

READ THIS: https://docs.brew.sh/Troubleshooting

These open issues may also help:
Can't build GDAL - Missing members from system cmath header https://github.com/Homebrew/homebrew-core/issues/32869
gdal dependency gcc was built with a different C++ standard library (libstdc++ from clang). https://github.com/Homebrew/homebrew-core/issues/34783

@igas That did not resolve my issue:
````
SDKROOT="MacOS.sdk_path" brew install gdal --with-complete --build-from-source
....
I/usr/local/opt/libtiff/include -I/usr/local/opt/libpng -I/usr/local/opt/libpng/include -I/usr/local -I/usr/local/include -I/usr/local/opt/zstd/include -DGDAL_COMPILATION -DUSE_IN_GDAL -Ilibcsf -c -o ../o/pcrasterutil.lo pcrasterutil.cpp

READ THIS: https://docs.brew.sh/Troubleshooting

These open issues may also help:
Can't build GDAL - Missing members from system cmath header https://github.com/Homebrew/homebrew-core/issues/32869
gdal dependency gcc was built with a different C++ standard library (libstdc++ from clang). https://github.com/Homebrew/homebrew-core/issues/34783

````

The idea is to add ENV["SDKROOT"] = MacOS.sdk_path inside the goal.reb formula, just after the def install line.

@fxcoudert I'm having the same problem and adding ENV["SDKROOT"] = MacOS.sdk_path into the gdal.rb doesn't seem to fix it...

This may help: brew install osgeo/osgeo4mac/gdal2
I updated the formula for homebrew-osgeo4mac and it works perfectly.

Thanks @fjperini !
This worked for me:
brew install osgeo/osgeo4mac/gdal2 --with-java --with-libkml --with-swig-java --with-mdb
after that I could build the java examples if I set the proper java.library.path property

Thanks @fjperini, it installed fine but it doesn't seem to include HDF5 support? This is why I wanted the --with-complete flag

Actually, brew install osgeo/osgeo4mac/gdal2 --with-complete worked perfectly. Thanks!

It seems that it was helpful! :+1:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

I finally managed to fix it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faraazkhan picture faraazkhan  ยท  3Comments

Thirudhas picture Thirudhas  ยท  4Comments

kiendang picture kiendang  ยท  3Comments

daviderestivo picture daviderestivo  ยท  4Comments

oli-laban picture oli-laban  ยท  3Comments