Changeset 226


Ignore:
Timestamp:
Feb 27, 2007 12:24:41 PM (14 years ago)
Author:
andreasw
Message:

fixed BLAS and LAPACK test. Also make it so that ThirdParty? code is not compiled if otherwise available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r209 r226  
    1 # Copyright (C) 2006 International Business Machines..
     1# Copyright (C) 2006, 2007 International Business Machines..
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    18901890# things (such as generating links to data files in a VPATH configuration).
    18911891# It also prints the "success" message.
     1892# Note: If the variable coin_skip_ac_output is set to yes, then no output
     1893# files are written.
    18921894
    18931895AC_DEFUN([AC_COIN_FINALIZE],
    18941896[
    1895 FADDLIBS="$ADDLIBS"
    1896 if test x"$coin_need_flibs" = xyes; then
    1897   ADDLIBS="$ADDLIBS $FLIBS"
    1898 fi
    1899 
    1900 # library extension
    1901 AC_SUBST(LIBEXT)
    1902 case "$CC" in
    1903   cl* | */cl* | CL* | */CL*)
    1904        LIBEXT=lib ;;
    1905     *) LIBEXT=a ;;
    1906 esac
    1907 
    1908 # Define VPATH_DISTCLEANFILES to be everything that needs to be
    1909 # cleaned for distclean in a vpath configuration
    1910 AC_SUBST(VPATH_DISTCLEANFILES)
    1911 VPATH_DISTCLEANFILES="$coin_vpath_link_files"
    1912 
    1913 AC_OUTPUT
    1914 
    1915 if test x"$coin_vpath_link_files" = x; then : ; else
    1916   lnkcmd=
    1917   if test "$enable_doscompile" = yes; then
    1918     lnkcmd=cp
    1919   fi
     1897if test x$coin_skip_ac_output != xyes; then
     1898
     1899  FADDLIBS="$ADDLIBS"
     1900  if test x"$coin_need_flibs" = xyes; then
     1901    ADDLIBS="$ADDLIBS $FLIBS"
     1902  fi
     1903
     1904  # library extension
     1905  AC_SUBST(LIBEXT)
    19201906  case "$CC" in
    19211907    cl* | */cl* | CL* | */CL*)
    1922       lnkcmd=cp ;;
     1908         LIBEXT=lib ;;
     1909      *) LIBEXT=a ;;
    19231910  esac
    1924   if test "$lnkcmd" = cp; then
    1925     AC_MSG_NOTICE(Copying data files for VPATH configuration)
     1911
     1912  # Define VPATH_DISTCLEANFILES to be everything that needs to be
     1913  # cleaned for distclean in a vpath configuration
     1914  AC_SUBST(VPATH_DISTCLEANFILES)
     1915  VPATH_DISTCLEANFILES="$coin_vpath_link_files"
     1916
     1917  # Take out subdirectories if their configuration concluded that they
     1918  # don't need to be compiled
     1919  if test x"$coin_ac_skip_subdirs" != x; then
     1920    new_subdirs=
     1921    for i in $subdirs; do
     1922      skipme=no
     1923      for j in $coin_ac_skip_subdirs; do
     1924        if test $i = $j; then
     1925          skipme=yes;
     1926        fi
     1927      done
     1928      if test $skipme = no; then
     1929        new_subdirs="$new_subdirs $i"
     1930      fi
     1931    done
     1932    subdirs="$new_subdirs"
     1933  fi
     1934
     1935  AC_OUTPUT
     1936
     1937  if test x"$coin_vpath_link_files" = x; then : ; else
     1938    lnkcmd=
     1939    if test "$enable_doscompile" = yes; then
     1940      lnkcmd=cp
     1941    fi
     1942    case "$CC" in
     1943      cl* | */cl* | CL* | */CL*)
     1944        lnkcmd=cp ;;
     1945    esac
     1946    if test "$lnkcmd" = cp; then
     1947      AC_MSG_NOTICE(Copying data files for VPATH configuration)
     1948    else
     1949      AC_PROG_LN_S
     1950      AC_MSG_NOTICE(Creating VPATH links for data files)
     1951      lnkcmd="$LN_S"
     1952    fi
     1953    for file in $coin_vpath_link_files; do
     1954      dir=`AS_DIRNAME(["./$file"])`
     1955      if test -d $dir; then : ; else
     1956        AS_MKDIR_P($dir)
     1957      fi
     1958      rm -f $file
     1959      $lnkcmd $abs_source_dir/$file $file
     1960    done
     1961  fi
     1962
     1963  if test x$coin_projectdir = xyes; then
     1964    AC_MSG_NOTICE([Configuration of $PACKAGE_NAME successful])
    19261965  else
    1927     AC_PROG_LN_S
    1928     AC_MSG_NOTICE(Creating VPATH links for data files)
    1929     lnkcmd="$LN_S"
    1930   fi
    1931   for file in $coin_vpath_link_files; do
    1932     dir=`AS_DIRNAME(["./$file"])`
    1933     if test -d $dir; then : ; else
    1934       AS_MKDIR_P($dir)
    1935     fi
    1936     rm -f $file
    1937     $lnkcmd $abs_source_dir/$file $file
    1938   done
    1939 fi
    1940 
    1941 if test x$coin_projectdir = xyes; then
    1942   AC_MSG_NOTICE([Configuration of $PACKAGE_NAME successful])
     1966    AC_MSG_NOTICE([Main configuration of $PACKAGE_NAME successful])
     1967  fi
    19431968else
    1944   AC_MSG_NOTICE([Main configuration of $PACKAGE_NAME successful])
    1945 fi
     1969  AC_MSG_NOTICE([No configuration of $PACKAGE_NAME necessary])
     1970fi
     1971
    19461972]) #AC_COIN_FINALIZE
    19471973
     
    23572383
    23582384if test "$use_asldir" = BUILD; then
    2359   AC_CHECK_FILE([$coin_aslobjdir/Makefile],[],
    2360                 [AC_MSG_ERROR([option \"BUILD\" specified for asldir, but directory is not configure (sources missing?)])])
     2385  if test "$PACKAGE_NAME" != ThirdPartyASL; then
     2386    # If we are configuring ThirdParty/ASL, don't check
     2387    AC_CHECK_FILE([$coin_aslobjdir/.MakeOk],[],
     2388                  [AC_MSG_ERROR([option \"BUILD\" specified for asldir, but directory is not configure (sources missing?)])])
     2389  fi
    23612390elif test -z "$use_asldir"; then
    23622391 # try to find sources - if not given don't compile
    2363   AC_CHECK_FILE([$coin_aslobjdir/Makefile],[use_asldir=BUILD],[use_asldir=no])
     2392  if test "$PACKAGE_NAME" != ThirdPartyASL; then
     2393    AC_CHECK_FILE([$coin_aslobjdir/.MakeOk],[use_asldir=BUILD],[use_asldir=no])
     2394  else
     2395    use_asldir=no
     2396  fi
    23642397elif test "$use_asldir" != "no"; then
    23652398  AC_CHECK_FILE([$use_asldir/$ampllib],[],
     
    24912524            [use_blas=$withval], [use_blas=])
    24922525
     2526MAKEOKFILE=.MakeOk
    24932527# Check if user supplied option makes sense
    24942528if test x"$use_blas" != x; then
    24952529  if test "$use_blas" = "BUILD"; then
    2496     AC_CHECK_FILE([$coin_blasobjdir/Makefile],[],
    2497                   [AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not configured])])
     2530    # Don't check for course code if this is executed in ThirdParty/Blas
     2531    if test "$PACKAGE_NAME" != ThirdPartyBlas; then
     2532      AC_CHECK_FILE([$coin_blasobjdir/.MakeOk],[],
     2533                    [AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not properly configured])])
     2534    fi
    24982535  elif test "$use_blas" != no ; then
    24992536    AC_MSG_CHECKING([whether user supplied BLASLIB=\"$use_blas\" works])
     
    25072544else
    25082545# Try to autodetect the library for blas based on build system
    2509   AC_MSG_CHECKING([default locations for BLAS])
     2546  #AC_MSG_CHECKING([default locations for BLAS])
     2547  skip_lblas_check=no
    25102548  case $build in
    25112549    *-sgi-*)
     
    25352573    *-cygwin*)
    25362574      if test "$enable_doscompile" = no; then
    2537         if test -z "$use_blas"; then
    2538           SAVE_LIBS="$LIBS"
    2539           AC_MSG_CHECKING([whether -lblas has BLAS])
    2540           LIBS="-lblas $LIBS"
    2541           AC_COIN_TRY_FLINK([daxpy],
    2542                             [AC_MSG_RESULT([yes])
    2543                              ADDLIBS="-lblas $ADDLIBS"
    2544                              use_blas='-lblas'],
    2545                             [AC_MSG_RESULT([no])
    2546                              LIBS="$SAVE_LIBS"])
    2547         fi
     2575        skip_lblas_check=yes
    25482576      fi
    25492577      ;;
    2550     esac
     2578  esac
     2579
     2580  if test -z "$use_blas" && test $skip_lblas_check = no; then
     2581    SAVE_LIBS="$LIBS"
     2582    AC_MSG_CHECKING([whether -lblas has BLAS])
     2583    LIBS="-lblas $LIBS"
     2584    AC_COIN_TRY_FLINK([daxpy],
     2585                      [AC_MSG_RESULT([yes])
     2586                       ADDLIBS="-lblas $ADDLIBS"
     2587                       use_blas='-lblas'],
     2588                      [AC_MSG_RESULT([no])
     2589                       LIBS="$SAVE_LIBS"])
     2590  fi
    25512591
    25522592# If we have no other ideas, consider building BLAS.
    25532593  if test -z "$use_blas"; then
    2554     AC_MSG_CHECKING([if BLAS can be built.])
    2555     AC_CHECK_FILE([$coin_blasobjdir/Makefile],[use_blas=BUILD])
     2594    if test "$PACKAGE_NAME" != ThirdPartyBlas; then
     2595      AC_MSG_CHECKING([if BLAS can be built.])
     2596      AC_CHECK_FILE([$coin_blasobjdir/.MakeOk],[use_blas=BUILD])
     2597    fi
    25562598  fi
    25572599fi
     
    25982640if test x"$use_lapack" != x; then
    25992641  if test "$use_lapack" = "BUILD"; then
    2600     AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[],
    2601                   [AC_MSG_ERROR([option \"BUILD\" specified for LAPACK, but $coin_lapackobjdir directory is not configured])])
     2642    # Don't check for course code if this is executed in ThirdParty/Blas
     2643    if test "$PACKAGE_NAME" != ThirdPartyLapack; then
     2644      AC_CHECK_FILE([$coin_lapackobjdir/.MakeOk],[],
     2645                    [AC_MSG_ERROR([option \"BUILD\" specified for LAPACK, but $coin_lapackobjdir directory is not configured])])
     2646    fi
    26022647  else
    26032648    AC_MSG_CHECKING([whether user supplied LAPACKLIB=\"$use_lapack\" works])
     
    26172662                      [AC_MSG_RESULT([no])])
    26182663  fi
     2664  skip_llapack_check=no
    26192665  if test -z "$use_lapack"; then
    26202666    # Try to autodetect the library for lapack based on build system
     
    26462692      *-cygwin*)
    26472693        if test "$enable_doscompile" = no; then
    2648           if test -z "$use_lapack"; then
    2649             SAVE_LIBS="$LIBS"
    2650             AC_MSG_CHECKING([whether -llapack has LAPACK])
    2651             LIBS="-llapack $LIBS"
    2652             AC_COIN_TRY_FLINK([dsyev],
    2653                               [AC_MSG_RESULT([yes])
    2654                                ADDLIBS="-llapack $ADDLIBS"
    2655                                use_lapack='-llapack'],
    2656                               [AC_MSG_RESULT([no])
    2657                                LIBS="$SAVE_LIBS"])
    2658           fi
     2694          skip_llapack_check=yes
    26592695        fi
    26602696        ;;
    26612697    esac
    26622698  fi
     2699
     2700  if test -z "$use_lapack" && test $skip_llapack_check = no; then
     2701    SAVE_LIBS="$LIBS"
     2702    AC_MSG_CHECKING([whether -llapack has LAPACK])
     2703    LIBS="-llapack $LIBS"
     2704    AC_COIN_TRY_FLINK([dsyev],
     2705                      [AC_MSG_RESULT([yes])
     2706                       ADDLIBS="-llapack $ADDLIBS"
     2707                       use_lapack='-llapack'],
     2708                      [AC_MSG_RESULT([no])
     2709                       LIBS="$SAVE_LIBS"])
     2710  fi
     2711
    26632712# If we have no other ideas, consider building LAPACK.
    26642713  if test -z "$use_lapack"; then
    2665     AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[use_lapack=BUILD])
     2714    if test "$PACKAGE_NAME" != ThirdPartyLapack; then
     2715      AC_CHECK_FILE([$coin_lapackobjdir/.MakeOk],[use_lapack=BUILD])
     2716    fi
    26662717  fi
    26672718fi
Note: See TracChangeset for help on using the changeset viewer.