#17630: Further clean up of ATLAS (or equivalent BLAS) linking
-------------------------------------+-------------------------------------
Reporter: jpflori | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.5
Component: packages: | Resolution:
standard | Merged in:
Keywords: | Reviewers:
Authors: Jean-Pierre | Work issues:
Flori, François Bissey | Commit:
Report Upstream: N/A | 764c3b574a438ef36b3a8a29552a7691514a37fb
Branch: u/fbissey/blas | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by jpflori):
Replying to [comment:94 fbissey]:
> When I started talking about #17075 and associated work to be able to
use any `blas/lapack` our goal was to use `pkgconfig` and
`https://github.com/matze/pkgconfig` as a python interface to it. This is
what `sage-on-gentoo` is currently using. The fact that the python
interface was also standard escaped me.
>
> We included `pkgconfig` in sage when we upgraded to `matplotlib-1.3.x`
after I determined that it was the only to build it on OS X while
reviewing that ticket. That would have been after #17075 but I am not sure
if it was before this ticket.
>
> For reference this is the current sage-on-gentoo patch for 6.8.beta6
https://github.com/cschwan/sage-on-gentoo/blob/master/sci-
mathematics/sage/files/sage-6.8-blas-r1.patch
>
> The librarydir part is for dealing with BLAS/LAPACK installed in less
standard location (`/opt`) where they may be out of the library search
path when linking. It still relies on said path to be in `ld.so.config` or
equivalent. Typical cases are intel MKL and AMD acml. The ability to
compile against MKL is one of the key motivation here.
>
> Since we have all the elements, going `.pc` all the way is fine. I'll
rewrite the whole thing.
>
> As mentioned before I spent some time working on OS X and that's also
one of my motivation to rewrite some stuff. That's an interesting little
story that touch `sage-env` (surprise)....
>
> So Jean-Pierre put this in `numpy` and `scipy`
> {{{
> if [ -n "${LDFLAGS+set}" ]; then
> if [ "$UNAME" != "Darwin" ]; then
> export LDFLAGS="-bundle -undefined dynamic_lookup $LDFLAGS"
> export CPPFLAGS="-D__ACCELERATE__ $CPPFLAGS"
> else
> export LDFLAGS="-shared $LDFLAGS"
> fi
> fi
> }}}
> Which definitely looked wrong on first glance but I trusted Jean-Pierre.
I wouldn't it definitely looks wrong on non-OS Xes :)
Read the comment above this part of code.
If `LDFLAGS` is set, you need to add `-shared` yourself.
This is exactly what is done here.
And yes you are right, this must be the reason for my changes to `sage-
env`, as if `LDFLAGS` is set but empty, then `shared` won't be added and
the compilation will fail.
The easy solution is to unconditionnally add `-shared` to `LDFLAGS` on
non-OS X.
As far as OS X is concerned, I guess I got this from "the web" as I don't
have access to any OS X machine and cried for testing here before.
--
Ticket URL: <http://trac.sagemath.org/ticket/17630#comment:95>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.