macports netcdf toolbox for mac OS 10.6 and fortran

Yolande Serra serra at atmo.arizona.edu
Tue Mar 10 21:42:01 PDT 2009


I installed macports netcdf +g95 variant on my new intel power mac  
dual quad core running 10.5.6.  The install had no errors but when I  
try to compile code requiring the netcdf library it gives the  
following errors:

g95 -I/opt/local/include regress_olr_CLLJeast.f handle_err.f  
get_time.f -o regress_olr_CLLJeast -L/opt/local/lib -lnetcdff -ludunits
Undefined symbols:
  "_nf_inq_compound_fieldname__", referenced from:
      _U74.678 in ccaNDF8v.o
      _U82.619 in cca57thG.o
  "_nf_insert_compound__", referenced from:
      _U119.769 in ccaNDF8v.o
      _U128.711 in cca57thG.o
  "_nf_create_par__", referenced from:
      _U13.546 in ccaNDF8v.o
      _U16.487 in cca57thG.o

.....all netcdf commands in code are listed ending with

ld: symbol(s) not found

I should mention that this same code compiles on my other mac which is  
a powerpc running 10.4.11.  In that case I have netcdf 3.6 installed  
with F90/F77 support.  I tried compiling the code with both g95 and  
gfortran (also a macport install) but with no luck.  I also tried the - 
fno-underscoring option but that did not work either (not that I  
really thought it would).  I also tried with -lnetcdf without the  
extra f (this is how I did it on the old mac because it only had one  
library).  Why does your install come with two libraries?  The netcdf  
library build on the ncar website for my mac does not come this way.   
I may have to just install that one elsewhere but wanted to see if I  
could get this one working since I need it anyway to be able to use my  
grads2 install with netcdf since you don't share libraries...

thanks, Yolande




Dr. Yolande Serra, Assoc. Research Faculty
Institute of Atmospheric Physics
University of Arizona
(520) 621-6619
serra at atmo.arizona.edu





More information about the macports-users mailing list