NSF Unidata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #XZZ-356273]: C compiler error in NetCDF 4 installation

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 Eldon,

Two things leap out at me from what you've provided, and the config.log; thank 
you for sending this, incidentally, it's a great help!

First,

* LIBS=-l/opt/CDO/libs4cdo-0.0.10/hdf5-1.8.6/hdf5/

This would normally be LIBS="-lhdf5"; however, this is unnecessary; the 
configure script will look for libhdf5 automatically and link against it when 
found.  Your definition of LDFLAGS should be changed to include 
"/opt/CDO/libs4cdo-0.0.10/hdf5-1.8.6/hdf5".

Second, netcdf-c requires hdf5 version 1.8.9 or higher; you will want to 
upgrade your hdf5 install.

Third, the line 

* LD_LIBRARY_PATH=/opt/CDO/libs4cdo-0.0.10/netcdf-4.3.3/lib?

Has a stray '?' at the end; if this exists in the definition of 
LD_LIBRARY_PATH, you will want to remove it. Likewise, you will want to modify 
LD_LIBRARY_PATH to include the location containing libhdf5.  

I hope this helps,

-Ward

> Hello my name is Eldon Lopes and I'm currently a graduate student at UMass 
> Lowell  seeking to utilize NetCDF 4 data for application to WRF modeling. My 
> NetCDF 4 library cannot configure due to an error message stating:
> 
> 
> checking whether the C compiler works... no
> 
> configure: error: in `/opt/CDO/libs4cdo-0.0.10/netcdf-4.3.3':
> 
> configure: error: C compiler cannot create executables
> 
> See `config.log' for more details
> 
> 
> My environment paths are set to
> 
> LIBS=-l/opt/CDO/libs4cdo-0.0.10/hdf5-1.8.6/hdf5/
> 
> CC=gcc
> 
> CXX=g++
> 
> FC=gfortran
> 
> LDFLAGS=-L/opt/CDO/libs4cdo-0.0.10/netcdf-4.3.3/lib
> 
> CPPFLAGS=-I/opt/CDO/libs4cdo-0.0.10/netcdf-4.3.3/include
> 
> gcc=-m64
> 
> LD_LIBRARY_PATH=/opt/CDO/libs4cdo-0.0.10/netcdf-4.3.3/lib?
> 
> 
> I had this issue when attempting to build HDF5 on my computer. I upgraded to 
> OS X Yosemite and downloaded the latest command line tools from Apple 
> Developer and the HDF5 succeeded in building so I don't think it's the 
> compiler itself but rather a user error on my end,  however I haven't been 
> able to figure out what I did wrong. I've also browsed the Internet for 
> solutions but I couldn't find a clear cut solution as I did for HDF5 and 
> other libraries I was building. I have attached the config.log if it's useful.
> 
> 
> Thanks
> 
> 
> 
> 
> 
> 
> 

Ticket Details
===================
Ticket ID: XZZ-356273
Department: Support netCDF
Priority: Normal
Status: Closed