That's an annoying defect that I have noticed before in the python interface to pkg-config. The libraries are put in a set and of course it is not preserving the order. It was already evident when using ATLAS for blas/lapack.

which is what you are seeing. If you still have a sage with ATLAS somewhere look at what you get for lapack. This needs to be fixed upstream so that something preserving the order is used instead of a set.

Upstream accepted my change, hopefully that will come with a new release soon. I did some experiments, while we will be able to simplify sage's code to populate the various variables *_{libs,library_dirs,include_dir} it should work out of the box without modification (haven't checked cflags actually).

I guess so, of course we need to bump singular one way or another before 7.5 is released. But I can easily add a commit here and have the singular ticket depend on it.

On second thought, the problem is really in pkgconfig (the Python package) which simply reads the system .pc files. So there is no need to regenerate the .pc files. So no further action is needed I guess.

I am now going to do a complete build from scratch with this ticket and see if it works...

Hum, I can reproduce it. It is triggered by the site.cfg generated for numpy (installed at local/lib/python2.7/site-packages/numpy/distutils/site.cfg). There is now a repetition of openblas for blas_libs and that seems to be the issue strangely enough (it should be able to take more than one library).

but pkgconfig (python) will do two calls to pkg-config and add them together. Of course with sets that wasn't visible. In any case we should be able to survive with just blas in numpy's site.cfg. I am not sure why Gentoo insists on both - possibly historical reasons.

I would have to dig inside numpy. That's where the problem is, really. But it could need a mirror fix in scipy. I think it would be better to go back to pkgconfigand add a patch to make its output more consistent, both internally and with pkg-config. That wouldn't do anything for numpy/scipy setup problem of course.

Was thinking about that. I am not satisfied with the branch as it is anyway. I will hammer some more on pkgconfig side with another pull upstream as soon as I can. I'll probably revert my last commit but even so it is probably best if numpy is bumped as well.

I have pushed a few more things upstream and requested a release. The changes I sent upstream makes my last commit unnecessary, so at the very least I'll retract it. If upstream makes a new release, I'll update the package instead of adding more patches.

Report Upstream
changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

Status
changed from needs_work to needs_review

OK, new release from upstream with all fixes included. Now the output is list, which keep the order, and is also strictly mirroring the output of the equivalent pkg-config command. The extra 2 minor releases are for various fixes to the tests that we don't use in sage but are important for me in Gentoo since I do run nose tests.