Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Failed to compile GDB 7.2 with python support
@ 2010-09-29 20:30 Michel METZGER
  2010-09-29 20:37 ` Mathew Yeates
  2010-09-29 20:37 ` Joel Brobecker
  0 siblings, 2 replies; 5+ messages in thread
From: Michel METZGER @ 2010-09-29 20:30 UTC (permalink / raw)
  To: gdb

Hi all,

I tried to compile GDB 7.2 with python support (2.6.6) under Linux and it fails during the configure phase.
Python was compile like with:

> ./configure --prefix=/tmp/python-2.6.6-install --enable-shared make 
> make install

And GDB with

> ./configure --with-python=/tmp/python-2.6.6-install 
> --prefix=/tmp/gdb-7.2-install make

It fails during the execution of gdb/configure with the following message:

-------------------------------------------------------------
[...]
checking whether to use python... /tmp/python-2.6.6-install/ checking for python2.6... no
configure: error: no usable python found at /tmp/python-2.6.6-install/
make[1]: *** [configure-gdb] Error 1
-------------------------------------------------------------

The gdb/config.log tells me that configure failed to compile a test program to set up python.
From what I understand, the faulty compilation command line is: 

--------------------------------------------------------------
[...]
configure:10682: gcc -o conftest -g -O2   -I/tmp/python-2.6.6-install/include -I/tmp/python-2.6.6-install/include    conftest.c -lncurses -lz -lm    -lpthread -ldl -lutil -lm -lpython2.6 >&5
/usr/bin/ld: cannot find -lpython2.6
[...]
--------------------------------------------------------------

Apparently the -L/tmp/Python-2.6.6-install/lib is missing.

What am I doing wrong?

Best regards,

Michel Metzger.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Failed to compile GDB 7.2 with python support
  2010-09-29 20:30 Failed to compile GDB 7.2 with python support Michel METZGER
  2010-09-29 20:37 ` Mathew Yeates
@ 2010-09-29 20:37 ` Joel Brobecker
       [not found]   ` <5B4CE209869C6A4797F5FAA0B348F0A0D9E83E2E74@SAFEX1MAIL1.st.com>
  1 sibling, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2010-09-29 20:37 UTC (permalink / raw)
  To: Michel METZGER; +Cc: gdb

> --------------------------------------------------------------
> [...]
> configure:10682: gcc -o conftest -g -O2   -I/tmp/python-2.6.6-install/include -I/tmp/python-2.6.6-install/include    conftest.c -lncurses -lz -lm    -lpthread -ldl -lutil -lm -lpython2.6 >&5
> /usr/bin/ld: cannot find -lpython2.6
> [...]
> --------------------------------------------------------------
> 
> Apparently the -L/tmp/Python-2.6.6-install/lib is missing.
> 
> What am I doing wrong?

Something might be incorrect in your Python install (or non-standard).
What does

        /tmp/python-2.6.6-install/bin/python python-config.py --ldflags

print (this python script is in the gdb/python/ subdirectory of the
GDB sources).

-- 
Joel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Failed to compile GDB 7.2 with python support
  2010-09-29 20:30 Failed to compile GDB 7.2 with python support Michel METZGER
@ 2010-09-29 20:37 ` Mathew Yeates
  2010-09-29 20:37 ` Joel Brobecker
  1 sibling, 0 replies; 5+ messages in thread
From: Mathew Yeates @ 2010-09-29 20:37 UTC (permalink / raw)
  To: Michel METZGER; +Cc: gdb

this is a hack, but you could do
LDFLAGS=-L<path to libpython2.6> ./configure

On Wed, Sep 29, 2010 at 1:30 PM, Michel METZGER <michel.metzger@st.com> wrote:
> Hi all,
>
> I tried to compile GDB 7.2 with python support (2.6.6) under Linux and it fails during the configure phase.
> Python was compile like with:
>
>> ./configure --prefix=/tmp/python-2.6.6-install --enable-shared make
>> make install
>
> And GDB with
>
>> ./configure --with-python=/tmp/python-2.6.6-install
>> --prefix=/tmp/gdb-7.2-install make
>
> It fails during the execution of gdb/configure with the following message:
>
> -------------------------------------------------------------
> [...]
> checking whether to use python... /tmp/python-2.6.6-install/ checking for python2.6... no
> configure: error: no usable python found at /tmp/python-2.6.6-install/
> make[1]: *** [configure-gdb] Error 1
> -------------------------------------------------------------
>
> The gdb/config.log tells me that configure failed to compile a test program to set up python.
> From what I understand, the faulty compilation command line is:
>
> --------------------------------------------------------------
> [...]
> configure:10682: gcc -o conftest -g -O2   -I/tmp/python-2.6.6-install/include -I/tmp/python-2.6.6-install/include    conftest.c -lncurses -lz -lm    -lpthread -ldl -lutil -lm -lpython2.6 >&5
> /usr/bin/ld: cannot find -lpython2.6
> [...]
> --------------------------------------------------------------
>
> Apparently the -L/tmp/Python-2.6.6-install/lib is missing.
>
> What am I doing wrong?
>
> Best regards,
>
> Michel Metzger.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Failed to compile GDB 7.2 with python support
       [not found]   ` <5B4CE209869C6A4797F5FAA0B348F0A0D9E83E2E74@SAFEX1MAIL1.st.com>
@ 2010-09-30  4:14     ` Joel Brobecker
  2010-09-30 20:07       ` Michel METZGER
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2010-09-30  4:14 UTC (permalink / raw)
  To: Michel METZGER; +Cc: gdb

[added gdb@sourceware.org back so that everyone can follow the
discussion and any suggestion that might emerge]

> It prints
> 
> -lpthread -ldl -lutil -lm -lpython2.6

It's all coming back to me, now. I was thinking of a discussion
we had with MichaelS, but in fact, it was something I already
found earlier:

http://www.sourceware.org/ml/gdb-patches/2010-07/msg00168.html
http://www.sourceware.org/ml/gdb-patches/2010-08/msg00047.html

(you are facing issue #1)

You're facing that problem because you built python with --enable-shared.
The problem is indeed in the python-config.py script, which we copied
from the Python sources.  And the bad news is that fixing it is far
from trivial - and it gets worse when one starts considering MacOS
and Windows.

Unless you are interested in hacking that script to make it work,
I suspect the simplest is to add the -L yourself (through LDFLAGS).
Or hack the python-config.py script to add it for you.  Whichever
is simplest in your case.

-- 
Joel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Failed to compile GDB 7.2 with python support
  2010-09-30  4:14     ` Joel Brobecker
@ 2010-09-30 20:07       ` Michel METZGER
  0 siblings, 0 replies; 5+ messages in thread
From: Michel METZGER @ 2010-09-30 20:07 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

I understand now.

Thanks for your help guys!

-- 
Michel.

-----Original Message-----
From: Joel Brobecker [mailto:brobecker@adacore.com] 
Sent: Thursday, September 30, 2010 12:15 AM
To: Michel METZGER
Cc: gdb@sourceware.org
Subject: Re: Failed to compile GDB 7.2 with python support

[added gdb@sourceware.org back so that everyone can follow the
discussion and any suggestion that might emerge]

> It prints
> 
> -lpthread -ldl -lutil -lm -lpython2.6

It's all coming back to me, now. I was thinking of a discussion
we had with MichaelS, but in fact, it was something I already
found earlier:

http://www.sourceware.org/ml/gdb-patches/2010-07/msg00168.html
http://www.sourceware.org/ml/gdb-patches/2010-08/msg00047.html

(you are facing issue #1)

You're facing that problem because you built python with --enable-shared.
The problem is indeed in the python-config.py script, which we copied
from the Python sources.  And the bad news is that fixing it is far
from trivial - and it gets worse when one starts considering MacOS
and Windows.

Unless you are interested in hacking that script to make it work,
I suspect the simplest is to add the -L yourself (through LDFLAGS).
Or hack the python-config.py script to add it for you.  Whichever
is simplest in your case.

-- 
Joel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-30 20:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-29 20:30 Failed to compile GDB 7.2 with python support Michel METZGER
2010-09-29 20:37 ` Mathew Yeates
2010-09-29 20:37 ` Joel Brobecker
     [not found]   ` <5B4CE209869C6A4797F5FAA0B348F0A0D9E83E2E74@SAFEX1MAIL1.st.com>
2010-09-30  4:14     ` Joel Brobecker
2010-09-30 20:07       ` Michel METZGER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox