[ncl-install] NclHDF.c and compile on ia64
Mary Haley
haley at ucar.edu
Thu Oct 9 14:34:31 MDT 2008
On Thu, 9 Oct 2008, Ted Mansell wrote:
> 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.
>
The netCDF/HDF stuff is a real pain for folks, and it's different
depending on the version you have.
We've made an attempt to fix this, that will be in the next release.
I believe the fix is to remove the "#include <hdf/netcdf.h>" as you
did, and then include the following lines after the "#include
<ctype.h>" line:
#ifndef MAX_VAR_DIMS
#ifdef H4_MAX_VAR_DIMS
#define MAX_VAR_DIMS H4_MAX_VAR_DIMS
#define MAX_NC_NAME H4_MAX_NC_NAME
#define MAX_NC_DIMS H4_MAX_NC_DIMS
#else
#define MAX_VAR_DIMS 32
#define MAX_NC_NAME 256
#define MAX_NC_DIMS 5000
#endif
#endif
> 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.)
We need to get to the bottom of this flex problem. It's been on my list for
awhile.
Thanks so much for the notes Ted! I'll try to include these in some
fashion.
--Mary
> Best,
>
> -- Ted
> _______________________________________________
> ncl-install mailing list
> ncl-install at ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>
More information about the ncl-install
mailing list