[ZCM] [ZC] 1786/ 8 Comment "optimize flag causes install to fail, "undefined symbol: PL_dowarn""

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Thu May 19 10:29:15 EDT 2005


Issue #1786 Update (Comment) "optimize flag causes install to fail, "undefined symbol: PL_dowarn""
 Status Rejected, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1786

==============================================================
= Comment - Entry #8 by to_be on May 19, 2005 10:29 am

Update:
- the re.bs and re.so files in /tmp seem to be a leftover from a Zope 2.7 installation
- when tried from /tmp as the current working directory, importing re fails:
<SNIP>
0 www:/tmp # python
Python 2.3.5 (#1, Apr 19 2005, 03:28:52)
[GCC 3.3.1 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: ./re.so: undefined symbol: PL_dowarn
>>>
</SNIP>
  (inactively or non-interactively, with or without -O flag)
- no . nor /tmp entry whatsoever in $PATH environment variable
- of course, the error doesn't occur with both files deleted

Thus, somehow the /tmp directory must have become the working directory during import of the re module (with --optimize option only!)
________________________________________
= Comment - Entry #7 by mcdonc on May 19, 2005 8:23 am

No further idea then, sorry.
________________________________________
= Comment - Entry #6 by to_be on May 18, 2005 6:50 pm

I tried /usr/local/bin/python -O -c "import re", I tried it interactively, I tried both users root (used during install) and zope -- no errors whatsoever.
________________________________________
= Comment - Entry #5 by tseaver on May 18, 2005 3:25 pm

Chris wrote:

> FWIW, you should check that you can indeed do "import re" from a Python
> prompt on your system when in "optimize mode". (e.g. $
> /usr/local/bin/python -O -c "import re") without an error.  It appears
> from your traceback that the cause of the install failure is that this
> install of Python cannot import the re module, which is highly irregular.

Agreed.  The OP needs to figure out why Python is attempting to
open '/tmp/re.so' as a Python module;  that is what is causing
the problem.

If the OP doesn't need that file (it is in /tmp, after all),
then remove it and try again.

BTW, I was just able to build and install from the 2.7.6 source
tarball on both Ubuntu 5.04 and CentOS 3.

________________________________________
= Comment - Entry #4 by mcdonc on May 18, 2005 2:51 pm

FWIW, you should check that you can indeed do "import re" from a Python prompt on your system when in "optimize mode". (e.g. $ /usr/local/bin/python -O -c "import re") without an error.  It appears from your traceback that the cause of the install failure is that this install of Python cannot import the re module, which is highly irregular.
________________________________________
= Comment - Entry #3 by to_be on May 18, 2005 2:46 pm

> = Reject - Entry #2 by tseaver on May 18, 2005 10:06 am
> 
>  Status: Pending => Rejected

I can't believe it! Please reopen!

> I can't reproduce this:

Maybe someone else can, e.g. someone with SuSE Linux and Python 2.3.5 trying to install the standard Zope 2.7.6-final source package?

/I/ didn't do anything special to the re package.
________________________________________
= Reject - Entry #2 by tseaver on May 18, 2005 10:06 am

 Status: Pending => Rejected

I can't reproduce this:

---------------8< ------------------------
$ cd /tmp
[/tmp]
$ mkdir collector_1786
[/tmp]
$ cd collector_1786/
[/tmp/collector_1786]
$ ~/projects/Zope-CVS/Zope-2.7-branch/configure --with-python=~/projects/Zope-CVS/bin/python2.3 --optimize

Using Python interpreter at ~/projects/Zope-CVS/bin/python2.3

Configuring Zope installation

/home/tseaver/projects/Zope-CVS/Zope-2.7-branch/configure: line 206: ~/projects/Zope-CVS/bin/python2.3: No such file or directory
$ ~/projects/Zope-CVS/Zope-2.7-branch/configure --with-python=/home/tseaver/projects/Zope-CVS/bin/python2.3 --optimize

Using Python interpreter at /home/tseaver/projects/Zope-CVS/bin/python2.3

Configuring Zope installation

  - Zope top-level binary directory will be /opt/Zope-2.7.
  - Distutils install flags will be "--optimize=1 --no-compile"
  - Makefile written.

  Next, run make.

$ make
....

Zope built. Next, do 'make install' (or 'make instance'
to run a Zope instance directly from the build directory).

$ make install
...
Zope binaries installed successfully.
Now run '/tmp/collector_1786/installed/bin/mkzopeinstance.py'

---------------8< ------------------------

I do see one odditiy in your environment: the traceback shows that
Python is trying to import an odd filename: '/tmp/re.so'.

The 're' module in Python is not a shared library, but a wrapper
around the 'pcre.so' library (in the 'lib-dynload' directory of
your Python library).

________________________________________
= Request - Entry #1 by to_be on May 18, 2005 8:37 am

Specifying the --optimize flag with ./configure causes make install to fail:
<SNIP>
0 www:~/download/Zope-2.7.5-final # ./configure --prefix=/opt/Zope-2.7.6 --optimize

Configuring Zope installation

Testing for an acceptable Python interpreter...

Python version 2.3.5 found at /usr/local/bin/python

The optimum Python version (2.3.5) was found at /usr/local/bin/python.

  - Zope top-level binary directory will be /opt/Zope-2.7.6.
  - Distutils install flags will be "--optimize=1 --no-compile"
  - Makefile written.

  Next, run make.

0 www:~/download/Zope-2.7.5-final # make
(...)
changing mode of /root/download/Zope-2.7.5-final/build-base/python-2.3/build-scripts/test.py from 644 to 755

Zope built. Next, do 'make install' (or 'make instance'
to run a Zope instance directly from the build directory).

0 www:~/download/Zope-2.7.5-final # make install
(...)

copying /root/download/Zope-2.7.5-final/build-base/python-2.3/build-lib/Lifetime.py -> /opt/Zope-2.7.6/lib/python
writing byte-compilation script '/tmp/tmpSnL1Uq.py'
/usr/local/bin/python -O /tmp/tmpSnL1Uq.py
Traceback (most recent call last):
  File "/tmp/tmpSnL1Uq.py", line 1, in ?
    from distutils.util import byte_compile
  File "/usr/local/lib/python2.3/distutils/util.py", line 9, in ?
    import sys, os, string, re
ImportError: /tmp/re.so: undefined symbol: PL_dowarn
error: command '/usr/local/bin/python' failed with exit status 1
make: *** [install] Fehler 1
2 www:~/download/Zope-2.7.5-final #
</SNIP>

(The number at the beginning of the prompt is $?, the return code of the last executed command; no .pyo files have been created nor any .pyc)

With --optimize removed, the installation succeeds.
==============================================================



More information about the Zope-Collector-Monitor mailing list