Changeset 1914


Ignore:
Timestamp:
Apr 24, 2009, 7:52:09 PM (12 years ago)
Author:
Peter
Message:

Using ACX_BLAS macro for blas detection. The behavior will likely be a
bit different from before. The major difference is that there are no
-m64 flags in the atlas tests, which implies you might need to add
-m64 to LDFLAGS (and possibly CXXFLAGS) at configure time. It also
implies that you might detect atlas on your 32bit machine, which
previously was not possible. fixes #349

There is a new configure option: '--with-blas' that can be used to
specify which blas should be used. fixes #524

refs #518

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/build_support/yat-config.in

    r1898 r1914  
    4040
    4141if test "x$YAT_CBLAS_LIB" = "x"; then
    42   YAT_CBLAS_LIB=@YAT_CBLAS_LIB@
     42  YAT_CBLAS_LIB="@YAT_CBLAS_LIB@"
    4343fi
    4444
  • trunk/configure.ac

    r1897 r1914  
    125125AC_MSG_NOTICE([checking for libraries])
    126126AC_CHECK_LIBM
    127 AS_IF([test "x$LIBM" != x], [LIBS="$LIBM $LIBS"])
    128 # searching for cblas. Priority 1) find a cblas library, 2) find ATLAS
    129 # generated cblas, and 3) fall back to GSL cblas implementation. If
    130 # partial ATLAS is detected the configure script fails.
    131 cblas_found="no"  # cblas_found may get values yes or no
    132 # atlas_found may get values yes, no, or partial. In some cases
    133 # partial atlas may be installed
    134 atlas_found="no"
    135 gslcblas_found="no" # gslcblas_found may get values yes or no
    136 AC_SEARCH_LIBS(cblas_sdsdot,cblas,cblas_found="yes",
    137   AC_SEARCH_LIBS(ATL_sdsdot,atlas,
    138     AC_SEARCH_LIBS(cblas_sdsdot,cblas,atlas_found="yes",
    139                    atlas_found="partial",-m64),
    140       AC_SEARCH_LIBS(cblas_dswap,gslcblas,gslcblas_found="yes"),-m64),)
    141 
    142 YAT_CBLAS_LIB=-lgslcblas
    143 if test ${cblas_found} = "yes"; then
    144   YAT_CBLAS_LIB=-lcblas
    145 fi
    146 if test ${atlas_found} = "yes"; then
    147   YAT_CXX_ADD_FLAG([CXXFLAGS], [-m64])
    148   YAT_LD_ADD_FLAG([LDFLAGS], [-m64])
    149   YAT_CBLAS_LIB=-latlas
    150 fi
    151 # used in test of gsl
    152 export GSL_CBLAS_LIB=${YAT_CBLAS_LIB}
    153 AC_SUBST(YAT_CBLAS_LIB)
    154 
     127
     128ACX_BLAS([YAT_CBLAS_LIB=$BLAS_LIBS], [YAT_CBLAS_LIB=-lgslcblas])
    155129
    156130# GNU Scientific Library, GSL http://www.gnu.org/software/gsl/, checks
     
    158132gsl_version="1.8"
    159133AC_SUBST(gsl_version)
    160 # sets variable $yat_gsl_status to one of the following
    161 #   "ok" - everything is fine
    162 #   "no" - no gsl found
    163 #   "no-header" - gsl library found but no header files
    164 #   "old" - gsl older than $gsl_version found
    165 YAT_CHECK_GSL([$gsl_version])
     134gsl_ok=yes
     135YAT_CHECK_GSL([$gsl_version],[gsl_ok=yes])
    166136
    167137# Boost http://www.boost.org
     
    368338
    369339# Non-existing GSL is fatal -- sub-sequent compilation will fail.
    370 if test "x$yat_gsl_status" != "xok" ; then
    371   all_reqs_ok="false"
    372   AS_CASE([$yat_gsl_status],
    373           [old],
    374           [AC_MSG_WARN([
    375   GSL found but not the required version. Please install
    376   GSL version ${gsl_version} or later])
    377           ],
    378           [no-header],
    379           [AC_MSG_WARN([
    380   GSL header files not found. The GNU Scientific Library (GSL)
    381   header files cannot be found. Please make sure GSL header
    382   files are installed.])
    383           ],
    384           [AC_MSG_WARN([
    385   GSL not found. The GNU Scientific Library (GSL) library cannot be
    386   found. Please make sure GSL is installed.])
    387           ])
     340if test "x$gsl_ok" != "xyes" ; then
     341  all_reqs_ok="false"
     342  AC_MSG_WARN([
     343              GSL $gsl_version (or newer) not found. The GNU
     344              Scientific Library (GSL) library cannot be found. Please
     345              make sure GSL is installed. Please refer to warnings
     346              above for more details
     347              ])
    388348fi
    389349
     
    408368APR_RESTORE_THE_ENVIRONMENT(CXXFLAGS, YAT_)
    409369APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, YAT_)
    410 APR_RESTORE_THE_ENVIRONMENT(LIBS, YAT_PRIMARY_)
    411 
    412 # remove cblas and m
    413 APR_REMOVEFROM([YAT_PRIMARY_LIBS], [$YAT_CBLAS_LIB])
    414 APR_REMOVEFROM([YAT_PRIMARY_LIBS], [$LIBM])
    415 
     370
     371YAT_PRIMARY_LIBS=-lgsl
    416372YAT_LIBS="$YAT_PRIMARY_LIBS $YAT_CBLAS_LIB $LIBM"
     373AC_SUBST(YAT_PRIMARY_LIBS)
    417374AC_SUBST(YAT_LIBS)
     375AC_SUBST(YAT_CBLAS_LIB)
    418376
    419377# set and AC_SUBST variables that are interpreted by Automake
  • trunk/m4/yat_gsl.m4

    r1895 r1914  
    3838        ])
    3939
    40   # check if failure was due to too old gsl
    41   AS_IF([test "x$yat_gsl_status" = "xno" && \
    42          test -f "$GSL_CONFIG" && $GSL_CONFIG --help >/dev/null 2>&1],
    43         [yat_gsl_status="old"
    44         ])
    45      
    46   # if everything is fine, append to gsl variables to LIBS and friends
    4740  AS_IF([test "x$yat_gsl_status" = "xok"],
    48         [LIBS="-lgsl $LIBS"
    49          # grep words starting with '-L' in other words LDFLAGS
     41        [# grep words startinging with '-L' in other words LDFLAGS
    5042         for i in $GSL_LIBS; do
    5143           AS_IF([test ${i:0:2} = "-L"],
    5244                 [YAT_LD_ADD_FLAG([LDFLAGS], [$i])])
    53          done
     45         done         
    5446        ])
     47
     48
    5549
    5650]) # YAT_CHECK_GSL
Note: See TracChangeset for help on using the changeset viewer.