- Timestamp:
- Mar 26, 2007 4:21:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/0.5/coin.m4
r242 r264 1 # Copyright (C) 2006 International Business Machines..1 # Copyright (C) 2006, 2007 International Business Machines.. 2 2 # All Rights Reserved. 3 3 # This file is distributed under the Common Public License. … … 1331 1331 coin_f77_comps="ifort fl32" 1332 1332 else 1333 coin_f77_comps="gfortran g77 ifortfl32"1333 coin_f77_comps="gfortran ifort g77 fl32" 1334 1334 fi ;; 1335 1335 sparc-sun-solaris*) … … 1778 1778 1779 1779 case $build in 1780 *x86_64-*) 1781 # Here we need to check if -m32 is specified. If so, we need to correct sys_lib_search_path_spec 1782 if test "$GCC" = yes && (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm32' >& /dev/null); then 1783 AC_MSG_NOTICE(Applying patches to libtool for 32bit compilation) 1784 sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="/lib /usr/lib"|' libtool > conftest.bla 1785 mv conftest.bla libtool 1786 chmod 755 libtool 1787 fi 1788 ;; 1780 1789 *-cygwin* | *-mingw*) 1781 1790 case "$CXX" in … … 1883 1892 # things (such as generating links to data files in a VPATH configuration). 1884 1893 # It also prints the "success" message. 1894 # Note: If the variable coin_skip_ac_output is set to yes, then no output 1895 # files are written. 1885 1896 1886 1897 AC_DEFUN([AC_COIN_FINALIZE], 1887 1898 [ 1888 FADDLIBS="$ADDLIBS" 1889 if test x"$coin_need_flibs" = xyes; then 1890 ADDLIBS="$ADDLIBS $FLIBS" 1891 fi 1892 1893 # library extension 1894 AC_SUBST(LIBEXT) 1895 case "$CC" in 1896 cl* | */cl* | CL* | */CL*) 1897 LIBEXT=lib ;; 1898 *) LIBEXT=a ;; 1899 esac 1900 1901 # Define VPATH_DISTCLEANFILES to be everything that needs to be 1902 # cleaned for distclean in a vpath configuration 1903 AC_SUBST(VPATH_DISTCLEANFILES) 1904 VPATH_DISTCLEANFILES="$coin_vpath_link_files" 1905 1906 AC_OUTPUT 1907 1908 if test x"$coin_vpath_link_files" = x; then : ; else 1909 lnkcmd= 1910 if test "$enable_doscompile" = yes; then 1911 lnkcmd=cp 1912 fi 1899 if test x$coin_skip_ac_output != xyes; then 1900 1901 FADDLIBS="$ADDLIBS" 1902 if test x"$coin_need_flibs" = xyes; then 1903 ADDLIBS="$ADDLIBS $FLIBS" 1904 fi 1905 1906 # library extension 1907 AC_SUBST(LIBEXT) 1913 1908 case "$CC" in 1914 1909 cl* | */cl* | CL* | */CL*) 1915 lnkcmd=cp ;; 1910 LIBEXT=lib ;; 1911 *) LIBEXT=a ;; 1916 1912 esac 1917 if test "$lnkcmd" = cp; then 1918 AC_MSG_NOTICE(Copying data files for VPATH configuration) 1913 1914 # Define VPATH_DISTCLEANFILES to be everything that needs to be 1915 # cleaned for distclean in a vpath configuration 1916 AC_SUBST(VPATH_DISTCLEANFILES) 1917 VPATH_DISTCLEANFILES="$coin_vpath_link_files" 1918 1919 # Take out subdirectories if their configuration concluded that they 1920 # don't need to be compiled 1921 if test x"$coin_ac_skip_subdirs" != x; then 1922 new_subdirs= 1923 for i in $subdirs; do 1924 skipme=no 1925 for j in $coin_ac_skip_subdirs; do 1926 if test $i = $j; then 1927 skipme=yes; 1928 fi 1929 done 1930 if test $skipme = no; then 1931 new_subdirs="$new_subdirs $i" 1932 fi 1933 done 1934 subdirs="$new_subdirs" 1935 fi 1936 1937 AC_OUTPUT 1938 1939 if test x"$coin_vpath_link_files" = x; then : ; else 1940 lnkcmd= 1941 if test "$enable_doscompile" = yes; then 1942 lnkcmd=cp 1943 fi 1944 case "$CC" in 1945 cl* | */cl* | CL* | */CL*) 1946 lnkcmd=cp ;; 1947 esac 1948 if test "$lnkcmd" = cp; then 1949 AC_MSG_NOTICE(Copying data files for VPATH configuration) 1950 else 1951 AC_PROG_LN_S 1952 AC_MSG_NOTICE(Creating VPATH links for data files) 1953 lnkcmd="$LN_S" 1954 fi 1955 for file in $coin_vpath_link_files; do 1956 dir=`AS_DIRNAME(["./$file"])` 1957 if test -d $dir; then : ; else 1958 AS_MKDIR_P($dir) 1959 fi 1960 rm -f $file 1961 $lnkcmd $abs_source_dir/$file $file 1962 done 1963 fi 1964 1965 if test x$coin_projectdir = xyes; then 1966 AC_MSG_NOTICE([Configuration of $PACKAGE_NAME successful]) 1919 1967 else 1920 AC_PROG_LN_S 1921 AC_MSG_NOTICE(Creating VPATH links for data files) 1922 lnkcmd="$LN_S" 1923 fi 1924 for file in $coin_vpath_link_files; do 1925 dir=`AS_DIRNAME(["./$file"])` 1926 if test -d $dir; then : ; else 1927 AS_MKDIR_P($dir) 1928 fi 1929 rm -f $file 1930 $lnkcmd $abs_source_dir/$file $file 1931 done 1932 fi 1933 1934 if test x$coin_projectdir = xyes; then 1935 AC_MSG_NOTICE([Configuration of $PACKAGE_NAME successful]) 1968 AC_MSG_NOTICE([Main configuration of $PACKAGE_NAME successful]) 1969 fi 1936 1970 else 1937 AC_MSG_NOTICE([Main configuration of $PACKAGE_NAME successful]) 1938 fi 1971 AC_MSG_NOTICE([No configuration of $PACKAGE_NAME necessary]) 1972 fi 1973 1939 1974 ]) #AC_COIN_FINALIZE 1940 1975 … … 2350 2385 2351 2386 if test "$use_asldir" = BUILD; then 2352 AC_CHECK_FILE([$coin_aslobjdir/Makefile],[], 2353 [AC_MSG_ERROR([option \"BUILD\" specified for asldir, but directory is not configure (sources missing?)])]) 2387 if test "$PACKAGE_NAME" != ThirdPartyASL; then 2388 # If we are configuring ThirdParty/ASL, don't check 2389 if test -r $coin_aslobjdir/.MakeOk; then :; else 2390 AC_MSG_ERROR([option \"BUILD\" specified for asldir, but directory is not configure (sources missing?)]) 2391 fi 2392 fi 2354 2393 elif test -z "$use_asldir"; then 2355 2394 # try to find sources - if not given don't compile 2356 AC_CHECK_FILE([$coin_aslobjdir/Makefile],[use_asldir=BUILD],[use_asldir=no]) 2395 if test "$PACKAGE_NAME" != ThirdPartyASL; then 2396 if test -r $coin_aslobjdir/.MakeOk; then 2397 use_asldir=BUILD 2398 else 2399 use_asldir=no 2400 fi 2401 else 2402 use_asldir=no 2403 fi 2357 2404 elif test "$use_asldir" != "no"; then 2358 2405 AC_CHECK_FILE([$use_asldir/$ampllib],[], … … 2476 2523 2477 2524 AC_DEFUN([AC_COIN_HAS_BLAS], 2478 [coin_blasobjdir=../ThirdParty/Blas 2525 [if test "$PACKAGE_NAME" = ThirdPartyBlas || test "$PACKAGE_NAME" = ThirdPartyLapack; then 2526 coin_blasobjdir=../Blas 2527 else 2528 coin_blasobjdir=../ThirdParty/Blas 2529 fi 2479 2530 coin_blassrcdir=$srcdir/$coin_blasobjdir 2480 2531 … … 2484 2535 [use_blas=$withval], [use_blas=]) 2485 2536 2537 MAKEOKFILE=.MakeOk 2486 2538 # Check if user supplied option makes sense 2487 2539 if test x"$use_blas" != x; then 2488 2540 if test "$use_blas" = "BUILD"; then 2489 AC_CHECK_FILE([$coin_blasobjdir/Makefile],[], 2490 [AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not configured])]) 2541 # Don't check for course code if this is executed in ThirdParty/Blas 2542 if test "$PACKAGE_NAME" != ThirdPartyBlas; then 2543 if test -r $coin_blasobjdir/.MakeOk; then :; else 2544 AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not properly configured]) 2545 fi 2546 fi 2491 2547 elif test "$use_blas" != no ; then 2492 2548 AC_MSG_CHECKING([whether user supplied BLASLIB=\"$use_blas\" works]) … … 2500 2556 else 2501 2557 # Try to autodetect the library for blas based on build system 2502 AC_MSG_CHECKING([default locations for BLAS]) 2558 #AC_MSG_CHECKING([default locations for BLAS]) 2559 skip_lblas_check=no 2503 2560 case $build in 2504 2561 *-sgi-*) … … 2527 2584 # library will want to link with cygwin, hence won't run standalone in DOS. 2528 2585 *-cygwin*) 2529 if test "$enable_doscompile" = no; then 2530 if test -z "$use_blas"; then 2531 SAVE_LIBS="$LIBS" 2532 AC_MSG_CHECKING([whether -lblas has BLAS]) 2533 LIBS="-lblas $LIBS" 2534 AC_COIN_TRY_FLINK([daxpy], 2535 [AC_MSG_RESULT([yes]) 2536 ADDLIBS="-lblas $ADDLIBS" 2537 use_blas='-lblas'], 2538 [AC_MSG_RESULT([no]) 2539 LIBS="$SAVE_LIBS"]) 2540 fi 2586 if test "$enable_doscompile" = mingw; then 2587 skip_lblas_check=yes 2541 2588 fi 2542 2589 ;; 2543 esac 2590 esac 2591 2592 if test -z "$use_blas" && test $skip_lblas_check = no; then 2593 SAVE_LIBS="$LIBS" 2594 AC_MSG_CHECKING([whether -lblas has BLAS]) 2595 LIBS="-lblas $LIBS" 2596 AC_COIN_TRY_FLINK([daxpy], 2597 [AC_MSG_RESULT([yes]) 2598 ADDLIBS="-lblas $ADDLIBS" 2599 use_blas='-lblas'], 2600 [AC_MSG_RESULT([no]) 2601 LIBS="$SAVE_LIBS"]) 2602 fi 2544 2603 2545 2604 # If we have no other ideas, consider building BLAS. 2546 2605 if test -z "$use_blas"; then 2547 AC_MSG_CHECKING([if BLAS can be built.]) 2548 AC_CHECK_FILE([$coin_blasobjdir/Makefile],[use_blas=BUILD]) 2606 if test "$PACKAGE_NAME" != ThirdPartyBlas; then 2607 if test -r $coin_blasobjdir/.MakeOk; then 2608 use_blas=BUILD 2609 fi 2610 fi 2549 2611 fi 2550 2612 fi … … 2591 2653 if test x"$use_lapack" != x; then 2592 2654 if test "$use_lapack" = "BUILD"; then 2593 AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[], 2594 [AC_MSG_ERROR([option \"BUILD\" specified for LAPACK, but $coin_lapackobjdir directory is not configured])]) 2655 # Don't check for course code if this is executed in ThirdParty/Blas 2656 if test "$PACKAGE_NAME" != ThirdPartyLapack; then 2657 if test -r $coin_lapackobjdir/.MakeOk; then :; else 2658 AC_MSG_ERROR([option \"BUILD\" specified for LAPACK, but $coin_lapackobjdir directory is not configured]) 2659 fi 2660 fi 2595 2661 else 2596 2662 AC_MSG_CHECKING([whether user supplied LAPACKLIB=\"$use_lapack\" works]) … … 2610 2676 [AC_MSG_RESULT([no])]) 2611 2677 fi 2678 skip_llapack_check=no 2612 2679 if test -z "$use_lapack"; then 2613 2680 # Try to autodetect the library for lapack based on build system … … 2638 2705 # will want to link with cygwin, hence won't run standalone in DOS. 2639 2706 *-cygwin*) 2640 if test "$enable_doscompile" = no; then 2641 if test -z "$use_lapack"; then 2642 SAVE_LIBS="$LIBS" 2643 AC_MSG_CHECKING([whether -llapack has LAPACK]) 2644 LIBS="-llapack $LIBS" 2645 AC_COIN_TRY_FLINK([dsyev], 2646 [AC_MSG_RESULT([yes]) 2647 ADDLIBS="-llapack $ADDLIBS" 2648 use_lapack='-llapack'], 2649 [AC_MSG_RESULT([no]) 2650 LIBS="$SAVE_LIBS"]) 2651 fi 2707 if test "$enable_doscompile" = mingw; then 2708 skip_llapack_check=yes 2652 2709 fi 2653 2710 ;; 2654 2711 esac 2655 2712 fi 2713 2714 if test -z "$use_lapack" && test $skip_llapack_check = no; then 2715 SAVE_LIBS="$LIBS" 2716 AC_MSG_CHECKING([whether -llapack has LAPACK]) 2717 LIBS="-llapack $LIBS" 2718 AC_COIN_TRY_FLINK([dsyev], 2719 [AC_MSG_RESULT([yes]) 2720 ADDLIBS="-llapack $ADDLIBS" 2721 use_lapack='-llapack'], 2722 [AC_MSG_RESULT([no]) 2723 LIBS="$SAVE_LIBS"]) 2724 fi 2725 2656 2726 # If we have no other ideas, consider building LAPACK. 2657 2727 if test -z "$use_lapack"; then 2658 AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[use_lapack=BUILD]) 2728 if test "$PACKAGE_NAME" != ThirdPartyLapack; then 2729 if test -r $coin_lapackobjdir/.MakeOk; then 2730 use_lapack=BUILD 2731 fi 2732 fi 2659 2733 fi 2660 2734 fi … … 2675 2749 fi 2676 2750 ]) # AC_COIN_HAS_LAPACK 2751 2752 ########################################################################### 2753 # COIN_HAS_MUMPS # 2754 ########################################################################### 2755 2756 # This macro checks for a library containing the MUMPS library. It 2757 # checks if the user has provided an argument for the MUMPS library, 2758 # and if not, it checks whether the MUMPS ThirdParty/Mumps directory has 2759 # been configured. It adds to ADDLIBS any flags required to link with 2760 # an externally provided MUMPS. It defines the makefile conditional 2761 # and preprocessor macro COIN_HAS_MUMPS, if MUMPS is available, and it 2762 # defines the makefile conditional COIN_BUILD_MUMPS, if MUMPS is 2763 # compiled within COIN. 2764 2765 AC_DEFUN([AC_COIN_HAS_MUMPS], 2766 [ 2767 if test "$PACKAGE_NAME" = ThirdPartyMumps; then 2768 coin_mumpsobjdir=../Mumps 2769 else 2770 coin_mumpsobjdir=../ThirdParty/Mumps 2771 fi 2772 coin_mumpssrcdir=$abs_source_dir/$coin_mumpsobjdir 2773 2774 mumps_ver=4.6.4 2775 2776 MAKEOKFILE=.MakeOk 2777 2778 AC_ARG_WITH([mumps-dir], 2779 AC_HELP_STRING([--with-mumps-dir], 2780 [specify directory where MUMPS is installed]), 2781 [use_mumps="$withval"], [use_mumps=no]) 2782 2783 if test "$use_mumps" != "no"; then 2784 if test -d $use_mumps; then :; else 2785 AC_MSG_ERROR([User provided MUMPS directory $use_mumps does not exist.]) 2786 fi 2787 mumps_dir=`cd $use_mumps; pwd` 2788 2789 # library extension 2790 AC_LANG_PUSH(C) 2791 save_LIBS="$LIBS" 2792 LIBS="$LIBS $FLIBS" 2793 AC_CHECK_LIB([pthread],[pthread_create],[LIBS="-lpthread $save_LIBS"; ADDLIBS="-lpthread $ADDLIBS"],[LIBS="$save_LIBS"]) 2794 AC_LANG_POP(C) 2795 2796 case "$CC" in 2797 cl* | */cl* | CL* | */CL*) 2798 libe=lib ;; 2799 *) libe=a ;; 2800 esac 2801 2802 # Check if hearders are there 2803 AC_CHECK_FILE([$mumps_dir/include/dmumps_c.h], 2804 [], 2805 [AC_MSG_ERROR([I cannot find headers for MUMPS])]) 2806 LIBS="$mumps_dir/lib/libdmumps.$libe $mumps_dir/lib/libpord.$libe $mumps_dir/libseq/libmpiseq.$libe $LIBS" 2807 ADDLIBS="$mumps_dir/lib/libdmumps.$libe $mumps_dir/lib/libpord.$libe $mumps_dir/libseq/libmpiseq.$libe $ADDLIBS" 2808 # Check if MUMPS actually works 2809 AC_LANG_PUSH(C) 2810 save_LIBS="$LIBS" 2811 LIBS="$LIBS $FLIBS" 2812 AC_TRY_LINK([void dmumps_c();],[dmumps_c()],[], 2813 [AC_MSG_ERROR([User provided MUMPS library doesn't work])]) 2814 LIBS="$save_LIBS" 2815 AC_LANG_POP(C) 2816 2817 else 2818 use_mumps=BUILD 2819 2820 # Check if the MUMPS' ThirdParty project has been configured 2821 if test "$PACKAGE_NAME" != ThirdPartyMumps; then 2822 if test -r $coin_mumpsobjdir/.MakeOk; then 2823 use_mumps=BUILD 2824 # Mumps needs pthreads 2825 AC_LANG_PUSH(C) 2826 save_LIBS="$LIBS" 2827 LIBS="$LIBS $FLIBS" 2828 AC_CHECK_LIB([pthread],[pthread_create],[LIBS="-lpthread $save_LIBS"; ADDLIBS="-lpthread $ADDLIBS"],[LIBS="save_LIBS"]) 2829 AC_LANG_POP(C) 2830 else 2831 use_mumps= 2832 fi 2833 fi 2834 fi 2835 2836 if test x"$use_mumps" != x; then 2837 2838 # and we need the Fortran runtime libraries if we want to link with C/C++ 2839 coin_need_flibs=yes 2840 2841 MUMPS_INCFLAGS="-I`$CYGPATH_W $coin_mumpssrcdir/MUMPS_${mumps_ver}/libseq` -I`$CYGPATH_W $coin_mumpssrcdir/MUMPS_${mumps_ver}/include`" 2842 AC_SUBST(MUMPS_INCFLAGS) 2843 fi 2844 2845 AM_CONDITIONAL([COIN_HAS_MUMPS],[test x"$use_mumps" != x]) 2846 AM_CONDITIONAL([COIN_BUILD_MUMPS],[test "$use_mumps" = BUILD]) 2847 2848 if test x"$use_mumps" = x || test "$use_mumps" = no; then 2849 coin_has_mumps=no 2850 else 2851 coin_has_mumps=yes 2852 AC_DEFINE([COIN_HAS_MUMPS],[1], 2853 [If defined, the MUMPS Library is available.]) 2854 fi 2855 ]) # AC_COIN_HAS_MUMPS 2856
Note: See TracChangeset
for help on using the changeset viewer.