2

I am using Octave(-gui) on Mac (OSX 10.15.7 Catalina) and try to install the netcdf package. I get an error that nc-config was not found. My version of Octave is 6.1.0. I also tried installing from local tar.gz. This is the output of my Octave console:

>> pkg install -forge netcdf

configure: error: nc-config not found
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -std=gnu++11 accepts -g... yes
checking for mkoctfile... /Applications/Octave-6.1.0.app/Contents/Resources/usr/Cellar/octave-octave-app@6.1.0/6.1.0/bin/mkoctfile-6.1.0
checking for nc-config... no

error: pkg: error running the configure script for netcdf.
error: called from
    configure_make at line 93 column 9
    install at line 196 column 7
    pkg at line 568 column 9

Could someone please point me in the right direction? Thank you!

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
Thomas.Hut
  • 153
  • 1
  • 1
  • 6
  • 1
    have you installed a `*netcdf*devel*` package ? – matzeri Jan 31 '21 at 16:30
  • On ubuntu: "Command 'nc-config' not found, but can be installed with: sudo apt install libnetcdf-dev". You probably need the equivalent package on mac. – Tasos Papastylianou Jan 31 '21 at 21:18
  • Thank you, there is a libnet package for OSX available which i installed on my system, but still get the same error. It seems that Octave does not find nc-config – Thomas.Hut Feb 02 '21 at 14:28

1 Answers1

1

UPDATE: This is an issue in Octave.app, not something you're doing wrong. Please swing by the Octave.app Issue Page and discuss how this should be fixed.

This sounds like you need the netcdf system package installed. (This is the native NetCDF library on which the Octave netcdf package depends.) If you have Homebrew, you can install it with brew install netcdf and it might work.

Octave.app should probably bundle netcdf itself, so you don't need it installed on your system. You can open a request for that on the Octave.app Issues page.

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
  • Thank you! I already have netcdf installed via brew as you suggested, but i still get the exact same error. nc-config lies here: /usr/local/Cellar/netcdf/4.7.4_2/bin/nc-config – Thomas.Hut Feb 02 '21 at 14:21
  • Hmm. Check to make sure that the Homebrew `netcdf` is "linked"? Try `which nc-config` and `ls -l $(which nc-config)` both from your Terminal and an Octave `system()` call. You should have a symlink like `/usr/local/bin/nc-config -> ../Cellar/netcdf/4.7.4_2/bin/nc-config` there. – Andrew Janke Feb 02 '21 at 15:47
  • Nevermind: Turns out this is actually an issue with Octave.app: because it is launched as a native Mac app, it doesn't pick up your shell configuration, which is how `/usr/local` gets pulled in. This is actually something we need to figure out how to address. Swing on by https://github.com/octave-app/octave-app/issues and report this as a bug in Octave.app and we'll figure out how to fix it. – Andrew Janke Feb 02 '21 at 16:17