Changeset 466


Ignore:
Timestamp:
Aug 19, 2005 11:02:19 AM (14 years ago)
Author:
andreasw
Message:

corrections for BLAS tests

Location:
branches/dev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/configure

    r465 r466  
    94579457    LIBS="$use_blas $LIBS"
    94589458    IPADDLIBS="$use_blas $IPADDLIBS"
     9459    # Probably the blas library requires the Fortran libraries, so add
     9460    # them for this test.  They are added at the end anyway
     9461    SAVE_LIBS="$LIBS"
     9462    LIBS="$LIBS $FLIBS"
     9463    ac_ext=f
     9464ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     9465ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     9466ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     9467case $ac_cv_f77_mangling in
     9468  upper*) ac_val="DAXPY" ;;
     9469  lower*) ac_val="daxpy" ;;
     9470  *)      ac_val="unknown" ;;
     9471esac
     9472case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
     9473
     9474cfunc="$ac_val"
     9475
     9476ac_ext=cc
     9477ac_cpp='$CXXCPP $CPPFLAGS'
     9478ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     9479ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     9480ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     9481
    94599482    cat >conftest.$ac_ext <<_ACEOF
    94609483/* confdefs.h.  */
     
    94639486cat >>conftest.$ac_ext <<_ACEOF
    94649487/* end confdefs.h.  */
    9465 
     9488extern "C" {void $cfunc();}
    94669489#ifdef F77_DUMMY_MAIN
    94679490
     
    94759498main ()
    94769499{
    9477       call dgemm
     9500$cfunc()
    94789501  ;
    94799502  return 0;
     
    95099532
    95109533echo "$as_me:$LINENO: result: no" >&5
    9511 echo "${ECHO_T}no" >&6; { { echo "$as_me:$LINENO: error: user supplied BLAS library \"$use_blas\" does not work" >&5
     9534echo "${ECHO_T}no" >&6
     9535                 { { echo "$as_me:$LINENO: error: user supplied BLAS library \"$use_blas\" does not work" >&5
    95129536echo "$as_me: error: user supplied BLAS library \"$use_blas\" does not work" >&2;}
    95139537   { (exit 1); exit 1; }; }
     
    95159539rm -f conftest.err conftest.$ac_objext \
    95169540      conftest$ac_exeext conftest.$ac_ext
     9541    LIBS="$SAVE_LIBS"
    95179542  fi
    95189543else
    95199544# Try to autodetect the library for blas based on build system
    95209545  case $build in
    9521     *-sgi-*)   echo "$as_me:$LINENO: checking for dgemm in -lcomplib.sgimath" >&5
    9522 echo $ECHO_N "checking for dgemm in -lcomplib.sgimath... $ECHO_C" >&6
    9523 if test "${ac_cv_lib_complib_sgimath_dgemm+set}" = set; then
     9546    *-sgi-*) ac_ext=f
     9547ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     9548ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     9549ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     9550case $ac_cv_f77_mangling in
     9551  upper*) ac_val="DAXPY" ;;
     9552  lower*) ac_val="daxpy" ;;
     9553  *)      ac_val="unknown" ;;
     9554esac
     9555case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
     9556
     9557cfunc="$ac_val"
     9558
     9559ac_ext=cc
     9560ac_cpp='$CXXCPP $CPPFLAGS'
     9561ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     9562ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     9563ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     9564
     9565             as_ac_Lib=`echo "ac_cv_lib_complib.sgimath_$cfunc" | $as_tr_sh`
     9566echo "$as_me:$LINENO: checking for $cfunc in -lcomplib.sgimath" >&5
     9567echo $ECHO_N "checking for $cfunc in -lcomplib.sgimath... $ECHO_C" >&6
     9568if eval "test \"\${$as_ac_Lib+set}\" = set"; then
    95249569  echo $ECHO_N "(cached) $ECHO_C" >&6
    95259570else
     
    95399584/* We use char because int might match the return type of a gcc2
    95409585   builtin and then its argument prototype would still apply.  */
    9541 char dgemm ();
     9586char $cfunc ();
    95429587#ifdef F77_DUMMY_MAIN
    95439588
     
    95519596main ()
    95529597{
    9553 dgemm ();
     9598$cfunc ();
    95549599  ;
    95559600  return 0;
     
    95789623  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    95799624  (exit $ac_status); }; }; then
    9580   ac_cv_lib_complib_sgimath_dgemm=yes
     9625  eval "$as_ac_Lib=yes"
    95819626else
    95829627  echo "$as_me: failed program was:" >&5
    95839628sed 's/^/| /' conftest.$ac_ext >&5
    95849629
    9585 ac_cv_lib_complib_sgimath_dgemm=no
     9630eval "$as_ac_Lib=no"
    95869631fi
    95879632rm -f conftest.err conftest.$ac_objext \
     
    95899634LIBS=$ac_check_lib_save_LIBS
    95909635fi
    9591 echo "$as_me:$LINENO: result: $ac_cv_lib_complib_sgimath_dgemm" >&5
    9592 echo "${ECHO_T}$ac_cv_lib_complib_sgimath_dgemm" >&6
    9593 if test $ac_cv_lib_complib_sgimath_dgemm = yes; then
     9636echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
     9637echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
     9638if test `eval echo '${'$as_ac_Lib'}'` = yes; then
    95949639  use_blas=-lcomplib.sgimath;
    95959640                           LIBS="-lcomplib.sgimath $LIBS";
    95969641                           IPADDLIBS="-lcomplib.sgimath $IPADDLIBS"
    95979642fi
    9598 ;;
     9643
     9644             ;;
    95999645    *-sun-*) SAVE_LDFLAGS="$LDFLAGS"
    96009646             echo "$as_me:$LINENO: checking whether -xlic_lib=sunperf has BLAS" >&5
    96019647echo $ECHO_N "checking whether -xlic_lib=sunperf has BLAS... $ECHO_C" >&6
    96029648             LDFLAGS="-xlic_lib=sunperf $LDFLAGS"
     9649             ac_ext=f
     9650ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     9651ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     9652ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     9653case $ac_cv_f77_mangling in
     9654  upper*) ac_val="DAXPY" ;;
     9655  lower*) ac_val="daxpy" ;;
     9656  *)      ac_val="unknown" ;;
     9657esac
     9658case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
     9659
     9660cfunc="$ac_val"
     9661
     9662ac_ext=cc
     9663ac_cpp='$CXXCPP $CPPFLAGS'
     9664ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     9665ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     9666ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     9667
    96039668             cat >conftest.$ac_ext <<_ACEOF
    96049669/* confdefs.h.  */
     
    96079672cat >>conftest.$ac_ext <<_ACEOF
    96089673/* end confdefs.h.  */
    9609 
     9674extern "C" {void $cfunc();}
    96109675#ifdef F77_DUMMY_MAIN
    96119676
     
    96199684main ()
    96209685{
    9621       call dgemm
     9686$cfunc()
    96229687  ;
    96239688  return 0;
     
    96569721fi
    96579722rm -f conftest.err conftest.$ac_objext \
    9658       conftest$ac_exeext conftest.$ac_ext ;;
     9723      conftest$ac_exeext conftest.$ac_ext
     9724             ;;
    96599725  esac
    96609726  if test -z "$use_blas"; then
  • branches/dev/configure.ac

    r465 r466  
    865865    LIBS="$use_blas $LIBS"
    866866    IPADDLIBS="$use_blas $IPADDLIBS"
    867     AC_TRY_LINK([],[      call dgemm],[AC_MSG_RESULT([yes])],
    868                 [AC_MSG_RESULT([no]); AC_MSG_ERROR([user supplied BLAS library \"$use_blas\" does not work])])
     867    # Probably the blas library requires the Fortran libraries, so add
     868    # them for this test.  They are added at the end anyway
     869    SAVE_LIBS="$LIBS"
     870    LIBS="$LIBS $FLIBS"
     871    AC_F77_FUNC(daxpy,cfunc)
     872    AC_TRY_LINK([extern "C" {void $cfunc();}],[$cfunc()],
     873                [AC_MSG_RESULT([yes])],
     874                [AC_MSG_RESULT([no])
     875                 AC_MSG_ERROR([user supplied BLAS library \"$use_blas\" does not work])])
     876    LIBS="$SAVE_LIBS"
    869877  fi
    870878else
    871879# Try to autodetect the library for blas based on build system
    872880  case $build in
    873     *-sgi-*)   AC_CHECK_LIB([complib.sgimath],[dgemm],
     881    *-sgi-*) AC_F77_FUNC(daxpy,cfunc)
     882             AC_CHECK_LIB([complib.sgimath],[$cfunc],
    874883                          [use_blas=-lcomplib.sgimath;
    875884                           LIBS="-lcomplib.sgimath $LIBS";
    876                            IPADDLIBS="-lcomplib.sgimath $IPADDLIBS"]);;
     885                           IPADDLIBS="-lcomplib.sgimath $IPADDLIBS"])
     886             ;;
    877887    *-sun-*) SAVE_LDFLAGS="$LDFLAGS"
    878888             AC_MSG_CHECKING([whether -xlic_lib=sunperf has BLAS])
    879889             LDFLAGS="-xlic_lib=sunperf $LDFLAGS"
    880              AC_TRY_LINK([],[      call dgemm],
     890             AC_F77_FUNC(daxpy,cfunc)
     891             AC_TRY_LINK([extern "C" {void $cfunc();}],[$cfunc()],
    881892                         [AC_MSG_RESULT([yes]); use_blas=-xlic_lib=sunperf],
    882                          [AC_MSG_RESULT([no]); LDFLAGS="$SAVE_LDFLAGS"]) ;;
     893                         [AC_MSG_RESULT([no]); LDFLAGS="$SAVE_LDFLAGS"])
     894             ;;
    883895  esac
    884896  if test -z "$use_blas"; then
Note: See TracChangeset for help on using the changeset viewer.