[ncl-install] NclHDF.c and compile on ia64

Ted Mansell ted.mansell at noaa.gov
Thu Oct 9 10:09:38 MDT 2008


Hello,

I had to compile ncl-ncarg on an SGI Altix (Itanium2/ia64) in order to  
get netcdf4 support (apparently not included in the pre-compiled  
binaries).  In the LINUX.IA64 config file, I had to add an explicit -L/ 
path for the -lifcore to work correctly:

#define CtoFLibraries   -lm -L/opt/intel/fc/10.1.013/lib -lifcore

Otherwise, icc did not seem to find the lib, although it didn't  
complain about not finding the lib, just not finding the particular  
routine (for_cpystr). (I'm using the Intel Fortran and C compilers.)

I also ran into the NclHDF.c problem noted on the Troubleshooting  
section of build-from-source web page. I removed the #include <hdf/ 
netcdf.h> line because the netcdf.h file does not exist there (I  
suppose a flag could be used to turn it off?), but still had the  
problem with undefined MAX_VAR_DIMS etc.  Including netcdf.h farther  
up did fix the MAX_VAR_DIMS problem, and the code compiled, but it  
then complained that all the sd_ncXXXX functions were implicitly  
declared, which didn't seem like a good thing.

The problem with including netcdf.h is that it defines _NETCDF_ so  
that things don't get defined properly in hdf4_netcdf.h.   I have  
hdf4.2r3 installed, and there's a flag, H4_HAVE_NETCDF, that seems to  
mean the *opposite* of the old HAVE_NETCDF flag.   I think there is a  
bug in hlimits.h, line 195, where

#ifdef H4_HAVE_NETCDF

should be

#ifndef H4_HAVE_NETCDF

and then the MAX_NC_* variables will get defined and NclHDF.c compiles  
without complaints.

Another note: I did have to get the old flex-2.5.3.  It would core  
dump when compiled with gcc -O2, but worked with icc -O0 -g. (So gcc - 
O0 might work, but I stopped trying things after getting it to work.)

Best,

-- Ted


More information about the ncl-install mailing list