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 Andrea, > I am trying to install a static version of NetCDF 4.2 > (I am interested in the Fortran APIs) to be threadsafe and in 64b > on a IBM Power6 machine. > > To do that, I first install the C library (v4.2.1.1) with the commands > > + export OBJECT_MODE=64 > + export CC=xlc_r > + export FC=xlf90_r > + export F77=xlf_r > + export FCFLAGS=-q64 -qmaxmem=-1 -NS32648 -qextname -qsource -qcache=auto > -qarch=pwr6 -qtune=pwr6 > + export FFLAGS=-q64 -qmaxmem=-1 -NS32648 -qextname -qsource -qcache=auto > -qarch=pwr6 -qtune=pwr6 > + export CFLAGS=-q64 -qmaxmem=-1 -qarch=pwr6 -qtune=pwr6 > + export LDFLAGS=-q64 -b64 > + export ARFLAGS=-X 64 -cru > + export AR_FLAGS=-X 64 -cru > + ./configure --prefix=/users/home/ans012/local/netcdf-4.2-c > --disable-netcdf-4 --disable-doxygen --disable-shared > > The installation goes well, > then I move to the Fortran API package (netcdf-fortran-4.2) > that I install accordingly: > > + NC=/users/home/ans012/local/netcdf-4.2-c > + export OBJECT_MODE=64 > + export CC=xlc_r > + export FC=xlf90_r > + export F77=xlf_r > + export FCFLAGS=-q64 -qmaxmem=-1 -NS32648 -qextname -qsource -qcache=auto > -qarch=pwr6 -qtune=pwr6 > + export FFLAGS=-q64 -qmaxmem=-1 -NS32648 -qextname -qsource -qcache=auto > -qarch=pwr6 -qtune=pwr6 > + export F90FLAGS_f90=-q64 -qmaxmem=-1 -NS32648 -qextname -qsource > -qcache=auto -qarch=pwr6 -qtune=pwr6 > + export FFLAGS_f90=-q64 -qmaxmem=-1 -NS32648 -qextname -qsource > -qcache=auto -qarch=pwr6 -qtune=pwr6 > + export CFLAGS=-q64 -qmaxmem=-1 -qarch=pwr6 -qtune=pwr6 > + export LDFLAGS=-q64 -b64 -L/users/home/ans012/local/netcdf-4.2-c/lib > + export CPPFLAGS=-I/users/home/ans012/local/netcdf-4.2-c/include > + export ARFLAGS=-X 64 -cru > + export AR_FLAGS=-X 64 -cru > + ./configure --prefix=/users/home/ans012/local/netcdf-4.2-fortran > --disable-sharedhttp://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html Since you disabled shared libraries for the C APIs, building Fortran libraries is somewhat more complicated, as descirbed in the second part of these instructions: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html In particular, I think you need to set LD_LIBRARY_PATH before invoking the configure script, and LDFLAGS will have to contain "-lnetcdf" and possibly other libraries, as shown in the example. Please let us know if this doesn't work. --Russ > Now the compilation goes well but the make check > fails: > > [...] > ld: 0711-317 ERROR: Undefined symbol: .nf_get_var1_int1_ > ld: 0711-317 ERROR: Undefined symbol: .nf_get_var1_int2_ > ld: 0711-317 ERROR: Undefined symbol: .nf_get_var1_int_ > ld: 0711-317 ERROR: Undefined symbol: .nf_get_var1_real_ > [...] > > Namely all the Fortran 77 API are "undefined symbol". > If I reinstall both C and Fortran libraries > without "-qextname" option for xlf/xlf90 > (no trailing underscore for Fortran routines) > then all the C APIs (nc_get_var... etc.) > become "undefined symbol" > > In any case I can't succeed in linking > a Fortran program with the new libraries, > > do you have any suggestion/recommendation? > > Thanks in advance, > Regards > > Andrea Storto > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: XZT-324632 Department: Support netCDF Priority: Normal Status: Closed