[Python-bugs-list] [ python-Bugs-626926 ] Build error using make VPATH feature

noreply@sourceforge.net noreply@sourceforge.net
Tue, 22 Oct 2002 08:36:58 -0700


Bugs item #626926, was opened at 2002-10-22 17:36
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626926&group_id=5470

Category: Build
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Davide Di Blasi (davidedb)
Assigned to: Nobody/Anonymous (nobody)
Summary: Build error using make VPATH feature

Initial Comment:
PROBLEM DESCRIPTION
=====================

After building successfully Python 2.2.2 from scratch
on Solaris 8 using the usual commands (cd
~wrk/Python-2.2.2; ./configure; make), I decided to
build it for multiple architectures (SunOS 5.6, 5.7 and
5.8), exploiting the supported VPATH feature of GNU make.

Here are the commands I run for Solaris 6:

1. mkdir ~/wrk/Python-2.2.2/binaries/SunOS_5.6
2. cd ~/wrk/Python-2.2.2/binaries/SunOS_5.6
3. ../../configure -prefix=/usr/local/python
4. make

Unfortunately the last command failed with the
following error:...
ranlib libpython2.2.a
gcc  -Xlinker --export-dynamic -o python \
		Modules/python.o \
		libpython2.2.a -lsocket -lnsl -ldl  -lpthread -lthread  
-lm  
case $MAKEFLAGS in \
*-s*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g
-O3 -Wall -Wstrict-prototypes' ./python -E
../../setup.py -q build;; \
*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3
-Wall -Wstrict-prototypes' ./python -E ../../setup.py
build;; \
esac
running build
running build_ext
Traceback (most recent call last):
  File "../../setup.py", line 795, in ?
    main()
  File "../../setup.py", line 790, in main
    scripts = ['Tools/scripts/pydoc']
  File "~wrk/Python-2.2.2/Lib/distutils/core.py", line
138, in setup
    dist.run_commands()
  File "~wrk/Python-2.2.2/Lib/distutils/dist.py", line
893, in run_commands
    self.run_command(cmd)
  File "~wrk/Python-2.2.2/Lib/distutils/dist.py", line
913, in run_command
    cmd_obj.run()
  File
"~wrk/Python-2.2.2/Lib/distutils/command/build.py",
line 107, in run
    self.run_command(cmd_name)
  File "~wrk/Python-2.2.2/Lib/distutils/cmd.py", line
330, in run_command
    self.distribution.run_command(command)
  File "~wrk/Python-2.2.2/Lib/distutils/dist.py", line
913, in run_command
    cmd_obj.run()
  File
"~wrk/Python-2.2.2/Lib/distutils/command/build_ext.py",
line 231, in run
    customize_compiler(self.compiler)
  File "~wrk/Python-2.2.2/Lib/distutils/sysconfig.py",
line 139, in customize_compiler
    (cc, opt, ccshared, ldshared, so_ext) = \
  File "~wrk/Python-2.2.2/Lib/distutils/sysconfig.py",
line 421, in get_config_vars
    func()
  File "~wrk/Python-2.2.2/Lib/distutils/sysconfig.py",
line 326, in _init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python
installation: unable to open
/usr/local/python/lib/python2.2/config/Makefile (No
such file or directory)
make: *** [sharedmods] Error 1

PROBLEM ANALYSIS==================
By looking the code inside sysconfig.py module, it is
clear that the problem is generated by the first IF
clause (starting at line 32), where the python_build
variable is set: the path obtained by joining "Lib" to
the argv0_path variable does not exist, since no
directory named Lib exists in the (current) work
directory. In fact the only existing directories  are:
 - Grammar
 - Modules
 - Objects
 - Parser
 - Python
 - build


WORKAROUND
=============
Simply create a link to the Lib directory provided with
Python 2.2.2, i.e. in my example:

ln -s ../../Lib
make
make test
make install


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626926&group_id=5470