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.
>To: "'address@hidden'" <address@hidden> >From: Naresh Kumar <address@hidden> >Subject: problem compiling netcdf_3.3 and netcdf_3.4 on HP-UX 9.x >Organization: . >Keywords: 199803171929.MAA29204 Hi Naresh, > I am having problems compiling either version 3.3 or 3.4 on our HP-UX machine. > It runs into problem while compiling 'all' in directory fortran. The error is > as > follows: > > c89 -c -O -I../libsrc -DNDEBUG fort-attio.c > cpp: error 7: Out of dynamic memory. > *** Error code 1 > > The machine has 64 Mb memory and there was no other process running > while I tried to compile the code. First, I notice you are not compiling with the -D_HPUX_SOURCE flag that we recommend in our instructions for building netCDF on this platform (in the INSTALL file at the top-level). This means you haven't set the environment variable CPPFLAGS="-D_HPUX_SOURCE -DNDEBUG" as we recommend before running the "configure" script. Please follow the instructions in the INSTALL file for this platform (after first running "make clean" and removing the config.cache file), and if you still have problems, please include the information requested at the end of the INSTALL file in reporting the problem. This will help us diagnose the problem more quickly. In case this isn't the source of the problem, the cpp problem you reported occurs for "fort-attio.c", the first source file compiled in that directory that attempts to #include "ncfortran.h" and that file includes another file containing a huge number of macro definitions: #include "cfortran.h" (The purpose of these .h files is to isolate and handle all the many ways C functions are called from Fortran on a large variety of platforms.) All these macro defintions have probably exceeded the capacity of your C preprocessor (cpp), though we don't see any problems on our HP-UX 10.20/9000 platform. If this is the problem, all I can suggest is that you try to use the -H cpp flag to increase the cpp capacity to handle macro definitions. This flag changes ... the internal macro definition table to be nnn bytes in size. The default buffer size is at least 8188 bytes ... so you might try setting the environment variable CPPFLAGS to something like "-H50000" before invoking the configure script (after removing config.cache and running "make clean"). > My another question is that do I need the fortran-interface library to run > programs that call netcdf routines in a FORTRAN program. I tried to compile > my FORTRAN program that calls netcdf routines using the library libnetcdf.a > in directory libsrc, but I got various unsatisfied symbols. Yes, you need the FORTRAN interface to call netCDF FORTRAN functions from a FORTRAN program. In building the netCDF library, the C interfaces are compiled first, so if the build fails in compiling the FORTRAN interface, it never gets added to the libnetcdf.a, so you would expect that the unsatisfied externals you are seeing would result. You can also get a copy of the 3.3.1 netCDF libraries and executables already compiled and built for the HP-UX 9.05/9000 platform from ftp://ftp.unidata.ucar.edu/pub/binary/hpux_9.05-hp9000/netcdf-3.3.1.tar.Z _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu