1

私は私のMacに持っています:

  • Octave-3.4.0
  • Gnuplot 4.2 - プロットに問題があったのでインストールしなければなりませんでしたが、まったくプロットしませんでした。

netcdf ファイルをロードする必要があります。次のエラーが表示されました。

nc = netcdf('/users/matheuscortezi/Desktop/Pcse005/ocean_avg.nc', 'r')
error: `netcdf' undefined near line 9 column 6

だから私はnetcdfコマンドがインストールされていないと思うので、オクターブでこれを入力してインストールしようとしました:

pkg install -global -forge octcdf

それから受け取るエラーメッセージは次のとおりです。

configure: error: in `/var/tmp/oct-t8XcYD/octcdf/src':
configure: error: C compiler cannot create executables
See `config.log' for more details.
the configure script returned the following error: checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
error: called from `pkg>configure_make' in file /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m near line 1325, column 9
error: called from:
error:   /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m at line 783, column 5
error:   /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m at line 354, column 9

私は何をすべきかについて、微かな考えも持っていません。次のいずれかでこの問題を解決するにはどうすればよいですか。

  • このエラーを修正するか、
  • netcdf()与えられた例のように使用できるように、netcdf「コマンドパック」(その名前はわかりません)をインストールします。

私が十分に明確だったことを願っています。

4

1 に答える 1

0

It seems to me that you installed Octave from the Mac OSX App bundle. That is not recommended at all. You should install from one of the package managers as explained on Octave's wiki. As far as I know, there are 3 options for Mac (see previous link). Just search for one that also has the netcdf package.

Anyway, if you really don't want to install it through a package manager (but seems to me you really should), seems that your problem lies on gcc (the GNU C compiler). do you have it installed at all? Some packages have code in C++ or C and are also dependent on some external libraries.

EDIT using a package manager would have also solved your problem about plotting since it would install gnuplot at same time

于 2012-09-09T18:47:13.193 に答える