[Thread Prev][Thread Next][Index]
Re: [ferret_users] Create a netcdf file on MAC?
Hi Jian,
| I have installed the gfortran and netcdf on Mac, but a problem
| appears when I use them to create a NC file.
|
| root# gfortran -lnetcdf hb.f90
| /usr/bin/ld: Undefined symbols:
| _nf_close_
[...]
| I have copied the libnetcdf.a and netcdf.inc to the current
| directory, and pls find the hb.f in the attachment.
I see several potential problems:
1) I suspect ld ignores the current directory. I guess you want
# gfortran hb.f90 -L. -lnetcdf
2) The order of command line arguments can be significant.
Symbols in earlier files are searched in later files.
3) Do you need ranlib when you copy a library? since Mac is
BSD Unix . . . ?
4) You need to use the same Fortran compiler you (or somebody)
built the netCDF library with.
5) It's better to use packages to install things (if available).
I recommend netCDF on fink.
Finally, I think it's better to ask this kind of question elsewhere.
There's certainly a mailing list dedicated to netCDF. This list
is primarily for discussion on Ferret. I'm not complaining. What
I'm saying is that you'll have a better chance to get better answers
when your questions are asked in more appropriate places.
Hope this helps,
Ryo
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement