From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id 2E3F8408B0 for ; Wed, 7 Aug 2002 13:28:31 -0400 (EDT) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id g77HSUA31631 for axp-list@listman.redhat.com; Wed, 7 Aug 2002 13:28:30 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id g77HSTq31626 for ; Wed, 7 Aug 2002 13:28:29 -0400 Received: from zither.mit.edu (ZITHER.MIT.EDU [18.53.0.124]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id g77HFQl10461 for ; Wed, 7 Aug 2002 13:15:26 -0400 Received: from localhost ([127.0.0.1] helo=mit.edu) by zither.mit.edu with esmtp (Exim 3.35 #1 (Debian)) id 17cUbh-0004D3-00; Wed, 07 Aug 2002 13:28:25 -0400 Message-ID: <3D5158B8.4060609@mit.edu> Date: Wed, 07 Aug 2002 13:28:24 -0400 From: Adam C Powell IV Organization: Massachvsetts Institvte of Technology User-Agent: Mozilla/5.0 (X11; U; Linux alpha; en-US; rv:1.0.0) Gecko/20020622 Debian/1.0.0-0.woody.1 X-Accept-Language: en MIME-Version: 1.0 To: Debian Alpha , DDebian Beowulf , axp-list@redhat.com Subject: Math, BLAS/LAPACK m4 checks Content-Type: multipart/mixed; boundary="------------070504040507040403030600" X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: This is a multi-part message in MIME format. --------------070504040507040403030600 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello, Just FYI, here's something which may be useful to authors of autoconf-using math software, with a particular bent to the way BLAS/LAPACK is done on Debian, and attention to Alpha issues such as -mieee and the Q (er, HPaq?) math libs, etc. It's a rough draft of a very small thing, feel free to use and modify, share and enjoy, comment or criticize, etc., and if you have something better, I'd love to hear about it. BTW, I'd like to have my cxml package provide blas2 and/or lapack2, but can't quite figure how to do that. If I make symlinks from /usr/lib/libblas2.so etc. then that's not a problem at build-time, but what about runtime? Do I need to symlink /usr/lib/libblas.so.2 to libcxml.so? In that case, will it conflict with blas and lapack? Zeen, -- -Adam P. GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6 Welcome to the best software in the world today cafe! --------------070504040507040403030600 Content-Type: text/plain; name="math-blaslapack.m4" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="math-blaslapack.m4" dnl Math and linear algebra checks by Adam Powell last modified 2002-08-07. dnl Copyright 2000 Adam Powell, redistributable under the terms of the GNU dnl General Public License version 2 or later. dnl dnl Then again, since none of this is "incorporated" in any software generated dnl except perhaps a configure script, its application to non-GPL-compatible dnl software packages is not clear at this point... in that regard, use at your dnl own risk. AC_DEFUN([MATH_BLASLAPACK_CHECKS],[ dnl ffm is free fast math by Joachim Wesner and Kazushige Goto for dnl Linux/Alpha. AC_CHECK_HEADERS(libffm.h) AC_CHECK_LIB(ffm, dsqrtiv, MATH_LIBS="$MATH_LIBS -lffm" MATH_INCLUDES="-DFFM") dnl Alphas need this sometimes AC_CHECKING([whether -mieee is needed to avoid SIGFPE on divide by zero]) case $build/$CC in alpha*/gcc* ) MIEEE_CFLAGS="-mieee" AC_MSG_RESULT([yes]) ;; * ) MIEEE_CFLAGS="" AC_MSG_RESULT([not needed]) ;; esac AC_SUBST(MIEEE_CFLAGS) dnl Used to check for IRIX multi-processor BLAS, but result was dnl EXTREMELY slow (here just for historical purposes) dnl AC_CHECK_LIB(blas_mp, dgemm_, BLAS_LIBS="-mp -lblas_mp", [ dnl AC_CHECK_LIB(f77blas, dgemm_, BLAS_LIBS="-lf77blas -latlas", [ dnl LIBS="$aLIBS $MATH_LIBS $FLIBS"])]) dnl For some reason, the Debian BLAS/LAPACK maintainer decided blas2 dnl and lapack2 are good names for the alternatives symlinks; I'm dnl prefering those over blas and lapack. For now, I don't see a need dnl for mixed blas/lapack2 or blas2/lapack, only blas2/lapack2 and dnl blas/lapack are checked. AC_F77_LIBRARY_LDFLAGS aLIBS="$LIBS" LIBS="$aLIBS $FLIBS" AC_CHECK_LIB(blas2, dgemm_, [ HAVE_BLAS="yes" LIBS="-lblas2 $aLIBS $FLIBS" AC_CHECK_LIB(lapack2, dgetrf_, HAVE_LAPACK="yes" BLASLAPACK_LIBS="-lblas2 -llapack2 $FLIBS", BLASLAPACK_LIBS="-lblas2 $FLIBS")], [ AC_CHECK_LIB(blas, dgemm_, [ HAVE_BLAS="yes" LIBS="$aLIBS -lblas $FLIBS" AC_CHECK_LIB(lapack, dgetrf_, HAVE_LAPACK="yes" BLASLAPACK_LIBS="-lblas -llapack $FLIBS", BLASLAPACK_LIBS="-lblas $FLIBS")])]) LIBS="$aLIBS" dnl cpml is the Compaq Portable Math Library for Linux/Alpha, and often dnl comes with cxml which has superfast blas/lapack included, so this dnl overrides the above BLAS and LAPACK checks. aLIBS="$LIBS" LIBS="$aLIBS -lots" AC_CHECK_LIB(cpml, sqrt, MATH_LIBS="$MATH_LIBS -lots -lcpml" MATH_INCLUDES="" LIBS="$aLIBS -lots -lcpml" [ AC_CHECK_LIB(cxml, dgemm_, BLASLAPACK_LIBS="$MATH_LIBS -lcxml" HAVE_BLAS="yes" HAVE_LAPACK="yes", MATH_LIBS="$MATH_LIBS -lm" MATH_INCLUDES="")]) LIBS="$aLIBS" AC_SUBST(MATH_LIBS) AC_SUBST(MATH_INCLUDES) AC_SUBST(BLASLAPACK_LIBS) AC_SUBST(HAVE_BLAS) AC_SUBST(HAVE_LAPACK) ]) --------------070504040507040403030600--