[SciPy-user] bdist_rpm build error in scipy_core from CVS
Fernando Perez
Fernando.Perez at colorado.edu
Sat Jan 29 04:04:01 EST 2005
Stephen Walton wrote:
> Fernando Perez wrote:
>
>
>>4. Read the top-level docstring for make.py, it explains the running,
>>which is trivial.
>
>
> I followed your instructions; "python make.py all" on my system spits out
>
> *** Found architectures: ['ATHLONSSE1']
> *** Saving spec file: atlas-ATHLONSSE1.spec
> *** Building RPM for arch: ATHLONSSE1
> error: No compatible architectures found for build
> *** Done with arch: ATHLONSSE1
>
> Am I missing some magic in ~/.rpmmacros?
Mmh, the 'no compatible archs...' message is coming straight from the rpm
command, not from make.py. I tested only with PIIISSE1, P4SSE2 and P4SSE2_HT
architectures, but not with ATHLONs. I noticed the BuildArchitectures flag in
the atlas-base.spec file is set to i686. You may have to read up on the
syntax for that flag, to see whether it allows multiple archs to be listed
(and how). I would try a simple comma-separated list, or a variation on that
(I can't seem to find an example of the proper syntax for multiple archs).
Otherwise, you could just make it another parameter of the expansion: just put
in there something like __BUILDARCH__ as the value, and add a key for that to
make.py. The code which does the generation is based on what I think is the
smallest Python templating system possible, yet one which I found to be
surprisingly powerful:
def expand_template(tpl,dct):
"""Replace all occurrences of the keys of a dict in the template string,
by the actual values in the dict."""
rex = re.compile('|'.join(['(?P<%s>%s)' % (k,k) for k in dct]))
return rex.sub(lambda match: dct[match.group()],tpl)
The beauty of this simple 2-liner is that it allows you to define on the fly
your own syntax for what constitutes a 'key' to be evaluated. With this, you
can cleanly auto-generate files where things like $ or % have a special
meaning. These are normally a PITA to build with other templating strategies
(like python's % interpolation or Itpl's $ one), because you end up jumping
through multiple hoops for escaping those to get them into the final output.
So feel free to add more tags as needed, and perhaps send back the improved
versions so this can be used by more people.
Here's some info about this tag, from
http://www-eleves-isia.cma.fr/Doc/rpm-4.2.2/spec
\subsection specfile_buildarchitectures BuildArchitectures: Tag
This tag specifies the architecture which the resulting binary package
will run on. Typically this is a CPU architecture like sparc,
i386. The string 'noarch' is reserved for specifying that the
resulting binary package is platform independent. Typical platform
independent packages are html, perl, python, java, and ps packages.
>>ps. If this works for people, I'd like to ask Pearu to keep his
>>current naming conventions for the future.
>
>
> They aren't Pearu's conventions. They are the default you get if you do
> 'make rpm' in the ATLAS/lib/${ARCH} subdirectory.
I think you meant just 'make', or 'make dist', or something similar. The
ATLAS source downloads don't include RPM targets, I wouldn't have had to write
this stuff if they did :)
Cheers,
f
More information about the SciPy-User
mailing list