#9780: Check for static libraries libatlas.a, libcblas.a, libf77blas and
liblapack.a, so SAGE_ATLAS_LIB works
------------------------+---------------------------------------------------
Reporter: drkirkby | Owner: drkirkby
Type: defect | Status: needs_info
Priority: major | Milestone: sage-4.6
Component: solaris | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Comment(by jhpalmieri):
Okay, pointing SAGE_ATLAS_LIB to the "local" directory of a previous Sage
installation works for me on several solaris machines (t2 and mark2:
sparc; and fulvia: x86). It also works for me on several linux machines
(taurus and eno). So I'm happy with it. I would have liked to test it on
some linux machine with a separately installed ATLAS, but it's not a
perfect world.
As far as the readelf problem goes, I think we can leave it as is. It
doesn't do any harm, after all. My second choice would be to test whether
readelf exists, or at least hide the error -- just changing os.popen2 to
os.popen3 will do this, so that's easy. If course, it might be better to
test whether the command produced an error, like this:
{{{
sage: p = os.popen3('readelf -s ' +ATLAS_LIB+'/lib/libf77blas.so | grep
gfortran')
sage: p[2].read() # stderr, so the empty string if no error
'/bin/sh: readelf: command not found\n'
sage: p[1].read() # stdout, so the output of the command
''
}}}
So we could change the code
{{{
s_gfortran = os.popen2('readelf -s '
+ATLAS_LIB+'/lib/libf77blas.so | grep gfortran')[1].read()
s_g95 = os.popen2('readelf -s ' + ATLAS_LIB +
'/lib/libf77blas.so | grep g95')[1].read()
}}}
to the following (untested):
{{{
proc_gfortran = os.popen3('readelf -s '
+ATLAS_LIB+'/lib/libf77blas.so | grep gfortran')
proc_g95 = os.popen3('readelf -s '
+ATLAS_LIB+'/lib/libf77blas.so | grep g95')
err = (len(proc_gfortran[2].read()) > 0) or
(len(proc_g95[2].read()) > 0)
s_gfortran = ''
s_g95 = ''
if not err: # readelf is present and ran without error
s_gfortran = proc_gfortran[1].read()
s_g95 = proc_g95[1].read()
}}}
Even better, we should rewrite it using the subprocess module, to avoid
the deprecation messages. If you think that's worthwhile, I could
probably do it pretty quickly. You would probably prefer it not written
in python at all, but that's a bit more work... Completely removing the
code involves more analysis of what's going on: are there any systems
which execute this code from the atlas spkg, have readelf, and also use
g95? If not, then we can get rid of it, but how sure can we be of that?
I think we've agreed before that a major upgrade to the atlas spkg is long
overdue, and if we don't eliminate this code, we can add its removal to
the list of things to change. If you make a new spkg addressing
[http://trac.sagemath.org/sage_trac/ticket/9780#comment:12 my comments
above], maybe you could add a comment to SPKG.txt about this?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9780#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.