summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2011-03-14 17:05:42 +0000
committerJustin Lecher <jlec@gentoo.org>2011-03-14 17:05:42 +0000
commit6dcc54dfb8ba97ffc52a8036a2b4444920237cad (patch)
tree40699222055d2b7cd8f5be7d4c595e47fce45350 /sci-libs
parentVersion bump. Bug #358757. Thanks to Denny (diff)
downloadhistorical-6dcc54dfb8ba97ffc52a8036a2b4444920237cad.tar.gz
historical-6dcc54dfb8ba97ffc52a8036a2b4444920237cad.tar.bz2
historical-6dcc54dfb8ba97ffc52a8036a2b4444920237cad.zip
Use pkg-config to detect BLAS/LAPAACK libs
Package-Manager: portage-2.2.0_alpha26/cvs/Linux x86_64
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/ccp4-libs/ChangeLog6
-rw-r--r--sci-libs/ccp4-libs/Manifest11
-rw-r--r--sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild5
-rw-r--r--sci-libs/ccp4-libs/files/6.1.3-lapack.patch597
4 files changed, 612 insertions, 7 deletions
diff --git a/sci-libs/ccp4-libs/ChangeLog b/sci-libs/ccp4-libs/ChangeLog
index a288f382655c..40e8a20e7153 100644
--- a/sci-libs/ccp4-libs/ChangeLog
+++ b/sci-libs/ccp4-libs/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sci-libs/ccp4-libs
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/ccp4-libs/ChangeLog,v 1.32 2011/03/14 15:51:46 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/ccp4-libs/ChangeLog,v 1.33 2011/03/14 17:05:42 jlec Exp $
+
+ 14 Mar 2011; Justin Lecher <jlec@gentoo.org> +files/6.1.3-lapack.patch,
+ ccp4-libs-6.1.3-r9.ebuild:
+ Use pkg-config to detect BLAS/LAPAACK libs
14 Mar 2011; Justin Lecher <jlec@gentoo.org> ccp4-libs-6.1.3-r9.ebuild:
Check for mmdb through pkg-config
diff --git a/sci-libs/ccp4-libs/Manifest b/sci-libs/ccp4-libs/Manifest
index 4826e1db53cd..2aed148e895e 100644
--- a/sci-libs/ccp4-libs/Manifest
+++ b/sci-libs/ccp4-libs/Manifest
@@ -7,6 +7,7 @@ AUX 6.1.3-dont-build-mmdb.patch 749 RMD160 2f4b04d07095d464f00522a935cb93c2dae40
AUX 6.1.3-dont-make-dirs-in-configure.patch 2866 RMD160 ba49e45ab609a42a2d93b96f55af913bf9625610 SHA1 36c9329c3768c08687ef062c9ab649d32833b422 SHA256 1b5997f17526a4fd60ffa9eccf4b765aadf3a78c9394657000e0454f364240ca
AUX 6.1.3-glibc2.10.patch 1018 RMD160 577ee4a6174df36bb8bac82738523f5c757df4b9 SHA1 48ad6d0d024c43d64277e4decba420d51e75a510 SHA256 d2a2ddf2a66738d94723b50797e279f64c8e057a3e584e33f9eb9c8d7ea0e532
AUX 6.1.3-impl-dec.patch 3957 RMD160 dbf3f5fd553a2f409a90affafa089574631155c8 SHA1 7192678802f339951cbc9ba2d61627f91ce58d69 SHA256 29b68e7ced2160ef880b03b9e7488e0d4ccf1717c5b87b582ab32f1a3eff6bce
+AUX 6.1.3-lapack.patch 21635 RMD160 a1243e5a7fb1f9982171b8362b764ccbd1799747 SHA1 a4090422ba12bddc1cf9797d02fa6f6cab127f72 SHA256 f6eaf5dac5e5b6fce26eb1106c11de366e325179e82e70d69c174c969ac43c6d
AUX 6.1.3-link-proberly.patch 8282 RMD160 c45d3d1931e6a083c0c96b819aff3f67873659b8 SHA1 b1be6f1f7162616a60f3e12fe02dbe4dd426e990 SHA256 f6623dfb0d270e5fbffe03f95b23c967ec8da34b3d0a1c5262941979a965f9ea
AUX 6.1.3-noinstall.patch 5188 RMD160 d3b22f11d7c27b37243b003f03615af377c8e632 SHA1 d75402e7b23d3aa15e67cda6cec8c93864d509c2 SHA256 22d96aea9d3d5e6e090713e610b35bdb34eaff9157c41687b47294f0d62ccff7
AUX 6.1.3-overflows.patch 904 RMD160 03d5f10e901734c6e21be3e68592711450df32cd SHA1 24a740658fae2f917061c2a032a43a60e75c5478 SHA256 e5c62922daf832b62e9ea1e14a2be0d54c88b035b78b5831eee07025dff9222a
@@ -14,13 +15,13 @@ AUX 6.1.3-unbundle-libs-ng.patch 13925 RMD160 eb96be062a507906f2e1d2659db0663ef0
AUX 6.1.3-unbundle-libs.patch 9063 RMD160 326af0e6990134546fb2607dae707b94d4588149 SHA1 ef929532e45c12fb168e5fca4eb7fa8c857c376a SHA256 7e5fc919b5204e2d9141f7715afdd8a8b4e3e2a96e2bf95aa00fbd56046f1aa4
DIST ccp4-6.1.3-core-src.tar.gz 242134076 RMD160 e9b7deb0766fb95d5e8946881f20e086f0896fe9 SHA1 ee5ada892694db5dc9b2d7d2330b4ac694f56580 SHA256 1e529c660e7f390ec0feca9d45caa00a2813d23156c10a2747c427117293c324
EBUILD ccp4-libs-6.1.3-r8.ebuild 10816 RMD160 f001019f12ffbbf1e4a8448504a8eac347e759de SHA1 0f8c8618f0f66dde8c86aa2d08cf696ec91bc18c SHA256 1f3f02adb2882f9b22344529df443f94c2a803dc3756914b6a713fc41d2bb237
-EBUILD ccp4-libs-6.1.3-r9.ebuild 11140 RMD160 5fd4beefbeaea3aee1898d4efaa5e2870ddba3fe SHA1 2e20737c4e326bce7c26f40b1424f9169c95f69a SHA256 00d481c1602ca83e7f3b82fb2ff047a934e8252719b089adfd853de26bdd0297
-MISC ChangeLog 4914 RMD160 02735578e0d2466b457f4950897d332c3d7398bc SHA1 4c73132d3d0758b96cdcf4292a27430d1f37e760 SHA256 5d7878db56825279c92c0f5031ca5482df265c247fc4898226b4000070b59cce
+EBUILD ccp4-libs-6.1.3-r9.ebuild 11225 RMD160 de39dd110db34cc5de2f0b25b0bf17c8124ebf08 SHA1 233ec5a65b0cc3f3a88f42a7d57bfdf614b6cd64 SHA256 ae68cc06083524648334454d8adff45d8b4817bf983aabff466fc36cd11be353
+MISC ChangeLog 5063 RMD160 771b3ed2ac82a0e01c1fc8bc66dd515849954c1a SHA1 b7e1c199c05dd879d21f74a07640cfdecfe8fd03 SHA256 fefb8fcad550ce0c6fc192e9d5a9b03b138a76b10d1d490e18bb7f9ba233ce1c
MISC metadata.xml 306 RMD160 57ba72f54388a666851bda87e52d313d618084e3 SHA1 7d2f57cb3f35eb6d4567b211e01251b5945d4eb2 SHA256 af351be5ead71b377b6fa2fa118fb9aee74129afdc19f736b41596d3033106aa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iEYEARECAAYFAk1+OZcACgkQgAnW8HDreRZ/zgCfWV5ZzNelaiQ5bID3qC72IPAp
-O1cAn1z+WJmJlUDoqWW/c9KZvsq8YS0x
-=yzQ3
+iEYEARECAAYFAk1+SuwACgkQgAnW8HDreRaENQCgy2927pUD93DPH/0AyvV/vlse
+QJoAn0t1mGYpzuKVvKQ4qXizuWow3uDR
+=RUwz
-----END PGP SIGNATURE-----
diff --git a/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild b/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild
index acde634e5e45..85f81a890275 100644
--- a/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild
+++ b/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild,v 1.2 2011/03/14 15:51:46 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r9.ebuild,v 1.3 2011/03/14 17:05:42 jlec Exp $
EAPI="3"
@@ -110,6 +110,9 @@ src_prepare() {
# Fix upstreams code
ccp_patch "${FILESDIR}"/${PV}-impl-dec.patch
+ # use pkg-config to detect BLAS/LAPACK
+ ccp_patch "${FILESDIR}"/${PV}-lapack.patch
+
einfo "Done." # done applying Gentoo patches
echo
diff --git a/sci-libs/ccp4-libs/files/6.1.3-lapack.patch b/sci-libs/ccp4-libs/files/6.1.3-lapack.patch
new file mode 100644
index 000000000000..2514733f876d
--- /dev/null
+++ b/sci-libs/ccp4-libs/files/6.1.3-lapack.patch
@@ -0,0 +1,597 @@
+diff --git a/configure b/configure
+index 833f483..bcfa62d 100755
+--- a/configure
++++ b/configure
+@@ -3226,574 +3226,14 @@ else
+ echo
+ echo "Warning: this option has not been extensively tested!"
+ echo "Please report problems to ccp4@ccp4.ac.uk"
+- # Search for vendor LAPACK/BLAS first
+- if test ! "$with_netlib_lapack" ; then
+- # Initialise variables to blank
+- lapackdir=
+- XLAPACK_LIB=
+- # Possible directories to check for vendor or pre-existing LAPACK or
+- # BLAS - add to these if you want to test others
+- trydirs="`echo $LD_LIBRARY_PATH |sed -e s/:/\ /g` /lib /usr/lib /usr/local/lib"
+- # Possible library names
+- # These are the names like xxxx where the library will be libxxxx.a
+- # or libxxxx.so
+- echo
+- echo "Guessing names for native/vendor LAPACK and/or BLAS libraries"
+- echo "on this system"
+- case $system in
+- linux | linux64 | linux32 )
+- # linux users will usually have them in /usr/lib but don't call it
+- trylapack="lapack"
+- tryblas="blas"
+- # if code is non_shared then this can lead to problems. both blas and lapack
+- # need to be resolved even if they are not called!
+- if test "$non_shared" = yes; then
+- echo "You are compiling linux non_shared. This sometimes causes problems "
+- echo " so checking for requirements."
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+- PROGRAM TESTLINK
+-C A bit of scala code to test the linking
+- real bf(3), bnorm
+-c
+- integer maxbmt
+- parameter (maxbmt = 2)
+- double precision B(maxbmt,maxbmt), eigval(maxbmt),
+- $ eigvec(maxbmt,maxbmt), w(5*maxbmt)
+- integer m, ia, ix, istat
+-c
+- B(1,1) = 1.00
+- B(1,2) = 1.00
+- B(2,1) = 1.00
+- B(2,2) = 1.00
+-c
+- m = maxbmt
+- ia = maxbmt
+- ix = maxbmt
+- call dsyev('N', 'L', m, B, ia, eigval, w, 5*maxbmt, istat)
+- end
+-EOF
+- #firstly test without -lblas
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack"
+- echo $test_compile
+- if { (eval $test_compile >& /dev/null ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... only -llapack needed"
+- XLAPACK_LIB="-llapack"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="lapack"
+- noblas=yes
+- trylapack=
+- tryblas=
+- else
+- echo "more than just -llapack needed...."
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack -lblas"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "...-llapack and -lblas were needed"
+- XLAPACK_LIB="-llapack -lblas"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="lapack blas"
+- noblas=no
+- trylapack=
+- tryblas=
+- else
+- echo "....could not find either lapack or blas."
+- fi
+- fi
+- fi
+- # add 64 bit libs
+- case $system in
+- linux64 ) trydirs="/usr/lib64 ${trydirs}" ;;
+- esac
+-
+- ;;
+- osf1)
+- # OSF1 has dxml (old version) and cxml
+- # which should have both lapack and blas
+- trylapack="dxml cxml"
+- tryblas=
+- trydirs="${trydirs} /usr/shlib"
+- ;;
+- irix)
+- # Additional search paths for IRIX
+- trydirs="${trydirs} /usr/lib32"
+- # SCSL should have both LAPACK and BLAS
+- trylapack="scs"
+- tryblas="blas"
+- ;;
+- irix64)
+- # Additional search paths for IRIX64
+- trydirs="${trydirs} /usr/lib64"
+- # SCSL should have both LAPACK and BLAS
+- trylapack="scs"
+- tryblas="blas"
+- # Extra compiler flags?
+- #XLAPACKFLAGS="-OPT:IEEE_NaN_inf=ON"
+- ;;
+- aix)
+- # Additional search paths for AIX
+- trydirs="${trydirs}"
+- # AIX might have ESSL library - blas only I think
+- trylapack=
+- tryblas="essl"
+- ;;
+- hpux)
+- # Additional search paths for HPUX
+- trydirs="${trydirs} /opt/fortran/lib /opt/fortran/lib/pa2.0 /opt/mlib/lib/pa2.0"
+- # HPUX should have both LAPACK (part of mlib) and BLAS
+- trylapack="lapack"
+- tryblas="blas"
+- # Extra compiler flags?
+- # +U77 required for ETIME function - this is already in XFFLAGS
+- #XLAPACKFLAGS="+U77"
+- ;;
+-
+- sunos | sunos64)
+- # Sun has libraries with BLAS and LAPACK invoked using
+- # -xlic_lib=sunperf
+- trylapack=
+- tryblas=
+- echo "SunOs can use the Sun Performance Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- echo "Looking for a valid library to use..."
+- echo
+- # Loop over the possible library names
+- try_libs="sunperf"
+- for testlib in $try_libs
+- do
+- if test ! "$XLAPACK_LIB" ; then
+- # Try running a test compile to see if this a valid library
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -dalign -xlic_lib=$testlib"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -xlic_lib=$testlib is okay"
+- XLAPACK_LIB="-dalign -xlic_lib=$testlib"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="$testlib"
+- noblas=yes
+- else
+- # Compilation failed
+- echo "... cannot use -xlic_lib=$testlib"
+- fi
+- # End of test for testlib
+- fi
+- # End of loop over possible lib names
+- done
+- # Report if no suitable library was found
+- if test ! "$XLAPACK_LIB" ; then
+- echo
+- echo "No suitable LAPACK library was found."
+- echo "This may be because the Sun Performance Library is not"
+- echo "installed on your system"
+- echo "Contact your system administrator or Sun vendor"
+- fi
+- ;;
+- Darwin | Darwin32 | Darwin64 )
+- # Darwin has libraries with BLAS and LAPACK invoked using
+- # -framework vecLib
+- echo "Darwin can use the vecLib Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- # This is a special case so try running a test compile
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -framework vecLib"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -framework vecLib is okay"
+- XLAPACK_LIB="-framework vecLib"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="vecLib"
+- noblas=yes
+- else
+-#alternative linking for vecLib libraries
+- case `uname -sr` in
+- *Darwin\ 7.* ) test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -lcc_dynamic -Wl,-framework -Wl,vecLib" ;;
+- * ) test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -Wl,-framework -Wl,vecLib" ;;
+- esac
+-
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -framework vecLib is okay"
+- XLAPACK_LIB="-Wl,-framework -Wl,vecLib"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="-Wl,-framework -Wl,vecLib"
+- noblas=yes
+- else
+- # Compilation failed
+- echo "... cannot use -framework vecLib"
+- echo
+- fi
+- fi
+- trylapack=
+- tryblas=
+-# try the fink installation
+- trydirs="${trydirs} /sw"
+- ;;
+- Darwin_ibm_compilers )
+- # Darwin has libraries with BLAS and LAPACK invoked using
+- # -framework vecLib
+- echo "Darwin can use the vecLib Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- # This is a special case so try running a test compile
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- case `uname -sr` in
+- Darwin\ 8* )
+- XLAPACK_LIB="-L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lLAPACK -lBLAS"
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f $XLAPACK_LIB"
+- ;;
+- Darwin\ 7* )
+- XLAPACK_LIB="-L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lLAPACK -lBLAS"
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -lcc_dynamic $XLAPACK_LIB"
+- ;;
+- *)
+- XLAPACK_LIB="/System/Library/Frameworks/vecLib.Framework/Versions/Current/VecLib"
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f $XLAPACK_LIB"
+- esac
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -framework vecLib is okay"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="vecLib"
+- noblas=yes
+- else
+- # Compilation failed
+- XLAPACK_LIB=""
+- echo "... cannot use -framework vecLib"
+- echo
+- fi
+- trylapack=
+- tryblas=
+-# try the fink installation
+- trydirs="${trydirs} /sw"
+- ;;
+-
+- Darwin_intel_compilers)
+- # Darwin has libraries with BLAS and LAPACK invoked using
+- # -F vecLib
+- echo "Darwin can use the vecLib Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- # This is a special case so try running a test compile
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -Wl,-framework -Wl,vecLib"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- # doesn't try to build netlib libraries
+- XLAPACK_LIB="-F /System/Library/Frameworks -Qoption,ld,-framework -Qoption,ld,vecLib"
+- LAPACKLIB="vecLib"
+- noblas=yes
+- else
+- # Compilation failed
+- echo "... cannot use -framework vecLib"
+- echo
+- fi
+- trylapack=
+- tryblas=
+-# try the fink installation
+- trydirs="${trydirs} /sw"
+- ;;
+-
+-# linux_ia64_sgi_altix)
+-# SGI Japan
+- ia64_linux_intel)
+- # Additional search paths for Linux/IA64
+- trydirs="${trydirs} /opt/scsl/lib /usr/lib /usr/local/lib"
+- # SCSL and MKL should have both LAPACK and BLAS
+- trylapack="mkl_lapack scs lapack"
+- tryblas="mkl scs blas"
+- ;;
+- linux_ibm_compilers )
+- trylapack="lapack"
+- tryblas="blas"
+- ;;
+- linux64_ibm_compilers )
+- trydirs="/usr/lib64 ${trydirs}"
+- trylapack="lapack"
+- tryblas="blas"
+- ;;
+- linux_intel_compilers )
+- trydirs="/usr/lib64 ${trydirs}"
+- trylapack="mkl_lapack lapack"
+- tryblas="mkl blas"
+- ;;
+- *)
+- echo "The guesses for this system may not be correct - please"
+- echo "e-mail ccp4@ccp4.ac.uk if you have any extra information"
+- echo
+- # Default guess is just libblas
+- trylapack="lapack"
+- tryblas="blas"
+- ;;
+- esac
+- #
+- # Search for LAPACK libraries
+- #
+- # Write out what the guesses are
+- if test "$trylapack" ; then
+- echo "Possible LAPACK library names for this system:"
+- for libname in $trylapack
+- do
+- echo " lib$libname"
+- done
+- # Possible library name extensions
+- tryexts="a so dylib"
+- # Now loop over all the possibilities and see if anything
+- # turns up
+- echo
+- echo "Searching for libraries with LAPACK and BLAS:"
+- for testdir in $trydirs
+- do
+- for testlib in $trylapack
+- do
+- for ext in $tryexts
+- do
+- if test ! "$LAPACKLIB"; then
+- if test -s "$testdir/lib$testlib.$ext" ; then
+- echo "...found LAPACK library: $testdir/lib$testlib.$ext"
+- # Now try and link to a test program
+- # This is really for IRIX where libraries can be
+- # o32 or n32
+- echo " Testing: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- have_lapack=yes
+- else
+-# cover clapack option
+- echo $test_ccompile
+- if { (eval $test_ccompile ) 2>&1; } && test -s testlink ; then
+- have_lapack=yes
+- fi
+- fi
+- if test x$have_lapack = xyes ; then
+- # This one is okay
+- LAPACKLIB="$testlib"
+- LAPACKDIR="$testdir"
+- echo "Link ok - using lib$LAPACKLIB from $LAPACKDIR"
+- #
+- XLAPACK_LIB="-L$LAPACKDIR -l$LAPACKLIB"
+- #
+- # Test to see if we need BLAS too
+- # Do this by trying to compile a test program
+- # Use the LSAME test for now
+- echo
+- echo " * Checking whether we need a separate BLAS library *"
+- echo " Testing: try linking library against test program"
+- cd lib/lapack/test
+- if test -f testlsame ; then
+- rm -f testsame testlsame.o
+- fi
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB $XLDFLAGS"
+- echo $test_compile
+- if { ( eval $test_compile) 2>&1;} && test -s testlsame ; then
+- have_blas=yes
+- else
+-#cblas route
+- echo $test_ccompile
+- if { ( eval $test_ccompile) 2>&1;} && test -s testlsame ; then
+- have_blas=yes
+- fi
+- fi
+- if test x$have_blas = xyes ; then
+- echo "Test program okay - additional separate BLAS not required"
+- noblas=yes
+- else
+- echo "Test program failed - need a separate BLAS library"
+- fi
+- cd ../../..
+- else
+- # Keep looking
+- echo " link failed - cannot use lib$testlib"
+- fi
+- fi
+- fi
+- done
+- done
+- if test ! "$LAPACKLIB"; then
+- echo "...nothing in $testdir"
+- fi
+- done
+- fi
+-
+- # If LAPACKLIB hasn't been set at this point then no LAPACK library
+- # was found
+- if test ! "$LAPACKLIB" ; then
+- echo
+- echo "No pre-existing LAPACK library found - NetLib LAPACK will be built instead"
+- make_lapack=lapacklib
+- fi
+- # Look for possible BLAS
+- if test ! "$noblas" ; then
+- if test "$tryblas" ; then
+- echo
+- echo "Possible BLAS library names for this system:"
+- for libname in $tryblas
+- do
+- echo " lib$libname"
+- done
+- # Possible library name extensions
+- tryexts="a so"
+- # Now loop over all the possibilities and see if anything
+- # turns up
+- echo
+- echo "Searching for libraries with BLAS:"
+- for testdir in $trydirs
+- do
+- for testlib in $tryblas
+- do
+- for ext in $tryexts
+- do
+- if test ! "$BLASLIB"; then
+- if test -s "$testdir/lib$testlib.$ext" ; then
+- echo "...found BLAS library: $testdir/lib$testlib.$ext"
+- # Now try and link to a test program
+- # This is really for IRIX where libraries can be
+- # o32 or n32
+- echo " Testing: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS"
+- echo $test_compile
+- if { ( eval $test_compile) 2>&1;} && test -s testlink ; then
+- have_blas=yes
+- else
+- echo $test_ccompile
+- if { ( eval $test_compile) 2>&1;} && test -s testlink ; then
+- have_blas=yes
+- fi
+- fi
+- if test x$have_blas = xyes ; then
+- # This one is okay
+- BLASLIB="$testlib"
+- BLASDIR="$testdir"
+- BLASEXT="$ext"
+- echo "Link ok - using lib$BLASLIB from $BLASDIR"
+- XLAPACK_LIB="$XLAPACK_LIB -L$BLASDIR -l$BLASLIB"
+- else
+- # Keep looking
+- echo " link failed - cannot use lib$testlib"
+- fi
+- fi
+- fi
+- done
+- done
+- if test ! "$BLASLIB"; then
+- echo "...nothing in $testdir"
+- fi
+- done
+- fi
+- # Do we need to build BLAS too?
+- if test ! "$BLASLIB" ; then
+- echo
+- echo "No pre-existing BLAS library was found - NetLib BLAS will be built instead"
+- echo "This may result in poorer performance of the LAPACK routines"
+- make_blas=blaslib
+- BLASLIB=blas
+- BLASDIR="$srcdir/lib/lapack"
+- BLASEXT="a"
+- fi
+- fi
++ # gentoo is clever
++ make_blas=
++ make_lapack=
++ BLASLIB=$(pkg-config --libs lapack)
++ LAPACKLIB=$(pkg-config --libs lapack)
++ XLAPACK_LIB="${BLASLIB} ${LAPACKLIB}"
++ XFFLAGS_LAPACK="$(pkg-config --cflags lapack blas)"
+ # Otherwise force building of NetLib BLAS and LAPACK libs
+- else
+- echo
+- echo "! Force building of NetLib BLAS and LAPACK..."
+- make_blas=blaslib
+- make_lapack=lapacklib
+- BLASLIB=blas
+- BLASDIR="$srcdir/lib/lapack"
+- BLASEXT="a"
+- fi
+ # need to know if we the lapack library was linked using the C or
+ # fortran linker
+ if test -f testlink.f || test -f testlink || test -f testlink.c ; then
+@@ -3916,8 +3356,8 @@ RANLIB = ${RANLIB}
+ INSTALL_DATA = ${INSTALL_DATA}
+ libdir = $libdir
+ #
+-BLASLIB = lib${BLASLIB}.${BLASEXT}
+-LAPACKLIB = liblapack.a
++BLASLIB = ${BLASLIB}
++LAPACKLIB = ${LAPACKLIB}
+ #
+ # These variables define targets in the main Makefile
+ blaslib = ${make_blas}