473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

python 2.3.3 setup.py: why adding sys.prefix to include_dir, libdir?

Hi there,
2 questions regarding build/installation issues:

1. In the python 2.3.3 setup.py script, the detect_modules method of
class PyBuildExt contains the following code:

253 if os.path.normpath(sys.prefix) != '/usr':
254 add_dir_to_list(self.compiler.library_dirs,
255 sysconfig.get_config_var("LIBDIR"))
256 add_dir_to_list(self.compiler.include_dirs,
257 sysconfig.get_config_var("INCLUDEDIR"))

This basically just adds the PREFIX/lib and PREFIX/include to
self.compiler.library_dirs
and self.include_dirs, PREFIX being what I gave to configure as command
line argument, e.g.:
../configure --prefix=/opt/tools --with-cxx=gcc

I understand the --prefix=PREFIX sets the installation _target_ directory.
Does it make sense to have these paths in include_dirs/library_dirs? Why
would I want this?
In fact, as it turned out that I had some bogus header files in the PREFIX
directory, an
extension module would not compile.

2. As a lot of things do not live in the "standard" places in our
environment, there seem to be several
places where I have to change setup.py manually. E.g. adding runtime
library dirs for curses, gdbm etc.
Is there another way to achieve correct build, in terms of telling my
non-standard paths to configure
in the first place? Just to spare me from changing setup.py...

Any comments are appreciated.
Best regards
Holger

_________________________________

Holger Joukl
Landesbank Baden-Württemberg
1651 Financial Markets Technologies
fon +49 (711) 124 - 7078
fax +49 (711) 124 - 3759
_________________________________

Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene
Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde,
verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail
sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht
gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht
garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte
den Inhalt der E-Mail als Hardcopy an.

The contents of this e-mail are confidential. If you are not the named
addressee or if this transmission has been addressed to you in error,
please notify the sender immediately and then delete this e-mail. Any
unauthorized copying and transmission is forbidden. E-Mail transmission
cannot be guaranteed to be secure. If verification is required, please
request a hard copy version.


Jul 18 '05 #1
1 2839
"Holger Joukl" <Ho**********@LBBW.de> writes:
Hi there,
2 questions regarding build/installation issues:

1. In the python 2.3.3 setup.py script, the detect_modules method of
class PyBuildExt contains the following code:

253 if os.path.normpath(sys.prefix) != '/usr':
254 add_dir_to_list(self.compiler.library_dirs,
255 sysconfig.get_config_var("LIBDIR"))
256 add_dir_to_list(self.compiler.include_dirs,
257 sysconfig.get_config_var("INCLUDEDIR"))

This basically just adds the PREFIX/lib and PREFIX/include to
self.compiler.library_dirs
and self.include_dirs, PREFIX being what I gave to configure as command
line argument, e.g.:
./configure --prefix=/opt/tools --with-cxx=gcc

I understand the --prefix=PREFIX sets the installation _target_ directory.
Does it make sense to have these paths in include_dirs/library_dirs? Why
would I want this?
Well, to work completely out of the box setup.py would need to be
telepathic, omniscient and be able to see into the future. We're
working on that <wink>, but not there yet.

So I wouldn't regard having to hand-hack setup.py as being in
particularly bad taste.
In fact, as it turned out that I had some bogus header files in the
PREFIX directory, an extension module would not compile.
Well, might I suggest not installing broken headers on your system? I
mean, I can think of real reasons for not wanting $(prefix) on the
search path, but not this one.
2. As a lot of things do not live in the "standard" places in our
environment,
What is your environment, out of curiosity?
there seem to be several places where I have to change setup.py
manually. E.g. adding runtime library dirs for curses, gdbm etc. Is
there another way to achieve correct build, in terms of telling my
non-standard paths to configure in the first place?
Er, no, or at least not in general. Editing Modules/Setup is another
option...
Just to spare me from changing setup.py...


.... as is submitting patches to SF that make setup.py look in these
places, if they are in fact "standard" for your environment but not
for, say, Red Hat Linux.

Cheers,
mwh

--
Never meddle in the affairs of NT. It is slow to boot and quick to
crash. -- Stephen Harris
-- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Zunbeltz Izaola | last post by:
Hi, I've build and installed python 2.2 and python2.3 in a linux box. Now i want to install some packages (Numeric, wxPython and scipy). I've install Numeric and wxPython for python2.3 without...
1
by: Tim Bradshaw | last post by:
I'd like to be able to install python with stow, and then to install various modules which use distutils, also with stow. This currently pretty much won't work, because Python chases symlinks to...
2
by: Russell E. Owen | last post by:
I'm trying to build Python 2.3.4 from source on a RedHat Enterprise machine for installation in a net-wide accessible directory /net/python. I tried all of the following variants of ./configure...
4
by: Layne Meier | last post by:
I'm having a bit of a problem trying to install Python on a Solaris 10 system. I didn't have this kind of problem when trying to install it on Solaris 8. Has anyone else experienced this...
7
by: rwr | last post by:
As a newbie I am having problems/errors configuring Python after unpacking the Python archive: # ./configure checking MACHDEP... linux2 checking EXTRAPLATDIR... checking for --without-gcc......
34
by: Ben Sizer | last post by:
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH...
1
by: Justin Johnson | last post by:
Hello, I'm trying to build Python 2.5.0 on AIX 5.3 using IBM's compiler (VisualAge C++ Professional / C for AIX Compiler, Version 6). I run configure and make, but makes fails with undefined...
3
by: Mathias Waack | last post by:
After switching my development environment to 64 bit I've got a problem with a python extension for a 32 bit application. Compiling the app under Linux results in the following error: g++ -m32...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.