Large File Support

Rod MacNeil rmacneil at interactdirect.com
Fri Jul 20 12:19:41 EDT 2001


Thanks for your suggestion Art.

I tried:

    $ CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
    $ export CFLAGS
    $ ./configure OPT="-O2 ${CFLAGS}"

But when I ran make I got:



gcc -c -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H  -o
Obje
    cts/fileobject.o Objects/fileobject.c
    Objects/fileobject.c: In function `_portable_ftell':
    Objects/fileobject.c:267: incompatible types in return
    Objects/fileobject.c:275: warning: control reaches end of non-void
function
    make: *** [Objects/fileobject.o] Error 1

I looked in the Makefile and the CFLAGS I specified were not there where I
expected.

The following seems to work but I'd like to know if it seems correct to you:

1. Run $ ./configure
2. Edit the Makefile and change the OPT=  line near the top as follows:

    OPT=            -g  -O2  -Wall  -Wstrict-prototypes

        -to-



OPT=            -g  -O2  -D_LARGEFILE64_SOURCE  -D_FILE_OFFSET_BITS=64  -Wal
l  -Wstrict-prototypes

3. Run make

Its a bit of a pain to do this everytime ./configure is run but more
important to me is finding out if there is
something wrong with doing it this way? I am not a C programmer.

BTW: The Python 2.1 docs specify -D_LARGEFILE64_SOURCE instead
of -D_LARGEFILE_SOURCE. I tried the above method both ways and it seems to
work.

Thanx in Advance

Here's the top section of the Makefile:

# === Variables set by makesetup ===

MODOBJS=          Modules/gcmodule.o  Modules/threadmodule.o
Modules/signalmodu
le.o  Modules/posixmodule.o  Modules/_sre.o
MODLIBS=        $(LOCALMODLIBS) $(BASEMODLIBS)

# === Variables set by configure
VERSION=        2.1
srcdir=         .

CC=             gcc
CXX=            c++
LINKCC=         $(PURIFY) $(CC)
AR=             ar
RANLIB=         ranlib

# Shell used by make (some versions default to the login shell, which is
bad)
SHELL=          /bin/sh

# Use this to make a link between python$(VERSION) and python in $(BINDIR)
LN=             ln

# Portable install script (configure doesn't always guess right)
INSTALL=        /usr/bin/install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_SCRIPT= ${INSTALL_PROGRAM}
INSTALL_DATA=   ${INSTALL} -m 644
# Shared libraries must be installed with executable mode on some systems;
# rather than figuring out exactly which, we always give them executable
mode.
# Also, making them read-only seems to be a good idea...
INSTALL_SHARED= ${INSTALL} -m 555

MAKESETUP=      $(srcdir)/Modules/makesetup

# Compiler options
OPT=            -g -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
stri
ct-prototypes
DEFS=           -DHAVE_CONFIG_H
CFLAGS=         $(OPT) -I. -I$(srcdir)/Include $(DEFS)
LDFLAGS=
LDLAST=
SGI_ABI=
CCSHARED=       -fPIC
LINKFORSHARED=  -Xlinker -export-dynamic
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=
# C flags used for building the interpreter object files
PY_CFLAGS=      $(CFLAGS) $(CFLAGSFORSHARED)



"Art Haas" <arthur.haas at westgeo.com> wrote in message
news:lru207zoqx.fsf at haasart1.dhcp.wg.waii.com...
> "Rod MacNeil" <rmacneil at interactdirect.com> writes:
>
> > Hello NG,
> >
> > I need to build Python to include large file support on Redhat Linux
7.1.
> >
> > I tried the following instructions from section 8.1.1 in the Python docs
but
> > it doesn't work:
> >
> >     On large-file-capable Linux systems, this might work:
> >
> >
> > CC="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
> > export CC
> > ./configure
> >
> >
> > I think this fails because the variable CC is expected to have the
compiler
> > name (gcc).
> >
> > Does anyone have any alternative instructions?
> >
>
> Don't set `CC', set `CFLAGS' ...
>
> $ CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
> $ export CFLAGS
> $ ./configure
> ...
>
> You'll probably have to go in and edit the Makefile, to set these same
> flags for the `OPT' variable as well. Or, when you run `configure',
> you could ...
>
> $ ./configure OPT="-O2 ${CFLAGS}"
>
> ... and things should work. If you want to have debug info in the
> compiled program, add a `-g' to the OPT variable. Check the makefile
> when configure finishes to ensure that the largefile flags are in the
> OPT variable.
>
> --
> ###############################
> # Art Haas
> # (713) 689-2417
> ###############################





More information about the Python-list mailing list