This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Sophie, > I have had a lot of trouble installing netcdf and gfortran on my mac os x > 10.6 and was hoping for some direction. I thought I had gfortran and netcdf > 4.1 installed correctly, but I can't seem to getting the linking flags > correct. I assume this means that you ran "make check" and "make install", and both completed successfully. > When I try and compile a script with a -lnetcdff reference (gfortran test.f > -o test -I/opt/local/include -I/usr/include -lnetcdf), I get a error beginning > > >Undefined symbols: > > "_nf_put_att_text_", referenced from: Try gfortran -I/opt/local/include test.f -o test -L/opt/local/lib -lnetcdff -lnetcdf > When I try nc-config --flibs, it returns > > -L/opt/local/lib -lnetcdff -lnetcdf > > But then when I try to compile with > gfortran test.f -o test -I/opt/local/include -I/usr/include -lnetcdf > -llnetcdf That was missing the "-L/opt/local/lib" ... > I get > ld: library not found for -llnetcdf > > Can someone please provide some direction for installing with the correct > libraries? I'm really not sure what I've done wrong here. Please let us know if the gfortran invocation line above doesn't work. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: SGX-345422 Department: Support netCDF Priority: Normal Status: Closed