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.
>From: address@hidden (Paulo B. Oliveira) >Subject: Installing netcdf >Organization: Instituto de Oceanografia, Universidade de Lisboa >Keywords: 199711121457.HAA13626 netCDF 3.3.1 Hi Paulo, > I've tried to install netcdf3.3.1 without success. > I would very much appreciate if you could send me any suggestions to > solve the problem. > Here are the infos as suggested on ./src/INSTALL file: > > 1. % uname -a > SunOS ofsun5 5.5.1 Generic sun4u sparc SUNW,Ultra-1 > > 2. % cat VERSION > 3.3.1 > > 3. Standard output and error output of configure script: > - ------ > creating cache ./config.cache > checking for m4... m4 > checking user-defined C compiler "cc" > checking C compiler... works > checking how to make dependencies... cc -xM > checking for CC... no > checking for cxx... no > checking for c++... no > checking for g++... no > checking for gcc... no > configure: warning: Could not find working C++ compiler > configure: warning: Setting CXX to the empty string > configure: warning: The C++ interface will not be built > checking how to run the C preprocessor... cc -E > checking for f77... no > configure: warning: Could not find working FORTRAN compiler > checking for FORTRAN .F compiler... > checking for FORTRAN preprocessor... cc -E > checking for math library > checking for -lc... no > checking for -lm... yes > checking for ar... ar > checking for ranlib... ranlib > checking for stdlib.h... yes > checking for sys/types.h... yes > checking for strerror... yes > checking for ftruncate... yes > checking for st_blksize in struct stat... yes > checking whether cross-compiling... no > checking for IEEE floating point format... no I think this is the root of the problem. Our "configure" script incorrectly concludes that this Sun ULTRA does not use IEEE floating point because of an error in compiling a program to test whether it has IEEE floating point. Looking in the "config.log" file you sent ... > 4. % type cc > cc is a tracked alias for /home/opt/SUNWspro/bin/cc > % which cc > /home/opt/SUNWspro/bin/cc > > 5. % cat config.log > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > configure:1017: cc -c -O -DNDEBUG conftest.c 1>&5 > configure:1217: cc -E -DNDEBUG conftest.c >/dev/null 2>conftest.out > configure:1943: cc -o conftest -O -DNDEBUG conftest.c -lc 1>&5 > Undefined first referenced > symbol in file > tanh conftest.o > ld: fatal: Symbol referencing errors. No output written to conftest > configure:1977: cc -o conftest -O -DNDEBUG conftest.c -lm 1>&5 > configure:2072: cc -E -DNDEBUG conftest.c >/dev/null 2>conftest.out > configure:2106: cc -E -DNDEBUG conftest.c >/dev/null 2>conftest.out > configure:2156: cc -o conftest -O -DNDEBUG conftest.c 1>&5 > configure:2204: cc -o conftest -O -DNDEBUG conftest.c 1>&5 > configure:2238: cc -c -O -DNDEBUG conftest.c 1>&5 > configure:2270: cc -o conftest -O -DNDEBUG conftest.c 1>&5 > configure:2322: cc -o conftest -O -DNDEBUG conftest.c 1>&5 > "configure", line 2302: (in preprocessor if): syntax error The above syntax error was generated in trying to test for IEEE floating point. It is also the first place where the "#elif" preprocessor statement is used in these configuration tests, so I suspect your "cc" compiler is not handling the "#elif" preprocessor statement correctly. Our "/opt/SUNWspro/bin/cc" compiler on a SunOS 5.6 system works fine on this, but you might try the small #elif test I've appended to see if your cc compiler recognizes this statement. If it doesn't compile due to the "#elif", report the problem to someone who can fix it. Another way around this problem might be to use the "c89" standard C compiler instead of "cc". To do this, first remove the "config.cache" file, then "make distclean", then set your "CC" environment variable to "c89" before invoking the configure script again. If this doesn't work, please let us know (at address@hidden). Thanks for reporting the problem. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu ------------- program to test "#elif" ------ #include <stdio.h> #define MACRO_B 1 int main() { #if defined(MACRO_A) printf("error: MACRO_A should not be defined\n"); #elif defined(MACRO_B) printf("OK\n"); #else printf("error: MACRO_B is defined\n"); #endif return 0; }