Re: compiling Python 2.7.1 with readline module fails on Debian(Virtualbox)

Discussion in 'Python' started by Benedict Verheyen, Dec 23, 2010.

  1. On 23/12/2010 14:09, Benedict Verheyen wrote:
    <snip>
    >
    > I started from scratch.
    > I tried to build readline 6 and 5, and installing the packages system wide
    > as opposed to $HOME/local, but everytime Python fails to find it.
    >
    > On stable, apt-get build-dep python 2.6 doesn't work, but
    > apt-get build-dep python 2.5 does so i did that.
    >
    > At configure time, the libreadline library is now found but i have no clue
    > why it didn't find the readline version i built.
    > At the end of the Python build, it still ends with this message:
    >
    > Failed to build these modules:
    > readline
    >
    > The other modules that where automatically installed via the build-dep
    > command are built successfully.
    > I have pasted the config.log here:
    > http://paste.pocoo.org/show/308859/
    >
    > Thanks,
    > Benedict
    >


    I did a new test, again completely from scratch.
    I built ncurses and readline, installed them system wide (normal make install
    without a --prefix).
    Then i editing Modules/Setup.dist to include readline and adding the correct paths
    to the include and libs files. configure now finds the readline library.
    However, ncurses and readline still fail to be built.

    I had a look at the output of make.
    This is the error for ncurses:

    building '_curses' extension
    gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I.
    -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c
    /home/benedict/src/Python-2.7.1/Modules/_cursesmodule.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o

    gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o -L/home/benedict/local/lib
    -L/usr/local/lib -L. -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses.so
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a(lib_addch.o): relocation R_X86_64_32 against `a local symbol'
    can not be used when making a shared object; recompile with -fPIC
    /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status

    building '_curses_panel' extension
    gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I.
    -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c
    /home/benedict/src/Python-2.7.1/Modules/_curses_panel.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o

    gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o -L/home/benedict/local/lib
    -L/usr/local/lib -L. -lpanel -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses_panel.so
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a(p_above.o): relocation R_X86_64_32 against `a local symbol' can
    not be used when making a shared object; recompile with -fPIC
    /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status

    The error for readline:

    gcc -pthread -Xlinker -export-dynamic -o python \
    Modules/python.o \
    -L. -lpython2.7 -lpthread -ldl -lutil -lreadline -L/usr/local/lib -lm
    /usr/local/lib/libreadline.so: undefined reference to `PC'
    /usr/local/lib/libreadline.so: undefined reference to `tgetflag'
    /usr/local/lib/libreadline.so: undefined reference to `tgetent'
    /usr/local/lib/libreadline.so: undefined reference to `UP'
    /usr/local/lib/libreadline.so: undefined reference to `tputs'
    /usr/local/lib/libreadline.so: undefined reference to `tgoto'
    /usr/local/lib/libreadline.so: undefined reference to `tgetnum'
    /usr/local/lib/libreadline.so: undefined reference to `BC'
    /usr/local/lib/libreadline.so: undefined reference to `tgetstr'
    collect2: ld returned 1 exit status
    make: *** [python] Fout 1

    Thanks,
    Benedict
     
    Benedict Verheyen, Dec 23, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke Kenneth Casson Leighton
    Replies:
    0
    Views:
    475
    Luke Kenneth Casson Leighton
    Dec 31, 2008
  2. TechieInsights

    Python Socket Issues with VirtualBox

    TechieInsights, May 22, 2009, in forum: Python
    Replies:
    3
    Views:
    553
    Luis Zarrabeitia
    May 27, 2009
  3. gavino
    Replies:
    4
    Views:
    541
    gavino
    Sep 20, 2010
  4. Benedict Verheyen
    Replies:
    0
    Views:
    304
    Benedict Verheyen
    Dec 22, 2010
  5. Stefan Sonnenberg-Carstens
    Replies:
    0
    Views:
    626
    Stefan Sonnenberg-Carstens
    Dec 23, 2010
Loading...

Share This Page