Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 399755 - dev-util/cmake: pkg-config library path not respected by cmake in Find_{BLAS,LAPACK}.cmake
Summary: dev-util/cmake: pkg-config library path not respected by cmake in Find_{BLAS,...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-22 18:48 UTC by Aleksandr Yakimov
Modified: 2012-07-18 07:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,43.07 KB, text/plain)
2012-01-22 18:48 UTC, Aleksandr Yakimov
Details
obey pkg-config libdir in FindBLAS.camke (FindBLAS.cmake.patch,1.08 KB, patch)
2012-01-28 20:36 UTC, Christoph Junghans
Details | Diff
Similiar patch for FindLAPACK.cmake (FindLAPACK.cmake.patch,1.15 KB, patch)
2012-03-08 18:26 UTC, Christoph Junghans
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksandr Yakimov 2012-01-22 18:48:52 UTC
Created attachment 299563 [details]
build.log

It seemes library path not passed to Makefile by cmake.

(it is not possible to use another optimized lib on this architecture for this moment - atlas failed to link due to internal bug in build system)

# pwd
/var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5_double
# grep -r "/opt/acml" *
CMakeCache.txt:BLAS_CFLAGS:INTERNAL=-I/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:BLAS_INCLUDEDIR:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:BLAS_INCLUDE_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:BLAS_LDFLAGS:INTERNAL=-L/opt/acml5.1.0/gfortran64_fma4/lib;-lacml
CMakeCache.txt:BLAS_LIBDIR:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
CMakeCache.txt:BLAS_LIBRARY_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
CMakeCache.txt:BLAS_PREFIX:INTERNAL=/opt/acml5.1.0/gfortran64_fma4
CMakeCache.txt:BLAS_STATIC_CFLAGS:INTERNAL=-I/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:BLAS_STATIC_INCLUDE_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:BLAS_STATIC_LDFLAGS:INTERNAL=-L/opt/acml5.1.0/gfortran64_fma4/lib;-lacml
CMakeCache.txt:BLAS_STATIC_LIBRARY_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
CMakeCache.txt:LAPACK_CFLAGS:INTERNAL=-I/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:LAPACK_INCLUDEDIR:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:LAPACK_INCLUDE_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:LAPACK_LDFLAGS:INTERNAL=-L/opt/acml5.1.0/gfortran64_fma4/lib;-lacml
CMakeCache.txt:LAPACK_LIBDIR:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
CMakeCache.txt:LAPACK_LIBRARY_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
CMakeCache.txt:LAPACK_PREFIX:INTERNAL=/opt/acml5.1.0/gfortran64_fma4
CMakeCache.txt:LAPACK_STATIC_CFLAGS:INTERNAL=-I/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:LAPACK_STATIC_INCLUDE_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
CMakeCache.txt:LAPACK_STATIC_LDFLAGS:INTERNAL=-L/opt/acml5.1.0/gfortran64_fma4/lib;-lacml
CMakeCache.txt:LAPACK_STATIC_LIBRARY_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-01-24 17:33:15 UTC
Please post your `emerge --info' output in a comment.
Comment 2 Aleksandr Yakimov 2012-01-24 18:29:23 UTC
Portage 2.2.0_alpha84 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.2, glibc-2.14.1-r2, 3.2.1-gentoo x86_64)
=================================================================
System uname: Linux-3.2.1-gentoo-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-gentoo-2.1
Timestamp of tree: Tue, 24 Jan 2012 17:30:01 +0000
ccache version 3.1.7 [disabled]
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.7-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.8.1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.10.3, 1.11.2-r1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.6-r1, 4.6.2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.2 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo science alexxy kde bicatali sunrise local
Installed sets: @preserved-rebuild, @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA skype-eula googleearth AdobeFlash-10.1 dlj-1.1 sun-bcla-java-vm google-talkplugin Oracle-BCLA-JavaSE Intel-SDP"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/tomoyo/conf /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /usr/share/themes/oxygen-gtk/gtk-2.0 /var/bind /var/lib/neatx/home"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -mtune=native"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs candy distlocks ebuild-locks fixlafiles metadata-transfer multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed,--hash-style=gnu,--sort-common"
LINGUAS="ru en"
MAKEOPTS="-j17"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /var/lib/layman/alexxy /var/lib/layman/kde /var/lib/layman/bicatali /var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avx bash-completion berkdb branding bzip2 cairo caps cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdbm gdu gif gmp gpm gtk iconv idn ipv6 jpeg kde kipi lcms libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib natspec ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pch pcre pdf phonon plasma png policykit ppds pppd qt3support qt4 readline sdl semantic-desktop session spell sse sse2 sse3 sse4 sse4_1 sse4a sse5 ssl ssse3 startup-notification svg sysfs tcpd threads tiff truetype udev unicode usb vdpau vhosts vim-syntax vorbis x264 xattr xcb xcomposite xinerama xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_req limit_zone map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi headers_more realip" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Christoph Junghans gentoo-dev 2012-01-25 16:54:26 UTC
I guess, this is not a gromacs issue, but an issue in Find{BLAS,LAPACK}.cmake.

Does acml have a pkg-config file?
Comment 4 Aleksandr Yakimov 2012-01-25 17:57:52 UTC
(In reply to comment #3)
> I guess, this is not a gromacs issue, but an issue in Find{BLAS,LAPACK}.cmake.
> 
> Does acml have a pkg-config file?
Yes, look at attached build.log and CMakeCache.txt fragment - library and its version detection.

Other packages, like gamess, octave, etc.. have no problems with acml.
Comment 5 Christoph Junghans gentoo-dev 2012-01-25 21:32:29 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > I guess, this is not a gromacs issue, but an issue in Find{BLAS,LAPACK}.cmake.
> > 
> > Does acml have a pkg-config file?
> Yes, look at attached build.log and CMakeCache.txt fragment - library and its
> version detection.
Gromacs uses {LAPACK,BLAS}_LIBRARIES and those are obviously not in 'grep /opt/acml'.

In Gentoo's Find{BLAS,LAPACK}.cmake we check for pkg-config first, and FindPkgConfig.cmake returns only the libraries (-l parts) in {LAPACK,BLAS}_LIBRARIES.

So this is an issue in Gentoo's Find{BLAS,LAPACK}.cmake modules. We should prefix {LAPACK,BLAS}_LIBRARIES with {LAPACK,BLAS}_LIBRARY_DIRS (the -L part).

> Other packages, like gamess, octave, etc.. have no problems with acml.
These packages do not use cmake!
Comment 6 Christoph Junghans gentoo-dev 2012-01-28 20:36:08 UTC
Created attachment 300201 [details, diff]
obey pkg-config libdir in FindBLAS.camke

Please test this patch for FindBLAS.cmake (disable lapack use flag for this)
Comment 7 Christoph Junghans gentoo-dev 2012-01-28 20:41:16 UTC
A similar patch could be make for FindLAPACK.cmake.
Comment 8 Johannes Huber gentoo-dev 2012-02-01 13:43:11 UTC
Comment on attachment 299563 [details]
build.log

>ÑдалÑн «/var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5/cmake/FindBLAS.cmake»
>ÑдалÑн «/var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5/cmake/FindLAPACK.cmake»

We already patch FindBLAS and FindLAPACK in cmake. It seems that gromacs ships a individual. I guess you have to delete the modules after unpack.
Comment 9 Christoph Junghans gentoo-dev 2012-02-01 15:53:09 UTC
(In reply to comment #8)
> Comment on attachment 299563 [details]
> build.log
> 
> >ÑдалÑн «/var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5/cmake/FindBLAS.cmake»
> >ÑдалÑн «/var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5/cmake/FindLAPACK.cmake»
> 
> We already patch FindBLAS and FindLAPACK in cmake. It seems that gromacs ships
> a individual. I guess you have to delete the modules after unpack.
Yes, but FindBLAS and FindLAPACK are in CMAKE_REMOVE_MODULES_LIST by default and the gromacs ebuild does not change that default, which is CMAKE_REMOVE_MODULES = yes. Gromacs is relies on Gentoo's Find{BLAS,LAPACK} (bug #373559).

Gentoo's Find{BLAS,LAPACK} will always fail if the {BLAS,LAPACK} lib is not in the default LD path (in this case /opt/acml5.1.0..), because the path is stored in {LAPACK,BLAS}_LIBRARY_DIRS, which in not used by now.
Comment 10 Rolf Eike Beer 2012-02-21 19:03:12 UTC
Please don't patch this stuff in CMake packages without reporting an upstream bug.
Comment 11 Christoph Junghans gentoo-dev 2012-03-05 23:40:49 UTC
(In reply to comment #10)
> Please don't patch this stuff in CMake packages without reporting an
> upstream bug.
No, finding BLAS/LAPACK is purely Gentoo-specific, I don't think any other distribution delievers a pkg-config file for blas/lapack.
Comment 12 Andreas K. Hüttel gentoo-dev 2012-03-08 04:46:37 UTC
Applied in 2.8.7-r4, thanks.
Comment 13 Aleksandr Yakimov 2012-03-08 06:37:56 UTC
(In reply to comment #12)
> Applied in 2.8.7-r4, thanks.

The initial problem not solved... Please reopen.

Linking C shared library libgmx.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lacml
collect2: ld returned 1 exit status
make[2]: *** [src/gmxlib/libgmx.so.6] Error 1
make[1]: *** [src/gmxlib/CMakeFiles/gmx.dir/all] Error 2
make: *** [all] Error 2
Comment 14 Christoph Junghans gentoo-dev 2012-03-08 15:49:33 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Applied in 2.8.7-r4, thanks.
> 
> The initial problem not solved... Please reopen.
> 
> Linking C shared library libgmx.so
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../x86_64-pc-linux-gnu/bin/
> ld: cannot find -lacml
> collect2: ld returned 1 exit status
> make[2]: *** [src/gmxlib/libgmx.so.6] Error 1
> make[1]: *** [src/gmxlib/CMakeFiles/gmx.dir/all] Error 2
> make: *** [all] Error 2

Please post the output of:
grep BLAS /var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5_double/CMakeCache.txt
Comment 15 Aleksandr Yakimov 2012-03-08 16:19:31 UTC
# grep BLAS /var/tmp/portage/sci-chemistry/gromacs-4.5.5-r1/work/gromacs-4.5.5_double/CMakeCache.txt
//Use external BLAS instead of built-in
GMX_EXTERNAL_BLAS:BOOL=ON
//Details about finding BLAS
FIND_PACKAGE_MESSAGE_DETAILS_BLAS:INTERNAL=[/opt/acml5.1.0/gfortran64_fma4/lib/libacml.so][v()]
//ADVANCED property for variable: GMX_EXTERNAL_BLAS
GMX_EXTERNAL_BLAS-ADVANCED:INTERNAL=1
PC_BLAS_CFLAGS:INTERNAL=-I/opt/acml5.1.0/gfortran64_fma4/include
PC_BLAS_CFLAGS_I:INTERNAL=
PC_BLAS_CFLAGS_OTHER:INTERNAL=
PC_BLAS_FOUND:INTERNAL=1
PC_BLAS_INCLUDEDIR:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
PC_BLAS_INCLUDE_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
PC_BLAS_LDFLAGS:INTERNAL=-L/opt/acml5.1.0/gfortran64_fma4/lib;-lacml
PC_BLAS_LDFLAGS_OTHER:INTERNAL=
PC_BLAS_LIBDIR:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
PC_BLAS_LIBRARIES:INTERNAL=acml
PC_BLAS_LIBRARY_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
PC_BLAS_LIBS:INTERNAL=
PC_BLAS_LIBS_L:INTERNAL=
PC_BLAS_LIBS_OTHER:INTERNAL=
PC_BLAS_LIBS_PATHS:INTERNAL=
PC_BLAS_PREFIX:INTERNAL=/opt/acml5.1.0/gfortran64_fma4
PC_BLAS_STATIC_CFLAGS:INTERNAL=-I/opt/acml5.1.0/gfortran64_fma4/include
PC_BLAS_STATIC_CFLAGS_I:INTERNAL=
PC_BLAS_STATIC_CFLAGS_OTHER:INTERNAL=
PC_BLAS_STATIC_INCLUDE_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/include
PC_BLAS_STATIC_LDFLAGS:INTERNAL=-L/opt/acml5.1.0/gfortran64_fma4/lib;-lacml
PC_BLAS_STATIC_LDFLAGS_OTHER:INTERNAL=
PC_BLAS_STATIC_LIBDIR:INTERNAL=
PC_BLAS_STATIC_LIBRARIES:INTERNAL=acml
PC_BLAS_STATIC_LIBRARY_DIRS:INTERNAL=/opt/acml5.1.0/gfortran64_fma4/lib
PC_BLAS_STATIC_LIBS:INTERNAL=
PC_BLAS_STATIC_LIBS_L:INTERNAL=
PC_BLAS_STATIC_LIBS_OTHER:INTERNAL=
PC_BLAS_STATIC_LIBS_PATHS:INTERNAL=
PC_BLAS_VERSION:INTERNAL=5.1.0
PC_BLAS_blas_INCLUDEDIR:INTERNAL=
PC_BLAS_blas_LIBDIR:INTERNAL=
PC_BLAS_blas_PREFIX:INTERNAL=
PC_BLAS_blas_VERSION:INTERNAL=
__pkg_config_checked_PC_BLAS:INTERNAL=1
Comment 16 Christoph Junghans gentoo-dev 2012-03-08 16:46:13 UTC
@Aleksandr: Can you try with IUSE="-lapack blas" ?

@dilfridge: Did you also created a new FindLAPACK.cmake? (similar patch)
Comment 17 Andreas K. Hüttel gentoo-dev 2012-03-08 16:57:05 UTC
(In reply to comment #16)
> @dilfridge: Did you also created a new FindLAPACK.cmake? (similar patch)

Doh, sorry, no. Could you please give me a hand? Travelling and not too much time... :|
Comment 18 Aleksandr Yakimov 2012-03-08 17:57:40 UTC
(In reply to comment #16)
> @Aleksandr: Can you try with IUSE="-lapack blas" ?
> 
This is OK.

 # ldd /usr/bin/mdrun
        linux-vdso.so.1 =>  (0x00007ffff0530000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f80af6b8000)
        libgmxpreprocess.so.6 => /usr/lib64/libgmxpreprocess.so.6 (0x00007f80af420000)
        libmd.so.6 => /usr/lib64/libmd.so.6 (0x00007f80af150000)
        libgmx.so.6 => /usr/lib64/libgmx.so.6 (0x00007f80aecc0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f80ae938000)
        libfftw3.so.3 => /usr/lib64/libfftw3.so.3 (0x00007f80ae570000)
        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007f80ae210000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f80adff0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f80adde8000)
        libacml.so => /opt/acml5.1.0/gfortran64_fma4/lib/libacml.so (0x00007f80abb78000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f80af938000)
        libicui18n.so.48 => /usr/lib64/libicui18n.so.48 (0x00007f80ab7a8000)
        libicuuc.so.48 => /usr/lib64/libicuuc.so.48 (0x00007f80ab438000)
        libicudata.so.48 => /usr/lib64/libicudata.so.48 (0x00007f80aa0c8000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f80a9eb0000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f80a9ca8000)
        libgfortran.so.3 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/libgfortran.so.3 (0x00007f80a9988000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/libstdc++.so.6 (0x00007f80a9680000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f80a9468000)
        libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/libquadmath.so.0 (0x00007f80a9230000)
Comment 19 Christoph Junghans gentoo-dev 2012-03-08 18:26:14 UTC
Created attachment 304653 [details, diff]
Similiar patch for FindLAPACK.cmake

Done!
Comment 20 Christoph Junghans gentoo-dev 2012-03-08 18:27:14 UTC
(In reply to comment #18)
> (In reply to comment #16)
> > @Aleksandr: Can you try with IUSE="-lapack blas" ?
> > 
> This is OK.
> 
That just means we need to add the FindLAPACK patch as well!
Comment 21 Andreas K. Hüttel gentoo-dev 2012-03-09 01:22:47 UTC
(In reply to comment #19)
> Created attachment 304653 [details, diff] [details, diff]
> Similiar patch for FindLAPACK.cmake
> 
> Done!

Thanks a lot, added in -r5. Now we should really have killed this bug.
Comment 22 Aleksandr Yakimov 2012-03-09 08:30:11 UTC
(In reply to comment #21)
> (In reply to comment #19)
> > Created attachment 304653 [details, diff] [details, diff] [details, diff]
> > Similiar patch for FindLAPACK.cmake
> > 
> > Done!
> 
> Thanks a lot, added in -r5. Now we should really have killed this bug.

Yes, for gromacs really killed. 

I've found another cmake package affecting this issue - sci-libs/clapack, but it uses bundled blas detection routine. I'll open another bug.
Comment 23 Janick Martinez Esturo 2012-07-18 07:22:37 UTC
Hi!

I have a problem with these BLAS/LAPACK patches when using them to find my mkl libs.

My /usr/lib64/pkgconfig/blas.pc is

prefix=/opt/intel/composerxe-2011.7.256/mkl
libdir=${prefix}/lib/intel64
includedir=${prefix}/include
Name: mkl64-gfortran-openmp
Description: Intel Math Kernel Library: linear algebra, fft, math functions
Version: 10.3.7.256
URL: http://software.intel.com/en-us/articles/intel-mkl/
Libs: -L${libdir} -Wl,--start-group -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -lpthread -lm -lgomp
Cflags: -m64 -I${includedir}

I use the mkl64-gfortran-openmp blas profile, therefore there is a -lgomp OpenMP link directive. However, this results in the following error as libgomp.so is not in the libdir in the blas.pc:

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") 
-- checking for module 'lapack'
--   found lapack, version 10.3.7.256
CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:54 (message):
  Something is wrong in your pkg-config file - lib gomp not found in
  /opt/intel/composerxe-2011.7.256/mkl/lib/intel64
Call Stack (most recent call first):
  CMakeLists.txt:31 (FIND_PACKAGE)

Can the patch be modified slightly to either ignore "gomp" when looking for the libs in the libdir or use, e.g. the output of `gcc-config -L` as additional hints for the find_library macro? Hope you can help me in patching this problem.