Re: 2.5 from source install problem with extensions

2007-04-19 Thread Florian Demmer
On Apr 18, 7:39 pm, Anton Hartl <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 2007-04-18, Florian Demmer <[EMAIL PROTECTED]> wrote:
>
> > On Apr 18, 12:36 pm, Florian  Demmer <[EMAIL PROTECTED]> wrote:
> >> Hi!
>
> >> I am doing a from source installation of Python 2.5 on some old Debian
> >> machine. As the target directoy I want /opt/somename so i added it to
> >> the configure like so:
>
> >> ./configure --prefix=/opt/somedir
>
> >> The following make works fine as far as I can see. Then the make
> >> install also actually works and installs python in /opt/somedir with
> >> all its subdirectoris (bin, lib, man, include).
> >> The extensions (*.so) however get put in /usr/local/lib/... and there
> >> also in the wrong python directoy: 2.4
>
> Basically I had the same problem(s).
>
> >> (How) can I change the install_dir for the extensions?
> >> Why does it use python2.4 anyway?! What env var or else is set here
> >> that I cannot find?
>
> I've patched setup.py as follows:
>
> --- setup.py.orig   Thu Aug 10 01:42:18 2006
> +++ setup.pyMon Dec 25 19:05:29 2006
> @@ -147,6 +147,14 @@
>  if ext.name in sys.builtin_module_names:
>  self.extensions.remove(ext)
>
> +   # so -lpython2.5 works in the build
> +   ext.library_dirs.append('.')
> +
> +   # so shared libs requiring libpython2.5.so work
> +   py_instdir = os.environ.get("INSTDIR_PYTHON", None)
> +   if py_instdir:
> +   ext.library_dirs.append(os.path.join(py_instdir, 'lib'))
> +
>  if platform != 'mac':
>  # Parse Modules/Setup and Modules/Setup.local to figure out which
>  # modules are turned on in the file.
>
> Then you have to add INSTDIR_PYTHON to your shell environment, i.e.
>
> INSTDIR_PYTHON=/opt/somedir ; export INSTDIR_PYTHON
>
> or whatever your shell requires.
>
> This works for me.  Hope it helps,

nice workaround (and it does work), thank you...
at least until when i try to install Python2.6 and forget about that
again ;)

since i was not quite satisfied by the solution (i will have to
install py25 from source on a customer's system that i dont know much
about yet at a later time and that _has_ to work then), i searched for
more reasons why it fails in the first place... and actually found
something:

~/.pydistutils.cfg
--> install_lib = /usr/local/lib/python2.4/site-packages

... uncommented it and ran make install again --> works! :D

br
Florian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 2.5 from source install problem with extensions

2007-04-18 Thread Anton Hartl
Hi,

On 2007-04-18, Florian Demmer <[EMAIL PROTECTED]> wrote:
> On Apr 18, 12:36 pm, Florian  Demmer <[EMAIL PROTECTED]> wrote:
>> Hi!
>>
>> I am doing a from source installation of Python 2.5 on some old Debian
>> machine. As the target directoy I want /opt/somename so i added it to
>> the configure like so:
>>
>> ./configure --prefix=/opt/somedir
>>
>> The following make works fine as far as I can see. Then the make
>> install also actually works and installs python in /opt/somedir with
>> all its subdirectoris (bin, lib, man, include).
>> The extensions (*.so) however get put in /usr/local/lib/... and there
>> also in the wrong python directoy: 2.4

Basically I had the same problem(s).

>> (How) can I change the install_dir for the extensions?
>> Why does it use python2.4 anyway?! What env var or else is set here
>> that I cannot find?

I've patched setup.py as follows:

--- setup.py.orig   Thu Aug 10 01:42:18 2006
+++ setup.pyMon Dec 25 19:05:29 2006
@@ -147,6 +147,14 @@
 if ext.name in sys.builtin_module_names:
 self.extensions.remove(ext)
 
+   # so -lpython2.5 works in the build
+   ext.library_dirs.append('.')
+
+   # so shared libs requiring libpython2.5.so work
+   py_instdir = os.environ.get("INSTDIR_PYTHON", None)
+   if py_instdir:
+   ext.library_dirs.append(os.path.join(py_instdir, 'lib'))
+
 if platform != 'mac':
 # Parse Modules/Setup and Modules/Setup.local to figure out which
 # modules are turned on in the file.


Then you have to add INSTDIR_PYTHON to your shell environment, i.e.

INSTDIR_PYTHON=/opt/somedir ; export INSTDIR_PYTHON

or whatever your shell requires.

This works for me.  Hope it helps,

Anton
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 2.5 from source install problem with extensions

2007-04-18 Thread Florian Demmer
On Apr 18, 12:36 pm, Florian  Demmer <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I am doing a from source installation of Python 2.5 on some old Debian
> machine. As the target directoy I want /opt/somename so i added it to
> the configure like so:
>
> ./configure --prefix=/opt/somedir
>
> The following make works fine as far as I can see. Then the make
> install also actually works and installs python in /opt/somedir with
> all its subdirectoris (bin, lib, man, include).
> The extensions (*.so) however get put in /usr/local/lib/... and there
> also in the wrong python directoy: 2.4

...and the current /usr/bin/python symlink points to the 2.4
installation (from .deb)

> This is a c/p of the make install output:
> [...]
> running build_scripts
> running install_lib
> changing mode of /usr/local/lib/python2.4/site-packages/_struct.so to
> 755
> changing mode of /usr/local/lib/python2.4/site-packages/_ctypes.so to
> 755
> [...]
>
> (How) can I change the install_dir for the extensions?
> Why does it use python2.4 anyway?! What env var or else is set here
> that I cannot find?
>
> thanks!


-- 
http://mail.python.org/mailman/listinfo/python-list


2.5 from source install problem with extensions

2007-04-18 Thread Florian Demmer
Hi!

I am doing a from source installation of Python 2.5 on some old Debian
machine. As the target directoy I want /opt/somename so i added it to
the configure like so:

./configure --prefix=/opt/somedir

The following make works fine as far as I can see. Then the make
install also actually works and installs python in /opt/somedir with
all its subdirectoris (bin, lib, man, include).
The extensions (*.so) however get put in /usr/local/lib/... and there
also in the wrong python directoy: 2.4

This is a c/p of the make install output:
[...]
running build_scripts
running install_lib
changing mode of /usr/local/lib/python2.4/site-packages/_struct.so to
755
changing mode of /usr/local/lib/python2.4/site-packages/_ctypes.so to
755
[...]

(How) can I change the install_dir for the extensions?
Why does it use python2.4 anyway?! What env var or else is set here
that I cannot find?

thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list