[SciPy-user] Re: bdist_rpm build error in scipy_core from CVS

Todd Miller jmiller at stsci.edu
Fri Jan 28 00:23:03 EST 2005


On Thu, 2005-01-27 at 22:04 -0500, Todd Miller wrote:
> On Thu, 2005-01-27 at 19:02 -0600, Joe Cooper wrote:
> > Hi again all,
> > 
> > (What follows is wild conjecture based on a very cursory reading of the
> > setup_scipy_base.py by someone (me) who doesn't speak very good Python
> > and has no clue how distutils does what it does.)
> > 
> > It looks like the problem appeared with the added support for
> > Numeric/numarray choice in this bit here:
> > 
> > def _config_compiled_base(package, local_path, numerix_prefix, macro, info):
> >      """_config_compiled_base returns the Extension object for an
> >      Numeric or numarray specific version of _compiled_base.
> >      """
> >      from scipy_distutils.system_info import dict_append
> >      from scipy_distutils.core import Extension
> >      from scipy_distutils.misc_util import dot_join
> >      module = numerix_prefix + "_compiled_base"
> >      source = module + '.c'
> >      _temp_copy(os.path.join(local_path, "_compiled_base.c"),
> >                 os.path.join(local_path, source))
> >      sources = [source]
> >      ...snip...
> > 
> > So, there's a copy into the build tree of _nc_compiled_base.c, which
> > gets where it is supposed to go.  But then when building within that
> > tree, it is again looking for the _compiled_base.c file to copy
> > somewhere, which doesn't exist.  I don't see how to fix it,
> > though...looks like the function is being called twice.
> > 
> > Will keep digging...
> 
> Sorry Joe.  This is definitely a numarray/numerix problem.  I'm taking a
> look now.

A work around for now,  once _na_compiled_base.c and _nc_compiled_base.c
already exist in the source tree (they can just be copied from
_compiled_base.c if they don't exist), is to patch setup_scipy_base.py
like this:

Index: setup_scipy_base.py
===================================================================
RCS
file: /home/cvsroot/world/scipy_core/scipy_base/setup_scipy_base.py,v
retrieving revision 1.28
diff -c -r1.28 setup_scipy_base.py
*** setup_scipy_base.py 10 Jan 2005 19:28:55 -0000      1.28
--- setup_scipy_base.py 28 Jan 2005 03:33:30 -0000
***************
*** 33,40 ****
      from scipy_distutils.misc_util import dot_join
      module = numerix_prefix + "_compiled_base"
      source = module + '.c'
!     _temp_copy(os.path.join(local_path, "_compiled_base.c"),
!                os.path.join(local_path, source))
      sources = [source]
      sources = [os.path.join(local_path,x) for x in sources]
      depends = sources
--- 33,40 ----
      from scipy_distutils.misc_util import dot_join
      module = numerix_prefix + "_compiled_base"
      source = module + '.c'
!     # _temp_copy(os.path.join(local_path, "_compiled_base.c"),
!     #            os.path.join(local_path, source))
      sources = [source]
      sources = [os.path.join(local_path,x) for x in sources]
      depends = sources

The whole _temp_copy() scheme is a kludge to trick the distutils into
building the same .c file two ways,  once for Numeric (-DNUMERIC=1) and
once for numarray (-DNUMARRAY=1).  Different headers are included
depending on the flag so the _compiled_base.c needs to be compiled
twice;  distutuils .o caching gets in the way;  making temporary copies
effectively circumvents the caching.  Tonight's work around above
assumes the _compiled_base.c is duplicated manually instead.

The root problem appears to be that "_compiled_base.c" is not included
in the BUILD tree for some reason.  Because _compiled_base.c is not
copied to BUILD...,  when setup_scipy_base.py goes to make temporary
copies of it,  it fails.

HTH for now,
Todd







More information about the SciPy-User mailing list