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.
Hello Cristian, Thanks for reaching out; from the config.log file you provided, it appears that the linker is failing to find -lz and -lcurl. This is unusual; would you try configuring netCDF as follows? $ CFLAGS="-O3 $(nc-config --cflags)" FFLAGS="-O3" LDFLAGS=$(nc-config --libs) CC=gcc FC=gfortran ./configure --prefix=/opt/netcdf/4.7.4 If you installed netCDF-C 4.7.4 as a static library, you may need to run the following command instead: $ CFLAGS="-O3 $(nc-config --cflags)" FFLAGS="-O3" LDFLAGS=$(nc-config --libs --static) CC=gcc FC=gfortran ./configure --prefix=/opt/netcdf/4.7.4 This assumes that `nc-config` is on your binary path. If it is not, replace 'nc-config' in the previous commands with '/opt/netcdf/4.7.4/bin/nc-config' Let us know if this fixes the issue, or if the symptoms change as a result. Thanks, have a great day, -Ward > Dear support, > > I'm already install netcdf-c-4.7.4 successfully and now I'm trying to > install netcdf-fortran-4.6.0 on with the following options: > ./configure CC=gcc FC=gfortran CFLAGS=-O3 FFLAGS=-O3 > CPPFLAGS="-I/opt/hdf5/include -I/opt/netcdf/4.7.4/include" > LDFLAGS="-L/opt/hdf5/lib -L/opt/netcdf/4.7.4/lib" LIBS="-lnetcdf > -lhdf5_hl -lhdf5 -lm -lz -lcurl" --prefix=/opt/netcdf/4.7.4 > --disable-silent-rules > > However I got an error: > configure: netCDF-Fortran 4.6.0 > checking build system type... x86_64-pc-linux-gnu > checking host system type... x86_64-pc-linux-gnu > checking target system type... x86_64-pc-linux-gnu > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a race-free mkdir -p... /usr/bin/mkdir -p > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking whether make supports nested variables... yes > checking whether to enable maintainer-specific portions of Makefiles... no > configure: checking user options > checking whether make supports the include directive... yes (GNU style) > checking for gcc... gcc > checking whether the C compiler works... no > configure: error: in `/home/user/Downloads/netcdf-fortran-4.6.0': > configure: error: C compiler cannot create executables > See `config.log' for more details > > I have checked the config.log but could not get much about the error. I > would appreciate any help you could provide me. > Attached is the config.log file. > > Thanks, > Cristian > > > Ticket Details =================== Ticket ID: ZUE-161248 Department: Support netCDF Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.