[Distutils] install location(s)
Andrew Dalke
dalke@bioreason.com
Mon, 29 Mar 1999 14:16:49 -0800
This is an easy couple of questions (I hope).
1)
What is the correct location for "pure" python module installations?
$(prefix)/lib/python$VERSION/site-packages
or
$(prefix)/lib/site-python
I believe most packages tend to install in site-packages but
site-python makes more sense since I usually write my modules
to deal with differences in python versions.
2) where should python shared libraries be placed if you want
to have one install of python per site which includes different
architectures? (For example, we may distribute our software on
both SGI and Linux boxes.)
As I understand it now, the python specific .so files need to be
on the PYTHONPATH, which currently contains no information about
the specific platform. The only information available is from
sys.platform (along with os.uname) and that doesn't appear
sufficient to distinguish between different SGI binary interfaces.
Specifically, SGIs have 3 interfaces: "old" 32, "new" 32 and 64.
These are specified during compilation by the environment variable
SGI_ABI or by the command-line options (-32/-o32, -n32, -64). In
theory we could compile libraries for each of the different
interfaces, though we only support o32 at present. To do it fully
we would have to write a wrapper script which runs the specified
ABI version of Python ... oh, but then we could modify the
PYTHONPATH to reflect the differences.
Has there been a proposal for how to distribute/manage/install
distributions with multiple architectures? The best I can think
of for now is to modify site.py to add
os.path.join(prefix,
"lib",
"python" + sys.version[:3],
"site-packages",
sys.platform),
to the sitedirs list. Does this make sense, and should it be
added to the 1.5.2 (or discussed more on c.l.py)?
Andrew
dalke@bioreason.com
BTW, here's how SGI's java, which is only for 32 bits, manages
things. "java" is actuall a shell script containing the following
three snippets:
# use -n32 binaries by default
if [[ $SGI_ABI = -32 ]]
then
export JAVA_N32=0
elif [[ $SGI_ABI = -o32 ]]
then
export JAVA_N32=0
else
export JAVA_N32=1
fi
case $a in
-32)
JAVA_N32=0
shift
;;
-o32)
JAVA_N32=0
shift
;;
-n32)
JAVA_N32=1
shift
;;
if [ $JAVA_N32 = 1 ]
then
check_path $LD_LIBRARYN32_PATH "LD_LIBRARYN32_PATH"
if [ -z "$LD_LIBRARYN32_PATH" ]
then
if [ -z "$LD_LIBRARY_PATH" ]
then
LD_LIBRARYN32_PATH=$JAVA_HOME/lib32/sgi/$THREADS_TYPE
else
check_path $LD_LIBRARY_PATH "LD_LIBRARY_PATH"
LD_LIBRARYN32_PATH="$JAVA_HOME/lib32/sgi/$THREADS_TYPE:$LD_LIBRARY_PATH"
fi
else
LD_LIBRARYN32_PATH="$JAVA_HOME/lib32/sgi/$THREADS_TYPE:$LD_LIBRARYN32_PATH"
fi
export LD_LIBRARYN32_PATH
prog=$JAVA_HOME/bin32/sgi/${THREADS_TYPE}/${progname}
else
check_path $LD_LIBRARY_PATH "LD_LIBRARY_PATH"
if [ -z "$LD_LIBRARY_PATH" ]
then
LD_LIBRARY_PATH=$JAVA_HOME/lib/sgi/$THREADS_TYPE
else
LD_LIBRARY_PATH="$JAVA_HOME/lib/sgi/$THREADS_TYPE:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
prog=$JAVA_HOME/bin/sgi/${THREADS_TYPE}/${progname}
fi