[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re 20001212: Can't install netcdf-3.4



>From: Francisco Pastor <address@hidden>
>Organization: Fundacion CEAM, Spain
>To: russ
>Subject: Re 20001212: Can't install netcdf-3.4 
>Keywords: 200012121204.eBCC4qo03395

Hi again,

>     Thanks for answering my question. I've followed your suggestions and set 
> the following
> variables (I am using csh)
> 
> set CC=gcc
> set CPPFLAGS="-DNDEBUG -DhpuxFortran"
> set CFLAGS=-O
> set CXX=g++
> set FFLAGS="-O3 -w"
> set FC="f77"

Those commands don't set the environment variables used by the
configure script.  I assume you are using "csh" or "tcsh" for your
shell, since you are trying to set environment variables with this
kind of command.  You need to use the "setenv" command, not the "set"
command to set environment variables.  For example:

 setenv CC=gcc
 setenv CPPFLAGS="-DNDEBUG -D_HPUX_SOURCE"
 setenv CFLAGS=-O
 setenv CXX=g++
 setenv FFLAGS="-O3 -w"
 setenv FC="f77"

I've changed the "-DhpuxFortran" to "-D_HPUX_SOURCE" in the settings
above, because that's what's recommended in the INSTALL file for HP-UX
10.20, at

  http://www.unidata.ucar.edu/packages/netcdf/INSTALL

That file also recommends using FC=/opt/fortran/bin/fort77, but I
don't know if that Fortran compiler works with calling C functions
compiled by gcc, so maybe f77 will work as you are trying.  If you
don't actually need the Fortran interface for netCDF, you can specify
FC="" to indicate you only need the C and C++ interfaces.

> 
>     But when running configure I get this error
> 
> ./configure
> creating cache ./config.cache
> checking for m4... m4
> checking for xlc... no
> checking for c89... no
> checking for acc... no
> checking for cc... cc
> checking C compiler... works
> checking how to make dependencies... false
> checking for CC... no
> checking for cxx... no
> checking for c++... c++
> checking C++ compiler "c++"... works
> checking how to run the C preprocessor... cc -E
> checking for fort77... fort77

The fact that it found "fort77" indicates you have it installed, so if
you really need the Fortran interface and f77 doesn't work, try fort77
instead.

> checking for Fortran .F compiler...
> checking if Fortran compiler handles *.F files... yes
> checking for C-equivalent to Fortran routine "SUB"... nm:  conftest.o:  
> cannot open
> configure: error: not found
> 
>     And this messages at config.log
> 
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
> 
> configure:1020: cc -c -O -DNDEBUG conftest.c 1>&5
> (Bundled) cc: warning 480: The -O option is available only with the C/ANSI C 
> product; ignored.
> configure:1153: c++ -c  -DNDEBUG conftest.C 1>&5
> configure:1220: cc -E -DNDEBUG conftest.c >/dev/null 2>conftest.out
> configure:1373: fort77 -c -O conftest.f
> fort77: POSIX 1003.2 mandates opt level following -O; expected values 0-4, 
> received: conftest.f; ignored
> configure:1422: fort77 -o conftest -O conftest.F  -lU77
> fort77: POSIX 1003.2 mandates opt level following -O; expected values 0-4, 
> received: conftest.F; ignored
> configure:1463: fort77 -c -O conftest.f
> fort77: POSIX 1003.2 mandates opt level following -O; expected values 0-4, 
> received: conftest.f; ignored

The fact that the flags to the Fortran compiler were "-O" rather than
the "-O3 -w" you had specified as the value of FFLAGS indicated the
FFLAGS environment variable was not set, since you used "set" instead
of "setenv".
 
If you need any more help setting environment variables, see the
section of this subject in the file

  http://www.unidata.ucar.edu/packages/netcdf/INSTALL

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu