List Info

Thread: Does anyone on the planet know how to build python-2.5 (WITH READLINE)?




Does anyone on the planet know how to build python-2.5 (WITH READLINE)?
user name
2006-11-15 19:32:43
I am having one "hades" of a heckuva time getting
readline support for 
Python-2.5 on a Mac OS 10.4.8.8.0

with Xcode 2.3( Darwin Kernel Version 8.8.0; RELEASE_PPC
Power Macintosh 
powerpc)

I can get readline-5.2 (finally) to compile and build...

Then I try build Python-2.5, with readline....by changing
the 
/Modules/Setup file...to include readline...

and I always get the below-mentioned error.

I can NOT use the std' packages/path...as we use an absolute
path for 
our server farm called,

"/usr/lanl"

EG

/usr/lanl/packages <- where python/scipy/numpy/readline
src has gone.

/usr/lanl/bin

/usr/lanl/include

/usr/lanl/lib

/usr/lanl/man

This has been an EXTREME challenge on Mac 10.4

t.

NOTE: I attempted to copy all files (esp *.o) over to my
Python build 
dir, and it still fails...the following error, was the error
before 
doing that...

Here is the error:

gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp 
-mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes 
-I. 
-I./Include   -DPy_BUILD_CORE  -c ./Modules/readline.c -o 
Modules/readline.o
Modules/readline.c: In function `write_history_file':
Modules/readline.c:118: warning: implicit declaration of
function 
`history_truncate_file'
Modules/readline.c: In function `py_remove_history':
Modules/readline.c:307: warning: implicit declaration of
function 
`remove_history'
Modules/readline.c:307: warning: assignment makes pointer
from integer 
without a cast
Modules/readline.c:316: warning: passing arg 1 of `free'
discards 
qualifiers from pointer target type
Modules/readline.c:318: warning: passing arg 1 of `free'
discards 
qualifiers from pointer target type
Modules/readline.c: In function `py_replace_history':
Modules/readline.c:344: warning: implicit declaration of
function 
`replace_history_entry'
Modules/readline.c:344: warning: assignment makes pointer
from integer 
without a cast
Modules/readline.c:353: warning: passing arg 1 of `free'
discards 
qualifiers from pointer target type
Modules/readline.c:355: warning: passing arg 1 of `free'
discards 
qualifiers from pointer target type
Modules/readline.c: In function
`get_current_history_length':
Modules/readline.c:459: error: `HISTORY_STATE' undeclared
(first use in 
this function)
Modules/readline.c:459: error: (Each undeclared identifier
is reported 
only once
Modules/readline.c:459: error: for each function it appears
in.)
Modules/readline.c:459: error: `hist_st' undeclared (first
use in this 
function)
Modules/readline.c:461: warning: implicit declaration of
function 
`history_get_history_state'
Modules/readline.c: In function `insert_text':
Modules/readline.c:509: warning: implicit declaration of
function 
`rl_insert_text'
Modules/readline.c: In function `on_completion':
Modules/readline.c:643: error:
`rl_attempted_completion_over' undeclared 
(first use in this function)
Modules/readline.c: In function `flex_complete':
Modules/readline.c:681: warning: passing arg 2 of
`completion_matches' 
from incompatible pointer type
Modules/readline.c: In function `setup_readline':
Modules/readline.c:706: warning: passing arg 2 of
`rl_bind_key_in_map' 
from incompatible pointer type
Modules/readline.c:707: warning: passing arg 2 of
`rl_bind_key_in_map' 
from incompatible pointer type
Modules/readline.c: In function
`readline_until_enter_or_signal':
Modules/readline.c:761: warning: passing arg 2 of 
`rl_callback_handler_install' from incompatible pointer type
Modules/readline.c:791: warning: implicit declaration of
function 
`rl_free_line_state'
Modules/readline.c:792: warning: implicit declaration of
function 
`rl_cleanup_after_signal'
Modules/readline.c: In function `call_readline':
Modules/readline.c:888: error: `HISTORY_STATE' undeclared
(first use in 
this function)
Modules/readline.c:888: error: `state' undeclared (first use
in this 
function)
Modules/readline.c:890: warning: assignment discards
qualifiers from 
pointer target type
make: *** [Modules/readline.o] Error 1

<mailto:pythonmac-sig%40python.org?Subject=%5BPythonmac-S
IG%5D%20%5BPython-Dev%5D%20Problems%20building%20Python%20on
%20OSX%0A%0910.4.6%3F&In-Reply-To=20060627143827.45945.q
mail%40web52303.mail.yahoo.com> 

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Does anyone on the planet know how to build python-2.5 (WITH READLINE)?
user name
2006-11-17 22:09:13
On  15 Nov 2006, at 8:32 PM, Todd Thal wrote:

> I am having one "hades" of a heckuva time
getting readline support for
> Python-2.5 on a Mac OS 10.4.8.8.0

Have you looked at Mac/BuildScript/build-installer.py in
Python's  
source distribution? That's how the official binaries for
OSX get  
build, includeing readline support.

You probably have to add the directory containing readline
to the  
CFLAGS and LDFLAGS when running Python's configure, AFAIK
setup.py  
doesn't automaticly look for readline in
$prefix/{lib,include}.

Ronald


_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Does anyone on the planet know how to build python-2.5 (WITH READLINE)?
user name
2006-11-18 15:34:50
    Ronald> You probably have to add the directory
containing readline to
    Ronald> the CFLAGS and LDFLAGS when running Python's
configure, AFAIK
    Ronald> setup.py doesn't automaticly look for
readline in
    Ronald> $prefix/{lib,include}.

Since readline is an extension module I think you want to
specify this stuff
to distutils, e.g.:

    % ./python.exe ../setup.py build_ext --help
    Common commands: (see '--help-commands' for more)

      setup.py build      will build the package underneath
'build/'
      setup.py install    will install the package

    Global options:
      --verbose (-v)  run verbosely (default)
      --quiet (-q)    run quietly (turns verbosity off)
      --dry-run (-n)  don't actually do anything
      --help (-h)     show detailed help message

    Options for 'PyBuildExt' command:
      --build-lib (-b)     directory for compiled extension
modules
      --build-temp (-t)    directory for temporary files
(build by-products)
      --inplace (-i)       ignore build-lib and put compiled
extensions into the
                           source directory alongside your
pure Python modules
      --include-dirs (-I)  list of directories to search for
header files
                           (separated by ':')
      --define (-D)        C preprocessor macros to define
      --undef (-U)         C preprocessor macros to undefine
      --libraries (-l)     external C libraries to link with
      --library-dirs (-L)  directories to search for
external C libraries
                           (separated by ':')
      --rpath (-R)         directories to search for shared
C libraries at runtime
      --link-objects (-O)  extra explicit link objects to
include in the link
    ...

which suggests something like

    ./python.exe setup.py build_ext
--include-dirs=/sw/include --library-dirs=/sw/lib

I have fink installed, hence the references to /sw/...

As proof for the OP that it can be done:

    % python
    Python 2.6a0 (trunk:52571, Oct 31 2006, 20:49:22) 
    [GCC 4.0.0 (Apple Computer, Inc. build 5026)] on darwin
    Type "help", "copyright",
"credits" or "license" for more
information.
    >>> import readline
    >>> readline.__file__
   
'/Users/skip/local/lib/python2.6/lib-dynload/readline.so'
    % otool -L
/Users/skip/local/lib/python2.6/lib-dynload/readline.so
    /Users/skip/local/lib/python2.6/lib-dynload/readline.so:
            /sw/lib/libreadline.4.dylib (compatibility
version 4.2.0, current version 4.3.0)
            /sw/lib/ncurses/libncurses.5.dylib
(compatibility version 5.0.0, current version 5.0.0)
            /usr/lib/libmx.A.dylib (compatibility version
1.0.0, current version 93.0.0)
            /usr/lib/libSystem.B.dylib (compatibility
version 1.0.0, current version 88.1.7)

Skip
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Does anyone on the planet know how to build python-2.5 (WITH READLINE)?
user name
2006-11-18 15:42:07
On  18 Nov 2006, at 4:34 PM, skippobox.com wrote:

>
>     Ronald> You probably have to add the directory
containing  
> readline to
>     Ronald> the CFLAGS and LDFLAGS when running
Python's configure,  
> AFAIK
>     Ronald> setup.py doesn't automaticly look for
readline in
>     Ronald> $prefix/{lib,include}.
>
> Since readline is an extension module I think you want
to specify  
> this stuff
> to distutils, e.g.:

Changing the CFLAGS/LDFLAGS at configure time works to (at
least on  
darwin/OSX systems). I applied a patch to that effect in 2.4
and 2.5  
because I got mightily annoyed with this. Before my patch
you could  
specify other CFLAGS/LDFLAGS as much as you liked, but the
autodetect  
code in setup.py would never use that. With my patch the
include and  
library directories in those variablese are used to
autodetect  
readline and other libraries.

The reason this is only done on OSX is that I never got
around to  
asking on python-dev if this behaviour is useful on other
platforms  
as well (IMHO it is, and the code should work at least on
Linux and  
other GCC-using platforms).

Ronald

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Does anyone on the planet know how to build python-2.5 (WITH READLINE)?
user name
2006-12-01 01:49:51
On Nov 15, 2006, at 2:32 PM, Todd Thal wrote:

> I am having one "hades" of a heckuva time
getting readline support for
> Python-2.5 on a Mac OS 10.4.8.8.0

Thanks to Ronald and Skip for replying to this thread.  It
took me a  
little bit to connect the dots from their replies, so I
thought I'd  
share my experiences.  Maybe this can help someone, and
maybe also  
lead to Ronald or someone else clarifying the right way to
use his  
CFLAGS and LDFLAGS patch.

I'm using darwinports, so first I had to

sudo port install readline

Once that was done, I wanted to build a local, non-framework
Python  
with readline.  darwinports uses /opt/local, so Ronald's
approach led  
me to this best guess:

$ CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
./configure -- 
prefix=/Users/gary/py
$ make

However, that was unsuccessful.

$ ./python.exe
Python 2.4.4 (#1, Nov 30 2006, 20:36:29)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright",
"credits" or "license" for more
information.
 >>> import readline
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: No module named readline

Maybe someone could let me know what I did wrong?

Skip's approach was a little more unusual, at least to me,
since it  
was a step in-between `make` and `make install`.  However,
it  
worked.   If, after
a configure and a make (but, again, before a  
make install) I run this command...

$ ./python.exe setup.py build_ext
--include-dirs=/opt/local/include -- 
library-dirs=/opt/local/lib

...then readline appears in glory.

$ ./python.exe Python 2.4.4 (#1, Nov 30 2006, 20:36:29)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright",
"credits" or "license" for more
information.
 >>> import readline
 >>>

Yay!

Of course, I could have copied readline.so from MacPython
but that  
would have been cheating. 

HTH someone

Gary
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Does anyone on the planet know how to build python-2.5 (WITH READLINE)?
user name
2006-12-01 16:04:03
On  1 Dec 2006, at 2:49 AM, Gary Poster wrote:

>
> On Nov 15, 2006, at 2:32 PM, Todd Thal wrote:
>
>> I am having one "hades" of a heckuva time
getting readline support  
>> for
>> Python-2.5 on a Mac OS 10.4.8.8.0
>
> Thanks to Ronald and Skip for replying to this thread. 
It took me a
> little bit to connect the dots from their replies, so I
thought I'd
> share my experiences.  Maybe this can help someone, and
maybe also
> lead to Ronald or someone else clarifying the right way
to use his
> CFLAGS and LDFLAGS patch.
>
> I'm using darwinports, so first I had to
>
> sudo port install readline
>
> Once that was done, I wanted to build a local,
non-framework Python
> with readline.  darwinports uses /opt/local, so
Ronald's approach led
> me to this best guess:
>
> $ CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
./configure --
> prefix=/Users/gary/py

This should do the trick, more or less. The build script for
the  
python.org installer uses:

./configure --prefix=/Users/gary/py LDFLAGS=-L/opt/local/lib
OPT=-I/ 
opt/local/include

> $ make

If you're using macports you might as well do 'port install
python2.4'.

Ronald

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )