Solaris Weirdness with 2.1

Georg Lohrer GeorgLohrer at gmx.de
Thu May 17 03:19:17 EDT 2001


On Tue, 15 May 2001 11:05:37 -0400, Michael P Collins
<mc7f+ at andrew.cmu.edu> wrote:

>
>I've been trying to install Python 2.1 on a Solaris box and have run
>into the following error messages during the make, any thoughts?
>
[snipped]
>Text relocation remains                         referenced
>    against symbol                  offset      in file
><unknown>                           0x38
>/usr/local/lib/libreadline.a(xmalloc.o)
><unknown>                           0x3c
>/usr/local/lib/libreadline.a(xmalloc.o)
><unknown>                           0xe0
>/usr/local/lib/libreadline.a(xmalloc.o)

These compiler errors mean, that you try to include parts of
libreadline.a into a shared library. That's definetly not possible,
because the object-moduls in a static-library are statically compiled
and not for dynamical binding. So, you need the libreadline.so
library.

I've just run into the same trouble (the next will be the gdbm
module). Both (readline, gdbm) were not available on my Solaris
system. I wrote the following history of fulfilling prerequisites.
Sorry, it's DocBook-SGML-plain text, but I think it should be possible
to extract the main things.

If you are interested in having the pdf-output, send me a personal
E-Mail.

Ciao, Georg

================================================================
            <para>The <application>readline</application> library
could be downloaded from <ulink

url="http://www.freshmeat.net"><citetitle>freshmeat.net</citetitle></ulink>.
          </listitem>
          <listitem>
            <para>The <application>gdbm</application> library could be
accessed on >on one of the
              <ulink
url="ftp://ftp.freenet.de/pub/ftp.gnu.org/gnu"><citetitle>GNU-FTP-Mirror
                  page</citetitle></ulink></para>


        <title>readline</title>
        <para>
          The <emphasis role="bold">readline</emphasis> library is not
available as shared library
          within Sun-Solaris, so we've to compile it by our own. After
downloading the tarball from
          and unpacking the archive the following compile-cycle have
been established.
        </para>
        <screen format="linespecific">
          ~/src> tar xfvz readline-4.2.tar.gz
          ~/src> cd readline-4.2
          ~/src/readline-4.2> ./configure
--prefix=/user/lgx00460/Solaris
          ~/src/readline-4.2> make shared
          ~/src/readline-4.2> cd shlib
          ~/src/readline-4.2/shlib> make install
        </screen>
        <para>This will install the
<filename>libreadline.so</filename> in the predefined path. For
          getting access on that library we have to fix a line in the
Python configuration file
          <filename>Modules/Setup</filename>. That will be shown in
section <quote><link
              endterm="compile-python"
linkend="sect.compile-python"></link></quote>
        </para>
      </sect2>
      <sect2 id='sect.prerequisites.gdbm'>
        <title id='gdbm'>gdbm</title>
        <para>The <emphasis>gdbm</emphasis> library is not available
as shared library within
          Sun-Solaris, so we've to compile it by our own. After
downloading the tarball
          <emphasis>and</emphasis> the current
<emphasis>diff</emphasis> file (<filename
            moreinfo="none">gdbm-1.8.0.tar.gz</filename> and <filename
            moreinfo="none">gdbm-1.8.0.dif</filename>) the files have
to unpacked and merged.
        </para>
        <screen format="linespecific">
          ~/src> tar xfvz gdbm-1.8.0.tar.gz
          ~/src> cd gdbm-1.8.0
          ~/src/gdbm-1.8.0> patch -p 0 <../gdbm-1.8.0.dif
          ~/src/gdbm-1.8.0> patch -p 0
<../gdbm-1.8.0.set_install_prog.diff
          ~/src/gdbm-1.8.0> ./configure
--prefix=/user/lgx00460/Solaris
          ~/src/gdbm-1.8.0> make
          ~/src/gdbm-1.8.0> make install
        </screen>
        <para>The <filename
moreinfo="none">gdbm-1.8.0.set_install_prog.diff</filename> file is
          created by myself, because using the Sun-Solaris platform
three different <filename
            moreinfo="none">install</filename> files will be found for
execution. The
          <emphasis>configure</emphasis> run even finds the correct
install-app, but don't use it
          internally for copying the files to the given path. So, I
make a small patch and saved in
          the <filename
moreinfo="none">gdbm-1.8.0.set_install_prog.diff</filename> file for
further
          usage.</para>
        <programlisting format="linespecific">
          --- Makefile.in
          +++ Makefile.in	Tue May  8 08:16:24 2001
          @@ -121,7 +121,7 @@
          
          install: libgdbm.la gdbm.h gdbm.info
          $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
$(DESTDIR)$(includedir) \
          $(DESTDIR)$(man3dir) $(DESTDIR)$(infodir)
          - $(LIBTOOL) install -c libgdbm.la
$(DESTDIR)$(libdir)/libgdbm.la
          + $(LIBTOOL) $(INSTALL_PROGRAM) libgdbm.la \       <co
id="install-program">
          $(DESTDIR)$(libdir)/libgdbm.la
          $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
          $(DESTDIR)$(includedir)/gdbm.h
          $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
          $(DESTDIR)$(man3dir)/gdbm.3
        </programlisting>
        <calloutlist>
          <callout arearefs="install-program">
            <para>The old pure call of <filename
moreinfo="none">install</filename> was replaced by
              the path of an appropriate install found by the
<filename
                moreinfo="none">configure</filename> script run
earlier.</para>


==============================================================
The following lines have to be adapted in Modules/Setup
(/user/lgx00460/Solaris/lib is local lib path under Solaris, that's
the place you have stored the previously compiled libraries).

          readline readline.c -L/user/lgx00460/Solaris/lib        
	 -L/usr/lib -lreadline -ltermcap

          gdbm gdbmmodule.c -I/usr/local/include \   
	-L/user/lgx00460/Solaris/lib -lgdbm




More information about the Python-list mailing list