[ncl-install] sd_nc* undefined references

Rick Grubin grubin at ucar.edu
Thu Mar 6 08:43:29 MST 2008


Hi Jeff

>> Please edit the files
>>     NclHDF.c
>> and
>>     NclHDFEOS.c
>> located in the directory .../ni/src/ncl directory (relative to  
>> your source code install root point) and remove the following line  
>> from each:
>>     #include <hdf/netcdf.h>
>
> Rick,
>
> The above change allowed me to compile NclHDFEOS.c.  However, the  
> compilation of NclHDF.c still complained about undefined  
> variables.  I tried some different things and found that moving the
>
> #include <hdf/netcdf.h>
>
> line above the
>
> #include <hdf/mfhdf.h>
>
> line and dropping the 'hdf/' part seems to have worked.  i.e.:
>
> # diff -u NclHDF.c{.orig,}
> --- NclHDF.c.orig       2008-03-05 17:22:34.000000000 -0500
> +++ NclHDF.c    2008-03-06 09:45:00.000000000 -0500
> @@ -23,8 +23,8 @@
>  #include <ncarg/hlu/NresDB.h>
>  #include "defs.h"
>  #define HAVE_NETCDF
> +#include <netcdf.h>
>  #include <hdf/mfhdf.h>
> -#include <hdf/netcdf.h>
>  #include "NclData.h"
>  #include "NclFileInterfaces.h"
>  #include <math.h>
>
> If for some reason, that is not the way to fix this, let me know.  
> Otherwise I'll give this one a try.

It would seem that your directory .../include/hdf  has a file   
'netcdf.h'  located there.  This is likely due to the previous
install attempt, where  '--enable-netcdf'  was specified.  Removing  
this file should solve the problem.  If not, it may be
necessary to reinstall HDF4.

If you find yourself removing any of the "hdf/" portions of an  
include directive, your HDF installation is incorrect.  The
file 'hdf/mfhdf.h'   does include  'netcdf.h'  within it, and if  
there's a proper netCDF installation and NCL is configured to
find it, you will not see errors.

Apologies for this convolution, I know it's not clear -- it's a  
vestige of a somewhat outdated install method.  We are
working on improving this.

----	
Rick Grubin      NCAR/TDD/CISL/VETS
Visualization + Enabling Technologies
grubin at ucar.edu             303.497.1832




More information about the ncl-install mailing list