Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] portage and blas/lapack-reference mess
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
disperato
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 108

PostPosted: Thu Jan 17, 2013 1:26 pm    Post subject: [SOLVED] portage and blas/lapack-reference mess Reply with quote

hi all,
here is a problem with emerging of octave, umfpack and maybe others in the future.
I didn't install blas-reference and lapack-reference because I prefer the optimised versions shipped with acml from amd (I'm on amd64) and atlas from science overlay. Both contains blas and lapack along with other libraries.
When it comes to emerge octave or the umfpack (for sparse matrices), emerge fails with:

Code:
checking for sgemm_ in -lblas... (cached) no
checking for sgemm_ in -lblas... (cached) no
configure: error: Cannot find blas libraries


[ironic] obviously [/ironic] blas-reference cannot be installed on the same system where atlas, acml, eigen, gsl, and a lot of other specific libraries for maths purposes are. Needless to say this incompatibility makes eselect-blas and eselect-lapack, a total joke!

Is there any way to overcome the issue? Where am I worng? Or is gentoo, the freedom and performance flag of linux, forcing users to default to common standardised versions of libraries? Or is it a problem with packages themselves, not ebuilds?
Tips, hints, discussion are welcome!
_________________
The free men's path is always obstructed by mediocrity.


Last edited by disperato on Sat Jan 19, 2013 6:03 pm; edited 2 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Jan 17, 2013 1:42 pm    Post subject: Reply with quote

It's Portage, not protage, dammit. Are you typing this on an Android? Is your QA really that low?

Quote:
forcing users

You're looking at this the wrong way. There is no forcing, no melodrama. You are free to change the compilation to suit your needs. You are also free to submit patches to improve your distro of choice.

Code:
configure: error: Cannot find blas libraries

So, look at that configure script, see how it tries to detect the libraries.

You can also look at how other distros handle it. All the source code and their patches are available.
Back to top
View user's profile Send private message
disperato
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 108

PostPosted: Thu Jan 17, 2013 4:27 pm    Post subject: Reply with quote

You're right about the title, I've just changed it to portage. Yes, my attention is low after the "these packages cannot be installed at the same time" (with no reason whatsoever) circus.

You're right on the melodrama stuff, too. Nobody forces. It's just the user has the choice between building the mainstream stuff, or spending some weeks to resolve dependencies, change ebuilds, and so fort. I'll report here news, if any.
_________________
The free men's path is always obstructed by mediocrity.
Back to top
View user's profile Send private message
disperato
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 108

PostPosted: Fri Jan 18, 2013 10:32 pm    Post subject: Reply with quote

hi everyone,

as promised I post here the newbie (you will agree it's me) workaround.

Assume one wants to install a compilation of high performance libraries for C and fortran, other than the reference stuff.
When it comes to emerge, say, acml (on amd), atlas, gotoblas2 (the latter two currently in science overlay), a bunch of troubles are looming:

1. blas-reference, cblas-reference, lapack-reference in gentoo portage (ebuilds quite outdated compared to those in science overlay) each requires the corresponding eselect-blas,cblas,lapack as a dependency. These dependencies cannot be installed on the same system along with the desired libraries.

emerging from gentoo ignoring dependencies will suffice:
Code:
emerge -O blas-reference::gentoo cblas-reference::gentoo lapack-reference::gentoo

In fact eselect-blas, eselect-cblas, eselect-lapack are completely useless, they will never recognise any other implementation of blas, cblas, lapack that is shipped with the other libraries of choice. Proof? Try them. If short of time, just compare the other modules in /usr/share/eselect/modules with those which would be installed by eselect-blas,etc. The file that is copied in /usr/share/eselect/modules is /usr/portage/app-admin/eselect-blas/files/blas.eselect-0.1, and here is its content:

Code:
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: blas.eselect-0.1,v 1.1 2006/06/18 20:59:04 spyderous Exp $

inherit skel

MODULE="BLAS"
IFACE="blas"

DESCRIPTION="Manage installed $MODULE implementations"
MAINTAINER="spyderous@gentoo.org"
SVN_DATE='$Date: 2006/06/18 20:59:04 $'
VERSION=$(svn_date_to_version "${SVN_DATE}" )

# vim: set ft=eselect :


Given that eselect won't work in this case, just forget it and go on.

2. The reference libraries from gentoo portage create symlinks, instead of copying *.pc files, in /usr/lib64/pkgconfig
Every other library that needs blas, cblas, lapack will find them installed, and emerge successfully.
Emerging the (much newer) reference libraries from science overlay, though, doesn't set the above mentioned symlinks, which makes configure script from other libraries fail with "blas not found" and so fort.

All libraries from science overlay will set symlinks in /etc/env.d/alternatives/blahblahblah
In order to head configure scripts for, say, arpack, or umfpack to the reference implementation, symlinks must be created manually:

Code:
cd /usr/lib/pkgconfig
ln -sf /etc/env.d/alternatives/blas/reference/usr/lib64/pkgconfig/blas.pc blas.pc


3. don't even try to symlink to other libraries, say atlas (or gsl, or acml, whatever). If you do so, emerging a library like umfpack or a program like octave will obviously fail with the "blas not found" message. Whilst this is obvious, the following isn't: if you set again symlinks to the reference stuff (and check that the changes were done), emerging (say) umfpack or octave will fail again and again, and only way to recover is to re-emerge reference::science stuff and softlink again.
_________________
The free men's path is always obstructed by mediocrity.
Back to top
View user's profile Send private message
disperato
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 108

PostPosted: Sat Jan 19, 2013 6:03 pm    Post subject: Reply with quote

UPDATE:

I overlooked the suggestion on this link http://gentoo.2317880.n4.nabble.com/blas-lapack-stuff-td200931.html
where it says: the eselect that works with blas, etc. is that from science overlay.
It sounded strange to me that installing just eselect, without the blas,cblas,lapack modules works (plus I got confused and installed new eselect version from gentoo instead of science overlay).

Simple solution to all the mess I did above is:

Code:
emerge --unmerge eselect-blas eselect-cblas eselect-lapack


keyword the eselect from science in /etc/portage/package.keyword

Code:
app-admin/eselect::science ~amd64


and emerge eselect.

Now eselect-LIB shows all implementations of LIB and works well.

The way this has been accomplished is very elegant :wink:

Code:
ls /usr/share/eselect/modules

auto                     env.eselect               kernel.eselect            opencl.eselect            profile.eselect           timidity.eselect
bashcomp.eselect          esd.eselect               locale.eselect            opengl.eselect            python.eselect            vi.eselect
binutils.eselect          fontconfig.eselect        mesa.eselect              pager.eselect             qtgraphicssystem.eselect  visual.eselect
ecj.eselect               java-nsplugin.eselect     modules.eselect           php.eselect               rc.eselect                wxwidgets.eselect
editor.eselect            java-vm.eselect           news.eselect              pinentry.eselect          ruby.eselect              xvmc.eselect

ls /usr/share/eselect/modules/auto
blas.eselect     cblas.eselect    lapacke.eselect  lapack.eselect

cat /usr/share/eselect/modules/auto/blas.eselect

# This module was automatically generated by alternatives.eclass
DESCRIPTION="Alternatives for blas"
VERSION="20090908"
MAINTAINER="eselect@gentoo.org"
ESELECT_MODULE_GROUP="Alternatives"

ALTERNATIVE="blas"

inherit alternatives


I hope this helps anyone who may have got confused as I had.
_________________
The free men's path is always obstructed by mediocrity.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum