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.
>Keywords: 199508290936.AA10104 Hi Keith, > I am trying to install netcdf-232pl12 on a PC running Linux, > so far no luck. I installed netcdf on my Sun and I had no problems, > so I am very confused as to why I am having trouble on Linux. > > I have included a log file that your installation guide suggested. ... > making `all' in directory /root/tmp/apt/netcdf-232pl2/port > > make[1]: Entering directory `/root/tmp/apt/netcdf-232pl2/port' > make[2]: Entering directory `/root/tmp/apt/netcdf-232pl2/port' > gcc -traditional -O -c -I. -DNDEBUG -Dconst= -O uddummy.c ... > make[1]: Entering directory `/root/tmp/apt/netcdf-232pl2/libsrc' > gcc -traditional -O -c -DSWAP -DNDEBUG -Dconst= -O array.c > In file included from /usr/include/rpc/types.h:55, > from local_nc.h:20, > from array.c:8: > /usr/include/stdlib.h:154: conflicting types for `initstate' > /usr/include/stdlib.h:143: previous declaration of `initstate' > /usr/include/stdlib.h:156: conflicting types for `setstate' > /usr/include/stdlib.h:144: previous declaration of `setstate' > /usr/include/stdlib.h:196: conflicting types for `cfree' > /usr/include/stdlib.h:191: previous declaration of `cfree' This looks like a problem with the way gcc is being invoked or the system include files rather than netCDF. NetCDF has been successfully built on LINUX, and we've added the information below on what's required to our Frequently Asked Questions list at http://www.unidata.ucar.edu/packages/netcdf/faq.html 16. How can I build netCDF under Linux? Frank Dzaak (address@hidden) reports the following changes to the current version are sufficient: 1. Before running configure, set OS=linux in your environment or in Makefile.in. 2. For a FORTRAN interface, copy fortran/sunos.m4 to fortran/linux.m4 and in that file change the name Sun to Linux with define(`M4__SYSTEM', Linux) 3. Copy the definition of the "STREQ" macro from ncgen/ncgenyy.c to ncgen/ncgentab.c. These are reported to work for Linux kernel 1.0.9, CC=gcc(2.5.8), F77=f2c, LEX=flex, YACC=bison. None of the changes above would seem to be related to the errors you are seeing from compiling array.c. I'm also puzzled why gcc is being invoked with "-Dconst=", since it can handle const declarations. Please make sure you start with a clean distribution (use "make distclean" if necessary) before you run the "configure" script. Otherwise, if you are using the Makefiles left over from building netCDF on Suns, for example, the Makefiles generated by "configure" will be wrong. Currently we don't have access to a LINUX platform for porting, so we can't build or test the netCDF library on LINUX. We depend on LINUX users in the community to help us with that and other platforms we don't have, by testing each new release and giving us any changes that need to be made. If you still can't build netCDF on LINUX, you might want to post a query to the address@hidden mailing list of about 400 netCDF users, to see if anyone else who has built it on LINUX knows what the problem is. ______________________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu