-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for static libraries libatlas.a, libcblas.a, libf77blas and liblapack.a, so SAGE_ATLAS_LIB works #9780
Comments
This comment has been minimized.
This comment has been minimized.
comment:3
From the end of
In particular, |
comment:4
Replying to @qed777:
I think it proves we don't need the shared libraries myself. Note they are not built on OS X at all - see the badly name file But more to the point, it's unwise to test for them before permitting the code associated with Dave |
comment:5
On OpenSolaris at least, I can build sage-4.5.3.rc0 using only links to static libraries on a previous build (sage-4.5.3.alpha2). In other words, I set {{{SAGE_ATLAS_LIB}} with a modified version of the ATLAS package, which only made links to the static libraries.
That passed all doctests:
A good sign, but I'll test that package on Linux too. Dave |
This comment has been minimized.
This comment has been minimized.
comment:7
One small correction: on OS X, I don't think anything gets installed: the system's ATLAS gets used instead. Notice these lines in
These happen before the call to |
This comment has been minimized.
This comment has been minimized.
comment:8
Replying to @jhpalmieri:
Thank you John, In view of this, I'll delete those lines related to OS X in The version I created that linked to the static libraries in /ATLAS on Solaris 10 SPARC (
failed one doc test
but the system had run out of swap space, as shown in the system logs. I added some swap space, then the test passed:
It also built OK on Linux ( I'm marking this as "needs work" as I want to remove the erroneous information about OS X that exists in It's very tempting to rename Dave |
comment:9
Here's an updated package, http://boxen.math.washington.edu/home/kirkby/patches/atlas-3.8.3.p15.spkg which uses the 4 static libraries, but add links to the shared ones too. If they don't exist, nothing is lost. This ensures the environment is the same as would be if SAGE_ATLAS_LIB was not used, and ATLAS build from scratch. I've tested this on sage.math, my OpenSolaris machine, and it seems to be going OK on t2.math. Dave |
comment:10
I set this to "positive review" by mistake - it was supposed to be "needs review" !! |
Check for static libraries only so SAGE_ATLAS_LIB is more relieable |
comment:12
Attachment: 9780-SAGE_ATLAS_LIB.patch.gz Overall the changes look sensible. A few comments about
should the double slash be a single one? In the comments on lines 44-51 of the same file, there are a few typos ("relieably" and "Buidling"), but this is not very important. In lines 64-72, there is an old error: as you can see from the code, Finally, for testing this, I'm not sure I have access to a system with a genuine ATLAS installation. I can use an ATLAS build from another version of Sage, but should we test this with other ATLAS installations as well? I'll try it out on t2 and one or two skynet machines. |
comment:13
Replying to @jhpalmieri:
Single
But I can fix them.
IMHO it is badly named. It should have been called SAGE_ATLAS. It is very unconventional. Take a look for example at gcc's configure options:
The
I think we have a difference of opinion about what a "parent" directory is. IMHO, if we have:
Then the parent directory of the ATLAS installation is I thought the wording was confusing, so thought I'd try to clarify it. Obviously you think I've made it more confusing. Perhaps it needs an example - the one above might be reasonable. Perhaps remove the word "parent", and just do it more by example. Perhaps you have a better idea.
I've not got access to any machine with a "genuine" ATLAS installation. Does such a thing exist? It's not really a standard package. I think given the nature of ATLAS, which (Automatically Tuned Linear Algebra System) one really should build it from source on the machine so it is tuned properly. So even if you can find a ATLAS library for Debian/Redhat etc, it is unlikely to be optimal for your hardware. The only other thing I have access to is Mathematica which uses ATLAS and has the 4 shared libraries. Unfortunately, since Mathematica is 64-bit, and we can only at this point build Sage reliably 32-bit, that's not an option. I might have an old version of Mathematica I could try, but that's a lot of messing around - installing the software just to try the library. I don't think it's unreasonable for someone to build Sage once with ATLAS, then at a later date use that install. Dave |
comment:14
I mostly agree with what you're saying about parent directories, but "the parent directory of liblapack.a, libcblas.a, libatlas.a and libf77blas.a" sounds like it should be the directory containing those files (e.g. /usr/local/ATLAS/lib), not the parent directory of that one (/usr/local/ATLAS/). Maybe it could be "the parent directory of the directory containing liblapack.a, libcblas.a, libatlas.a and libf77blas.a"? (The wikipedia reference only discusses the parent directory of another directory, not of a file. So what is the parent directory of /usr/local/ATLAS/lib/liblapack.a?)
That's what I'm trying right now with some skynet machines: taurus and eno (two linux boxes), mark (solaris on sparc) and fulvia (solaris on x86). |
comment:15
There's a potentially relevant question about |
comment:16
On mark, I get the message
I'm not worried about the deprecation messages, but what about |
comment:17
Replying to @jhpalmieri:
I did notice that about IMHO, the section:
is of extremely limited value. It is certainly non-portable and whilst there was a time when In any case, it is testing on a shared library The failure is harmless in that if It is worth bearing in mind is that this ATLAS code is never installed on Cygwin or OS X. So this code will only ever be executed on Linux, Solaris and rarer Unix systems like HP-UX, AIX etc. Only Linux systems will probably have the {{{readelf}} command, though it could be installed on Solaris, AIX, HP-UX etc. There are several options, ranked in order of my preference.
Dave |
comment:18
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:
So we could change the code
to the following (untested):
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 my comments above, maybe you could add a comment to SPKG.txt about this? |
comment:19
Replying to @jhpalmieri:
Good, the basic code seems to work.
I felt that too. Especially since I think it can be removed. I believe it's a complete waste of time to be honest. I've left it for now though. I added a message that a warning was harmless. (For reasons I do not understand, the warning is printed before my message, despite the code to execute I addressed the other issue you had about the parent directory. See if the following makes any more sense. I've actually printed the directory where the libraries are expected to be, based on the setting of SAGE_ATLAS_LIB. I've not committed the changes yet - let me know what you think.
now prints
Just run 'hg diff' if you want to see what I changed. The package is at http://boxen.math.washington.edu/home/kirkby/patches/atlas-3.8.3.p15.spkg Dave |
comment:20
Okay, looks good to me. Once you commit the changes and post the link to the new spkg, if you think it's ready (the ticket is still marked "needs info"), then you can change it to "positive review". |
Author: David Kirkby |
Reviewer: John Palmieri |
comment:22
Replying to @jhpalmieri:
Thank you John, Yes, I'm sure it's ready. I've committed the changes and updated the .spkg at http://boxen.math.washington.edu/home/kirkby/patches/atlas-3.8.3.p15.spkg Dave == To the release manager == needs to be added to Sage - there are no patches to apply to it, the Sage library or anywhere else. Dave |
Merged: sage-4.6.alpha2 |
comment:25
Just a clarification: I didn't merge p15 here into 4.6.alpha2, because p16 at #9952 is newer. In this case, it didn't seem appropriate to close this ticket as a "duplicate." |
As noted at #9356, a change which was made to ensure
SAGE_ATLAS_LIB
worked on Solaris, is not a complete solution. On Solaris, no shared libraryliblapack.so
is created, as for reasons unknown, the shared library causes problems on Solaris.As noted here by François Bissey, liblapack.so often fails to build. (I assume François means on Linux). He also notes that
libcblas.so
, though I think he meanslibf77blas.so
. Basically building the shared libraries is problematic in ATLAS, with different issues affecting Solaris, Linux and FreeBSD. In contrast, the static libraries are relieably built.The changes to this code only affect the file
system_atlas.py
and make that test for the 4 static libraries and ignore the four shared libraries. Assuming the static libraries exist, links are made.It was also necessary to update the messages to indicate that static libraries are needed.
It should be noted that Mathematica 7 ships with only static libraries related to ATLAS and no shared libraries. Yet Wolfram Research primarily use shared libraries.
It may be wisest to simply not build the shared libraries at all, but that can be left for another ticket.
An updated package can be found at
http://boxen.math.washington.edu/home/kirkby/patches/atlas-3.8.3.p15.spkg
Dave
CC: @jhpalmieri @jaapspies @qed777
Component: porting: Solaris
Author: David Kirkby
Reviewer: John Palmieri
Merged: sage-4.6.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/9780
The text was updated successfully, but these errors were encountered: