Opened 9 years ago

Last modified 9 years ago

#14699 closed defect

Install ATLAS header files and cleanup IML spkg — at Version 63

Reported by: John Palmieri Owned by: Jeroen Demeyer
Priority: blocker Milestone: sage-5.10
Component: packages: standard Keywords: atlas IML testsuite check cblas.h
Cc: Leif Leonhardy, Jean-Pierre Flori, Jeroen Demeyer, Volker Braun Merged in:
Authors: Jean-Pierre Flori, Volker Braun Reviewers: Jean-Pierre Flori
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Change History (64)

comment:1 Changed 9 years ago by Jean-Pierre Flori

Surely an ATLAS problem, see http://trac.sagemath.org/sage_trac/ticket/10508#comment:526 for a solution.

I suggest we call at least install_inc and potentially install_lib from ATLAS build system to install headers and static libs.

comment:2 Changed 9 years ago by Jean-Pierre Flori

Or just install which should call both of them.

comment:3 Changed 9 years ago by Leif Leonhardy

John, U sure about sage.math?

128.208.160.191	sage.math.washington.edu sage sage.math

comment:4 in reply to:  3 Changed 9 years ago by Leif Leonhardy

Replying to leif:

John, U sure about sage.math?

128.208.160.191	sage.math.washington.edu sage sage.math

(As opposed to

;; ANSWER SECTION:
sage.math.washington.edu. 600	IN	A	128.208.160.197

which is boxen.)

comment:5 Changed 9 years ago by Jean-Pierre Flori

It would be nice to fix that on top of #14605 which I've tested quite extensively and is finished since some time.

comment:6 Changed 9 years ago by Leif Leonhardy

+1 to also again install static libs.

comment:7 Changed 9 years ago by Jean-Pierre Flori

Cc: jeroen Volker Braun added
Keywords: atlas added
Priority: majorcritical
Summary: Get iml to install correctly and pass its self-tests on sage.mathInstall ATLAS headers file and static libraries

In fact disregard my comment about #14605. We should fix the issue here quickly, hopefully before 5.10 official release if it's not too late. Although as it does not seem to prevent anything from working except for IML testsuite, 5.11 should be ok as well.

comment:8 Changed 9 years ago by Leif Leonhardy

Cc: Jeroen Demeyer added; jeroen removed
Keywords: IML testsuite check cblas.h added
Summary: Install ATLAS headers file and static librariesInstall ATLAS header files and static libraries

comment:9 Changed 9 years ago by Koen van de Sande

A side-effect of this ticket is probably that numpy gets built without ATLAS acceleration.

comment:10 Changed 9 years ago by Leif Leonhardy

For the record, I did get

ATLAS_CFLAGS=''
ATLAS_LIBS='-lcblas -latlas'

-L${SAGE_LOCAL}/lib "incidentally" came from / for GMP, although after -lcblas -latlas, but we meanwhile add ${SAGE_LOCAL}/lib to LIBRARY_PATH (in sage-env), so that it worked.

Last edited 9 years ago by Leif Leonhardy (previous) (diff)

comment:11 Changed 9 years ago by Leif Leonhardy

P.S.: Although IIRC according to POSIX, -Ldir1 -lfoo -Ldir2 -lbar is the same as -Ldir1 -Ldir2 -lfoo -lbar.

comment:12 Changed 9 years ago by Jean-Pierre Flori

Authors: Jean-Pierre Flori
Description: modified (diff)
Status: newneeds_review

comment:13 in reply to:  11 Changed 9 years ago by Leif Leonhardy

Replying to leif:

P.S.: Although IIRC according to POSIX, -Ldir1 -lfoo -Ldir2 -lbar is the same as -Ldir1 -Ldir2 -lfoo -lbar.

At least GNU ld docs agree with this:

All -L options apply to all -l options, regardless of the order in which the options appear.

comment:14 Changed 9 years ago by Koen van de Sande

You'd still need a line

    cmd += ' --incdir=' + os.path.join(conf['SAGE_LOCAL'],'include') 

in configure_atlas_library() for the header files to go the correct place?

And currently numpy is built without Atlas (it uses another blas): local/lib/python2.7/site-packages/numpy/core/_dotblas.so normally contains ATL_* symbols (for an old Atlas 3.8.3 version, at least).

comment:15 in reply to:  14 Changed 9 years ago by Jean-Pierre Flori

Replying to Koen:

You'd still need a line

    cmd += ' --incdir=' + os.path.join(conf['SAGE_LOCAL'],'include') 

in configure_atlas_library() for the header files to go the correct place?

I don't think so. We use prefix and that should be enough from what I've seen in ATLAS configure script.

comment:16 in reply to:  14 Changed 9 years ago by Jean-Pierre Flori

Replying to Koen:

And currently numpy is built without Atlas (it uses another blas): local/lib/python2.7/site-packages/numpy/core/_dotblas.so normally contains ATL_* symbols (for an old Atlas 3.8.3 version, at least).

On my gcc110 install (where IML testsuite fails), numpy uses ATLAS correctly. There is no ATLAS symbols in the file you pointed because we now use a shared version of ATLAS. But if I run ldd on the file it points to the ATLAS libs.

And I seem to remember we had lots of troubles correctly biulding numpy and scipy with the new ATLAS so hopefully it was actually used.

comment:17 Changed 9 years ago by Leif Leonhardy

s/inlcude/include/

and IMHO (=WTF?) also s/serial/single-threaded/g s/parallel/multi-threaded/g ...

(but the latter is not JP's invention I guess)

comment:18 in reply to:  17 Changed 9 years ago by Jean-Pierre Flori

Replying to leif:

s/inlcude/include/

Done.

and IMHO (=WTF?) also s/serial/single-threaded/g s/parallel/multi-threaded/g ...

(but the latter is not JP's invention I guess)

Not mine indeed.

comment:19 Changed 9 years ago by Leif Leonhardy

Replying to jpflori:

Replying to Koen:

And currently numpy is built without Atlas (it uses another blas): local/lib/python2.7/site-packages/numpy/core/_dotblas.so normally contains ATL_* symbols (for an old Atlas 3.8.3 version, at least).

On my gcc110 install (where IML testsuite fails), numpy uses ATLAS correctly. There is no ATLAS symbols in the file you pointed because we now use a shared version of ATLAS. But if I run ldd on the file it points to the ATLAS libs.

Yes.

$ readelf -d local/lib/python2.7/site-packages/numpy/core/_dotblas.so

Dynamic section at offset 0x4dc0 contains 26 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libptf77blas.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libptcblas.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libatlas.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libpython2.7.so.1.0]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 ...

comment:20 Changed 9 years ago by Jean-Pierre Flori

Status: needs_reviewneeds_work

make_atlas() takes no argument.

comment:21 Changed 9 years ago by Jean-Pierre Flori

Status: needs_workneeds_review

comment:22 Changed 9 years ago by John Palmieri

I saw the error on boxen. I thought that sage.math was dead? In any case, it's the machine I get to by typing ssh sage.math.washington.edu, and when I log off it says Connection to sage.math.washington.edu closed. The $HOSTNAME is boxen, though.

comment:23 Changed 9 years ago by John Palmieri

On boxen, after installing the new ATLAS spkg, the current iml spkg installs and passes its tests. Same for an iml spkg which doesn't copy over the patched version of configure.

comment:24 Changed 9 years ago by Leif Leonhardy

P.S.: I guess the odd "patch" to IML's configure dates back to the times when ATLAS was somehow optional, or at least did not get properly detected on all systems. Running / building IML's test suite on such systems was always broken then.

(In other parts of Sage using IML, BLAS libraries get explicitly added by us when linking.)

comment:25 Changed 9 years ago by Jeroen Demeyer

Priority: criticalblocker

comment:26 Changed 9 years ago by Volker Braun

Do not install static libraries, its a feature that we don't.

Also, nobody in his right mind expects blas headers. This is why the iml testsuite, which the authors probably didn't expect to be distributed, is the only place that trips over it. For starters, there is no universal naming standard (blas.h vs. cblas.h vs. foo_cblas.h vs. foo/cblas.h). There are multiple blas implementations and if you all install them at the same place then they would overwrite each other.

comment:27 Changed 9 years ago by Volker Braun

And if you need a reason for not installing static libraries you just have to look at this ticket where you got confused about whether something links against atlas or not. Shared libraries are the only way that make it clear which particular atlas version you are linking against and that you didn't accidentally pick up some system atlas.

comment:28 Changed 9 years ago by Koen van de Sande

I disagree that nobody expects the blas headers. If I try to install a package on top of Sage, e.g. the Shogun machine learning toolbox, then it will only compile in certain features if it can find a blas - and for that it needs blas headers. With older sage versions this works just fine.

comment:29 Changed 9 years ago by Volker Braun

Shogun just makes it unnecessarily complicated for themselves, you need to define preprocessor constants to tell it which blas header to look for...

I agree that we should have blas/cblas/f77blas headers since its the right thing to do. But when we fix the IML testsuite we shouldn't introduce that as a dependency, because very often the headers are either not installed or installed with a funky name.

comment:30 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.10

comment:31 in reply to:  26 ; Changed 9 years ago by Leif Leonhardy

Replying to vbraun:

Do not install static libraries, its a feature that we don't.

At least they shouldn't get discarded, which is simply stupid.

comment:32 Changed 9 years ago by Leif Leonhardy

Btw., the new spkg and afterwards IML installed without problems, and both passed their test suites on Linux x86_64 (Ubuntu 10.04.4, Sage 5.10.rc0).

comment:33 in reply to:  31 ; Changed 9 years ago by Volker Braun

Replying to leif:

At least they shouldn't get discarded, which is simply stupid.

Do you also object to discarding the *.o files? We delete what we don't want around in the install, thats the way it works. Ideally upstream would have an --disable-static switch, but they don't.

comment:34 Changed 9 years ago by Volker Braun

Description: modified (diff)

Removed the static library install bit from the spkg

comment:35 in reply to:  33 ; Changed 9 years ago by Leif Leonhardy

Replying to vbraun:

Replying to leif:

At least they shouldn't get discarded, which is simply stupid.

Do you also object to discarding the *.o files?

man ar?

comment:36 in reply to:  35 Changed 9 years ago by Volker Braun

Replying to leif:

man ar?

I take it that this means that you agree with me, and we should neither install object files nor static libraries ;-)

comment:37 Changed 9 years ago by Volker Braun

Summary: Install ATLAS header files and static librariesInstall ATLAS header files

comment:38 Changed 9 years ago by Leif Leonhardy

Status: needs_reviewneeds_info

Probably vote on sage-devel on whether to discard the static libraries or not.

comment:39 Changed 9 years ago by Jean-Pierre Flori

Replying to leif:

Replying to vbraun:

Do not install static libraries, its a feature that we don't.

At least they shouldn't get discarded, which is simply stupid.

Having static libraries rather than nothing on systems where building shared ones is problematic might be nice... Also note it's the only option upstream really supports.

comment:40 in reply to:  38 Changed 9 years ago by Leif Leonhardy

Replying to leif:

Probably vote on sage-devel on whether to discard the static libraries or not.

... or make it optional.

comment:42 Changed 9 years ago by Jeroen Demeyer

Can we please concentrate on the actual ticket issue here, which is about header files and iml failing? I don't think this has anything to do with static libraries (but please correct me if I'm wrong).

Changed 9 years ago by Jeroen Demeyer

Attachment: atlas-3.10.1.p1.diff added

comment:43 Changed 9 years ago by Jean-Pierre Flori

Authors: Jean-Pierre FloriJean-Pierre Flori, Volker Braun
Reviewers: Jean-Pierre Flori
Status: needs_infoneeds_review

Ok. Only concentrating on that, I'm ok with Volker changes to my changes.

comment:44 Changed 9 years ago by Volker Braun

Status: needs_reviewpositive_review

I'm ok with Jean-Pierre changes to the extent that I haven't changed them, of course.

comment:45 in reply to:  42 Changed 9 years ago by Leif Leonhardy

Replying to jdemeyer:

Can we please concentrate on the actual ticket issue here, which is about header files and iml failing? I don't think this has anything to do with static libraries (but please correct me if I'm wrong).

Well, if we used ATLAS' install rather than further hacking, we'd get both the headers and the static libraries.

I don't see any reason why discarding static libraries should be done by default; if someone feels they're dangerous to him/her, we could add some option to automatically remove them, although that's IMHO a pretty unimportant feature.

comment:46 Changed 9 years ago by Leif Leonhardy

P.S.: Removing the "patch" to IML's configure from the IML spkg IMHO belongs to this ticket as well, as that was hiding (or rather obscuring) the real problem.

Last edited 9 years ago by Leif Leonhardy (previous) (diff)

comment:47 in reply to:  46 ; Changed 9 years ago by Volker Braun

Replying to leif:

P.S.: Removing the "patch" to IML's configure from the IML spkg IMHO belongs to this ticket as well, as that was hiding (or rather obscuring) the real problem.

Then either attach a fixed iml spkg to this packet real soon (TM) or open a ticket for it. But don't leave footnotes on finished tickets.

comment:48 in reply to:  47 Changed 9 years ago by Leif Leonhardy

Replying to vbraun:

Replying to leif:

P.S.: Removing the "patch" to IML's configure from the IML spkg IMHO belongs to this ticket as well, as that was hiding (or rather obscuring) the real problem.

Then either attach a fixed iml spkg to this packet real soon (TM) or open a ticket for it. But don't leave footnotes on finished tickets.

I was saying it's IMHO not finished.

comment:49 Changed 9 years ago by Jean-Pierre Flori

Work issues: enable cblas.h test in iml spkg

Indeed, the ticket original title was about IML testsuite, so we should also provide an IML spkg (quite trivial just remove the horrible patch disabling test for cblas.h).

leif: could you make the spkg? I'll quickly review it.

comment:50 Changed 9 years ago by Jean-Pierre Flori

Status: positive_reviewneeds_work

comment:51 Changed 9 years ago by Jean-Pierre Flori

Or at least we should provide this fixed IML spkg in a follow up ticket mentioned here and put as blocker for 5.10.

comment:52 in reply to:  49 Changed 9 years ago by Leif Leonhardy

This doesn't at all work with SAGE_ATLAS_LIB [unless the headers happen to be installed system-wide, which is the same situation as before], since headers don't get copied / symlinked.


What happens on MacOS X (where Sage's ATLAS by default doesn't get built)?

(Similar for Cygwin perhaps.)

Replying to jpflori:

Indeed, the ticket original title was about IML testsuite, so we should also provide an IML spkg (quite trivial just remove the horrible patch disabling test for cblas.h).

So I'm not sure if it's really that easy.

comment:53 Changed 9 years ago by Jean-Pierre Flori

Yeah, I was just looking into that... Not really anything useful to do when a system-wide ATLAS is used.

Does really no software linking to ATLAS expect to find headers in some standard or provided place? Do they all provide their own BLAS headers and expect everything to be fine?

comment:54 Changed 9 years ago by Volker Braun

Its pretty much common practice to use your own blas/lapack headers. For example, linbox/fflas: http://linalg.org/projects/fflas-ffpack/browser/fflas-ffpack/config-blas.h Definitely weird, but then its probably the most stable API ever. And the lack of uniform naming of the header across vendors doesn't help.

comment:55 Changed 9 years ago by Jean-Pierre Flori

A test spkg is at:

Not really wonderful as the src directory still includes a modified upstream source, but maybe a little bit better looking. Not tested yet, I'm doing it right now.

comment:56 Changed 9 years ago by Jean-Pierre Flori

Status: needs_workneeds_review
Work issues: enable cblas.h test in iml spkg

comment:57 Changed 9 years ago by Jean-Pierre Flori

Description: modified (diff)

comment:58 Changed 9 years ago by Jean-Pierre Flori

Summary: Install ATLAS header filesInstall ATLAS header files and cleanup IML spkg

comment:59 Changed 9 years ago by Jeroen Demeyer

Status: needs_reviewneeds_work

The use of "$SAGE_LOCAL"/lib/libatlas.so.*.* seems to assume that there is exactly one file matching "$SAGE_LOCAL"/lib/libatlas.so.*.*

I doubt that this assumption is true in general.

comment:60 Changed 9 years ago by Jean-Pierre Flori

Quite true (just wondering if we really want to support Sage's installs with multiple ATLAS version installed?).

comment:61 Changed 9 years ago by Jeroen Demeyer

Working on IML spkg, hang on...

comment:62 Changed 9 years ago by Jean-Pierre Flori

Of course I guess the IML testsuite will still fail on OS X or Cygwin.

comment:63 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)
Note: See TracTickets for help on using tickets.