[mod_python] installing --with-python Python 2.2

Jonathan Gardner jgardn at alumni.washington.edu
Sat Jan 19 01:10:07 EST 2002


Summary:
After a lot of research, I still can't get the --with-python option to work 
properly with Python 2.2. Linking problems.

Details:
I searched the entire archive of the mailing list. [NOTE: The link to 
download the entire mailing list from 
http://www.modpython.org/pipermail/mod_python/ is broken], I found only one 
helpful tip for my compiling problems: Don't use --with-python.

Sure enough, it works with 2.2 if I have it all installed so I don't need the 
--with-python option.

I know for a fact that 2.0.1 and 2.1.2 work with the --with-python option 
because I have installed both of them several times without a hitch. Well, I 
lie, but you after a while I got everything working together like they should.

My system: SuSE 7.1, running self-compiled Linux 2.4.14 kernel. 

I downloaded the sources for Python 2.2, Apache1.3.22, and mod_python 2.7.6.

1) Uncompressed all the sources to /usr/local/src/

2) Made a seperate source directory for the no threads version: 
  $ cp -R Python-2.2 Python-2.2-no-threads

3) For /usr/local/src/Python-2.2/, I did:
  $ ./configure
  $ make
  # make install

  Everything went smoothly.

4) For /usr/local/src/Python-2.2-no-threads/, I did:
  $ ./configure --without-threads
  $ make
  
  I also did this, so as to make everything available to Apache. I am sure 
that I only need to do a couple files, but which ones I do not know.
  $ chmod -R a+w *

  Everything went smoothly.

5) Went into the mod_python directory, and ran the following instructions. 
  $ ./configure --with-python=/usr/local/src/Python-2.2-no-threads/ \
    --with-apache=/usr/local/src/apache_1.3.22
  $ make static
  $ make install_static
  # make install_py_lib
  
  Everything went smoothly.

6) Went into the apache directory and did:
  $ ./configure --activate-module=src/modules/python/libpython.a
  $ make

  This is where it stops working. The complaint it spits out is:

gcc  -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED `./apaci` -Xlinker 
-export-dynamic       \
      -o httpd buildmark.o modules.o modules/standard/libstandard.a 
modules/python/libpython.a main/libmain.a ./os/unix/libos.a ap/libap.a 
regex/libregex.a   -lm -lcrypt -lm  
/usr/local/src/Python-2.2-no-threads/libpython2.2.a   -lexpat
/usr/local/src/Python-2.2-no-threads/libpython2.2.a(posixmodule.o): In 
function `posix_tmpnam':
/usr/local/src/Python-2.2-no-threads/./Modules/posixmodule.c:4510: the use of 
`tmpnam' is dangerous, better use `mkstemp'
/usr/local/src/Python-2.2-no-threads/libpython2.2.a(posixmodule.o): In 
function `posix_tempnam':
/usr/local/src/Python-2.2-no-threads/./Modules/posixmodule.c:4458: the use of 
`tempnam' is dangerous, better use `mkstemp'
/usr/local/src/Python-2.2-no-threads/libpython2.2.a(dynload_shlib.o): In 
function `_PyImport_GetDynLoadFunc':
/usr/local/src/Python-2.2-no-threads/Python/dynload_shlib.c:90: undefined 
reference to `dlopen'
/usr/local/src/Python-2.2-no-threads/Python/dynload_shlib.c:93: undefined 
reference to `dlerror'
/usr/local/src/Python-2.2-no-threads/Python/dynload_shlib.c:98: undefined 
reference to `dlsym'
/usr/local/src/Python-2.2-no-threads/libpython2.2.a(posixmodule.o): In 
function `posix_openpty':
/usr/local/src/Python-2.2-no-threads/./Modules/posixmodule.c:1942: undefined 
reference to `openpty'
/usr/local/src/Python-2.2-no-threads/libpython2.2.a(posixmodule.o): In 
function `posix_forkpty':
/usr/local/src/Python-2.2-no-threads/./Modules/posixmodule.c:1973: undefined 
reference to `forkpty'
collect2: ld returned 1 exit status

IANAPIH - I am not a Python internals hacker so I have no idea what this 
means.

Jonathan



More information about the Mod_python mailing list