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

Re: 970516: netcdf-3.3 vs. AIX 3.5



>To: address@hidden
>cc: address@hidden
>From: Kate Hedstrom <address@hidden>
>Subject: netcdf-3.3 vs. AIX 3.5
>Organization: .
>Keywords: 199705161537.JAA21900

Hi Kate,

> I am unable to compile in this configuration.  It won't compile
> posixio.c with or without _POSIX_SOURCE being defined.  Is there
> anything to do short of upgrading AIX?
> 
> Kate
> 
> 1. uname -a
> AIX moby 2 3 000048211C00
> 
> 2. VERSION
> 3.3
> 
> 3. config.out
     ...
> 
> 4. config.log
     ...
> 5. make.out
> 
> Making `all' in directory /d0/kate/netcdf/netcdf-3.3/src/libsrc
> 
>       xlc -c -O -I.  -DNDEBUG attr.c
>       xlc -c -O -I.  -DNDEBUG dim.c
>       xlc -c -O -I.  -DNDEBUG error.c
>       xlc -c -O -I.  -DNDEBUG -DVERSION=`cat ../VERSION` libvers.c
>       xlc -c -O -I.  -DNDEBUG nc.c
>       xlc -c -O -I.  -DNDEBUG ncio.c
> "./posixio.c", line 103.9: 1506-007 (S) Struct or union stat is undefined.
> "./posixio.c", line 104.17: 1506-045 (S) Undeclared identifier sb.
> "./posixio.c", line 754.16: 1506-045 (S) Undeclared identifier O_RDWR.
> "./posixio.c", line 754.23: 1506-045 (S) Undeclared identifier O_CREAT.
> "./posixio.c", line 754.31: 1506-045 (S) Undeclared identifier O_TRUNC.
> "./posixio.c", line 771.17: 1506-045 (S) Undeclared identifier O_EXCL.
> "./posixio.c", line 847.37: 1506-045 (S) Undeclared identifier O_RDWR.
> "./posixio.c", line 847.46: 1506-045 (S) Undeclared identifier O_RDONLY.
> The error code from the last failed command is 1.
     ...
> 6. make.out (#define _POSIX_SOURCE)
>       xlc -c -O -I.  -DNDEBUG ncio.c
> "/usr/include/sys/types.h", line 103.1: 1506-137 (S) Previous declaration 
> must declare at least one declarator, tag, or the members of an enumeration.
     ...

You had the right idea here, and I think we can make it work without
having to upgrade AIX.  The posixio.c module requires not only ANSI but
also POSIX defines, so you need the -D_POSIX_SOURCE flag on compile
lines.  To do this:

  1.  rm config.cache
  2.  define CPPFLAGS as "-D_POSIX_SOURCE -DNDEBUG" in your environment
      before invoking configure.
  3.  make clean
  4.  ./configure
  5.  make all test install

Please let us know if this works, since we don't have an AIX 3.5 system
to try it on.

--Russ

_____________________________________________________________________

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