OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 111 forks source link

macOS gcc reinstall failure "Type mismatch between actual argument" is linked to osgeo-netcdf #1404

Closed geotheory closed 3 years ago

geotheory commented 3 years ago

I've...

Describe the bug

Following macOS upgrade to Big Sur my C compiling seems to be broken, and osgeo-netcdf seems to be part of the problem. I've tried removing, reinstalling, unlinking the lib without success.

$ brew reinstall gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-10.2.0.big_sur.bottle.1.tar.gz
Already downloaded: /Users/robin/Library/Caches/Homebrew/downloads/7939b1e2a8e566fd2c0abe1e71c3474a310269c0a2dc215adfb99718c203a556--gcc-10.2.0.big_sur.bottle.1.tar.gz
==> Reinstalling gcc
==> Pouring gcc-10.2.0.big_sur.bottle.1.tar.gz
🍺  /usr/local/Cellar/gcc/10.2.0: 1,455 files, 338.1MB
==> No outdated dependents to upgrade!
==> Checking for dependents of upgraded formulae...
==> Reinstalling 1 broken dependent from source:
osgeo/osgeo4mac/osgeo-netcdf
==> Downloading https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.3.1.tar.gz
Already downloaded: /Users/robin/Library/Caches/Homebrew/downloads/60008bd4a4b82237539c0853d7d66598828980676475b9ae07459297ffd9d888--netcdf-cxx4-4.3.1.tar.gz
==> Downloading https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz
Already downloaded: /Users/robin/Library/Caches/Homebrew/downloads/906f442a6073a1cd628c5ebba0cb4c5f992dcdad575fa4c351d465b8ab8f47e9--netcdf-cxx-4.2.tar.gz
==> Downloading https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.5.2.tar.gz
Already downloaded: /Users/robin/Library/Caches/Homebrew/downloads/1aac84b2ab955146aed5d3959c6dda1f93fa42613e9e2868c9f9a791f03551e0--netcdf-fortran-4.5.2.tar.gz
==> Downloading https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz
Already downloaded: /Users/robin/Library/Caches/Homebrew/downloads/a7b4a4cb9341c0391361331c1c313c2f2933bd02c16fa417156470d3c91aa567--netcdf-c-4.7.4.tar.gz
==> Reinstalling osgeo/osgeo4mac/osgeo-netcdf
==> cmake .. -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DENABLE_TESTS=OFF -DENABLE_NETCDF_4=ON -DENABLE_DOXYGEN=OFF
==> make install
==> make clean
==> cmake .. -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DENABLE_TESTS=OFF -DENABLE_NETCDF_4=ON -DENABLE_DOXYGEN=OFF
==> make
==> cmake .. -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DNETCDF_C_LIBRARY=/usr/local/Cellar/osgeo-netcdf/4.7.4/lib/libnetcdf.dylib -DNCXX_ENABLE_TESTS=OFF
==> make install
==> make clean
==> cmake .. -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DNETCDF_C_LIBRARY=/usr/local/Cellar/osgeo-netcdf/4.7.4/lib/libnetcdf.dylib -DNCXX_ENABLE_TESTS=OFF
==> make
==> cmake .. -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DNETCDF_C_LIBRARY=/usr/local/Cellar/osgeo-netcdf/4.7.4/lib/libnetcdf.dylib -DENABLE_TESTS=OFF
==> make install
Last 15 lines from /Users/robin/Library/Logs/Homebrew/osgeo-netcdf/12.make:
netcdf4_func.f90:650:74:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
netcdf4_func.f90:640:73:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(2)/REAL(8)).
netcdf4_func.f90:630:73:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(1)/REAL(8)).
make[2]: *** [fortran/CMakeFiles/netcdff.dir/netcdf4.f90.o] Error 1
make[1]: *** [fortran/CMakeFiles/netcdff.dir/all] Error 2
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/osgeo/homebrew-osgeo4mac/issues

brew doctor output:

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unknown support status

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/robin/anaconda3/bin/llvm-config
  /Users/robin/anaconda3/bin/icu-config
  /Users/robin/anaconda3/bin/geos-config
  /Users/robin/anaconda3/bin/krb5-config
  /Users/robin/anaconda3/bin/freetype-config
  /Users/robin/anaconda3/bin/kea-config
  /Users/robin/anaconda3/bin/xslt-config
  /Users/robin/anaconda3/bin/libpng16-config
  /Users/robin/anaconda3/bin/python3.7-config
  /Users/robin/anaconda3/bin/libpng-config
  /Users/robin/anaconda3/bin/xml2-config
  /Users/robin/anaconda3/bin/python3.7m-config
  /Users/robin/anaconda3/bin/gdal-config
  /Users/robin/anaconda3/bin/python3-config
  /Users/robin/anaconda3/bin/curl-config
  /Users/robin/anaconda3/bin/ncursesw6-config
  /Users/robin/anaconda3/bin/pcre-config
  /Users/robin/anaconda3/bin/dap-config
  /Users/robin/anaconda3/bin/nc-config
  /Library/Frameworks/GDAL.framework/Programs/gdal-config
  /Applications/Postgres.app/Contents/Versions/9.6/bin/gdal-config

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/GL/glew.h
  /usr/local/include/GL/glxew.h
  /usr/local/include/GL/wglew.h
  /usr/local/include/fakemysql.h
  /usr/local/include/fakepq.h
  /usr/local/include/fakesql.h
  /usr/local/include/itcl.h
  /usr/local/include/itcl2TclOO.h
  /usr/local/include/itclDecls.h
  /usr/local/include/itclInt.h
  /usr/local/include/itclIntDecls.h
  /usr/local/include/itclMigrate2TclCore.h
  /usr/local/include/itclTclIntStubsFcn.h
  /usr/local/include/mysqlStubs.h
  /usr/local/include/odbcStubs.h
  /usr/local/include/pqStubs.h
  /usr/local/include/tcl.h
  /usr/local/include/tclDecls.h
  /usr/local/include/tclOO.h
  /usr/local/include/tclOODecls.h
  /usr/local/include/tclPlatDecls.h
  /usr/local/include/tclThread.h
  /usr/local/include/tclTomMath.h
  /usr/local/include/tclTomMathDecls.h
  /usr/local/include/tdbc.h
  /usr/local/include/tdbcDecls.h
  /usr/local/include/tdbcInt.h
  /usr/local/include/tk.h
  /usr/local/include/tkDecls.h
  /usr/local/include/tkPlatDecls.h

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  osgeo-netcdf

I have tried running brew link and full uninstall brew uninstall --ignore-dependencies netcdf but keeps bouncing back!

Any assistance much appreciated as currently unable to reinstall gcc and so C compiling is broken.

alazarolop commented 3 years ago

Hi @geotheory , I think your approach it's the right one. However, it seems to me that you have kept several versions of the formula osgeo-netcdf. Can you check if all of them are remove? AFAIK, when you brew uninstall you just remove the latest one.

geotheory commented 3 years ago

Ahh so I just uninstalled again and that resolved it. Thanks for the suggestion :)