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.
Hi Harsh, > From: Harsh Anand <address@hidden> > Subject: netcdf-3.4 installation configure script fails on IBM RS/6000 > Organization: LBNL/NERSC > Keywords: 199908182113.PAA12038 netCDF 3.4 AIX In the above message, you wrote: > I am trying to install netcdf-3.4 on IBM RS/6000 and configure script > fails. > Please see the information appended below. > > Thanks for your help. > > Harsh > > -- > Harsh Anand ---------------------------------- address@hidden -| > NERSC User Services phone: (510) 486-5575 | > Lawrence Berkeley Lab Fax: (510) 486-7520 | > Univ. of California, Berkeley ------------------------------------ > > 1. Here are the list of environment variables that I set before runnning > > the script Configure: > setenv CC xlc > setenv CPPFLAGS -DNDEBUG > setenv CFLAGS -O > setenv FC xlf > setenv FFLAGS -O > setenv LIBS /lib/libm.a The last line above might be the cause of your problems. The LIBS environment variable, if set, needs to be a set of library references acceptable to both the C compiler and your linker. It could be that your C compiler doesn't handle library references in the above form. I suggest trying something like "-L/lib -lm" instead. > > > uname -a > AIX d100103 3 4 000034254C00 > > > > cat VERSION > 3.4 > > > which xlf > /bin/xlf > > > which xlc > /usr/vac/bin/xlc > > > cat configure.log > creating cache ./config.cache > checking for m4... m4 > checking user-defined C compiler "xlc" > checking C compiler... works > checking how to make dependencies... false > checking for xlC... no > 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... /lib/cpp > checking user-defined Fortran compiler "xlf"... works > checking for Fortran .F compiler... > checking if Fortran compiler handles *.F files... yes > checking for C-equivalent to Fortran routine "SUB"... sub > checking for Fortran "byte"... yes > checking for Fortran "integer*2"... yes > checking if Fortran "byte" is C "signed char"... yes > checking if Fortran "byte" is C "short"... no > checking if Fortran "byte" is C "int"... no > checking if Fortran "byte" is C "long"... no > checking if Fortran "integer*2" is C "short"... yes > checking if Fortran "integer*2" is C "int"... no > checking if Fortran "integer*2" is C "long"... no > checking if Fortran "integer" is C "int"... yes > checking if Fortran "real" is C "float"... yes > checking if Fortran "doubleprecision" is C "double"... yes > checking for Fortran-equivalent to netCDF "byte"... byte > checking for Fortran-equivalent to netCDF "short"... integer*2 > checking for math library > checking for -lc... 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 whether cross-compiling... yes If the configure script thinks that you're cross-compiling, then it couldn't compile a relatively simple C program. The reason for this should be in the file "config.log". > checking for working ftruncate()... configure: error: can not run test > program while cross compiling > > > cat config.log > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > configure:1020: xlc -c -O -DNDEBUG conftest.c 1>&5 > configure:1220: xlc -E -DNDEBUG conftest.c >/dev/null 2>conftest.out > 1506-173 (W) Option lm is not valid. Enter xlc for list of valid > options. > 1506-173 (W) Option lm is not valid. Enter xlc for list of valid > options. The above warnings are rather odd considering that the "lm" option doesn't appear on the "xlc" command-line. Could your C compilation environment be faulty? > configure:1235: xlc -E -traditional-cpp -DNDEBUG conftest.c >/dev/null > 2>conftest.out > xlc: 1501-210 command option t contains an incorrect subargument > 1506-173 (W) Option lm is not valid. Enter xlc for list of valid > options. > 1506-173 (W) Option lm is not valid. Enter xlc for list of valid > options. > configure:1319: xlf -c -O conftest.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.f. > configure:1422: xlf -o conftest -O conftest.F > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.F. > configure:1463: xlf -c -O conftest.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.f. > configure:1498: xlf -c -O conftest.f > ** sub === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.f. > configure:1521: xlf -c -O conftest.f > ** sub === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.f. > configure:1555: xlc -c -DNDEBUG -O conftest.c > configure:1557: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1559: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1561: ./conftest > configure:1602: xlc -c -DNDEBUG -O conftest.c > configure:1604: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1606: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1608: ./conftest > configure:1649: xlc -c -DNDEBUG -O conftest.c > configure:1651: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1653: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1655: ./conftest > configure:1696: xlc -c -DNDEBUG -O conftest.c > configure:1698: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1700: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1702: ./conftest > configure:1747: xlc -c -DNDEBUG -O conftest.c > configure:1749: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1751: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1753: ./conftest > configure:1794: xlc -c -DNDEBUG -O conftest.c > configure:1796: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1798: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1800: ./conftest > configure:1841: xlc -c -DNDEBUG -O conftest.c > configure:1843: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1845: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1847: ./conftest > configure:1890: xlc -c -DNDEBUG -O conftest.c > configure:1892: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1894: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1896: ./conftest > configure:1937: xlc -c -DNDEBUG -O conftest.c > configure:1939: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1941: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1943: ./conftest > configure:1984: xlc -c -DNDEBUG -O conftest.c > configure:1986: xlf -O -c conftestf.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftestf.f. > configure:1988: xlf -o conftest -O conftestf.o conftest.o /lib/libm.a > configure:1990: ./conftest > configure:2023: xlf -c -O conftest.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.f. > configure:2044: xlf -c -O conftest.f > ** _main === End of Compilation 1 === > 1501-510 Compilation successful for file conftest.f. > configure:2084: xlc -o conftest -O -DNDEBUG conftest.c -lc /lib/libm.a > 1>&5 > configure:2213: /lib/cpp -DNDEBUG conftest.c >/dev/null 2>conftest.out > configure:2247: /lib/cpp -DNDEBUG conftest.c >/dev/null 2>conftest.out > configure:2297: xlc -o conftest -O -DNDEBUG conftest.c /lib/libm.a 1>&5 > > configure:2331: xlc -o conftest -O -DNDEBUG conftest.c /lib/libm.a 1>&5 The line above is the one that checks for cross-compilation. Since there are no more lines after it, it would appear that your C compilation environment is faulty. You might try the following to discover the underlying problem: 1. Go to the top-level source directory. 2. Execute the command "make distclean". 3. Remove the file "config.cache" if it exists. 4. Set your environment variables as before. 5. Edit the configure script: insert the line "exit" before line 2337, which should contain the command "rm -fr conftest*". 6. Execute the configure script. It will exit prematurely, after testing for cross-compilation, leaving the test file "conftest.c" around. The last line in the file "config.log" will be the command that tried to build the program "conftest" from that file. 7. Try manually building the program "conftest" from the file "conftest.c". This should help you discover the underlying problem. -------- Steve Emmerson <http://www.unidata.ucar.edu>