Installing Zope 2.7 on Fedora 8
The short story is that you need to install g++ on Fedora 8 before you can install Zope 2.7.
The long story starts with Zope 2.7 wanting Python 2.3, and not working out of the box with Python 2.5 or greater. You can force the install with Python 2.5 by passing --with-python=/path/to/python2.5 to Zope's configure, but then you get this error on startup:
$ bin/zopectl start
Traceback (most recent call last):
[...]
AttributeError: 'wrapper_descriptor' object has no attribute 'im_func'
$
At this point you can either fix Zope 2.7, or just install Python 2.3. No-brainer, right? Well, it turns out that Python 2.3 comes with this warning:
[T]his release may fail to build on current operating systems [...]. [Y]ou might have to come up with work-arounds.
Python 2.4, which Zope 2.7 can also use, has a parallel warning. And I am here today because, verily, Fedora 8 falleth under these maledictions. Specifically, when you run configure for Python 2.3 on Fedora 8, you get this output:
$ ./configure
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for --with-cxx=... no
checking for c++... no
checking for g++... no
checking for gcc... gcc
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.
$
And here is what config.log has to say:
configure:1753: checking for C++ compiler default output file name
configure:1756: gcc conftest.cc >&5
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
configure:1759: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _BSD_TYPES 1
| #define _XOPEN_SOURCE 600
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200112L
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:1798: error: C++ compiler cannot create executables
Time, then, for a work-around (since fixing this can't possibly be more work than fixing Zope 2.7). Based on this line:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
I went on a wild goose chase for cc1plus. I ended up actually svn checkout-ing a couple different versions of GCC to track it down. (GCC, it turns out, is a truly monstrous codebase.) From what I can tell, it is the "actual" C++ compiler that a gcc front-end hands off to when it hits C++ code (I could be wrong). I found it on my local machine but not on the Fedora 8 server. Anyway, the Internet's advice was simply to install g++. So, not fully understanding the relationship between gcc, g++, and cc1plus, that's more or less what I did: a full, sandboxed install of GCC from source. Then I configured Python 2.3 --with-cxx=$MYGXX, and it worked all peachy.
I ended up installing GCC 3.4.6 because that's the version I have locally and it works. Later versions may very well work, and you could probably get a yum-packaged version to work too (if you're comfortable with package managers).
I did try telling Python's configure that /usr/bin/gcc was the C++ compiler. This fooled configure but then I simply hit the same cc1plus error in make. Upon reflection, this attempt sounds like a bit of a WTF. However, the gcc man page made it sound like this might in fact be true ("gcc - GNU project C and C++ compiler"), and I had/have a hard time believing that Fedora 8 doesn't come bundled with a C++ compiler.
Anyway, my tentative conclusion is that Fedora 8 indeed does not have a C++ compiler, and you need to install one before you can build Python 2.3 on that platform. I don't know why Python versions 2.5 and later install cleanly, except that maybe the need for the C++ compiler was removed (since Python is written in C anyway; though is there a C++ API that you would need g++ for?). I haven't made it to the bottom of this, in other words, but I've gone as far as I have time and need for at this point.