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

Re: compiling with 64 bit problem



Hi Reimar,

> I got some problems by compiling netCDF 3.6.0-p1 on a SuSE9.3 Linux box
> (64 bit)
> This is my compiler Version:
> 
> Reading specs from /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/specs
> Configured with: ../configure --enable-threads=posix --prefix=/usr
> - --with-local-prefix=/usr/local --infodir=/usr/share/info
> - --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada
> - --disable-checking --libdir=/usr/lib64 --enable-libgcj
> - --with-slibdir=/lib64 --with-system-zlib --enable-shared
> - --enable-__cxa_atexit x86_64-suse-linux
> Thread model: posix
> gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
> 
> 
> The problem is that's fstat won't he found. This is used in posixio.c.
> 
> 
> If I do comment out the call of fstat it seems to work right. That is
> not the best solution but probably gives an idea what is wrong.
> 
> I was using the CFLAGS=-fPIC to create a shareable module.

I don't think this is a netCDF issue.

The fstat() function is standard Unix, required for a Unix system that
conforms to any of the Unix standards SVr4, SVID, POSIX, X/OPEN, or
BSD 4.3.  It's hard to believe that the fstat() call is not in your
libc library.  I don't think this has anything to do with 64 bit
options, fstat should work on any file in a file system whether it
64-bit or not.

The following function should compile, link, and run on virtually any
Unix system:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

int
main() {
    struct stat buffer;
    int         fildes;
    int         status;

    fildes = creat("/tmp/test", S_IRWXU);
    status = fstat(fildes, &buffer);
    if(status == -1)
        (void) printf("Bad return from fstat\n");
    return 0;
}

--Russ