comparison m4/acinclude.m4 @ 14144:834df9f10963 stable

remove ARPACK files from sources and restore configure checks for external ARPACK library * libcruft/arpack: Remove directory and all files. * libcruft/Makefile.am: Don't include arpack/module.mk. * m4/acinclude.m4 (OCTAVE_CHECK_ARPACK_OK): New macro. * configure.ac: Check for ARPACK. Use OCTAVE_CHECK_ARPACK_OK to test for known bug. * build-aux/common.mk (ARPACK_CPPFLAGS, ARPACK_LDFLAGS, ARPACK_LIBS): Restore variables. (do_subst_config_vals): Substitute them. * eigs-base.cc: Use HAVE_ARPACK again. * sparse/svds.m: Use "testif HAVE_ARPACK" instead of "test". * DLD-FUNCTIONS/eigs.cc (Feigs): Restore HAVE_ARPACK conditionals. Use "testif HAVE_ARPACK" instead of "test". * toplev.cc (octave_config_info): Restore ARPACK_CPPFLAGS, ARPACK_LDFLAGS, ARPACK_LIBS to the struct. * oct-conf.h.in (OCTAVE_CONF_ARPACK_CPPFLAGS, OCTAVE_CONF_ARPACK_LDFLAGS, OCTAVE_CONF_ARPACK_LIBS): Restore #defines.
author John W. Eaton <jwe@octave.org>
date Tue, 03 Jan 2012 20:12:38 -0500
parents 72c96de7a403
children 71e28fda7be9
comparison
equal deleted inserted replaced
14143:04dcbb8fb880 14144:834df9f10963
1013 else 1013 else
1014 $2 1014 $2
1015 fi 1015 fi
1016 ]) 1016 ])
1017 dnl 1017 dnl
1018 dnl Check whether ARPACK works (does not crash)
1019 dnl
1020 AC_DEFUN([OCTAVE_CHECK_ARPACK_OK], [
1021 AC_LANG_PUSH(Fortran 77)
1022 AC_CACHE_CHECK([whether the arpack library works],
1023 [octave_cv_lib_arpack_ok], [
1024 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
1025 * Based on function EigsRealNonSymmetricMatrix from liboctave/eigs-base.cc.
1026 * Problem matrix. See bug #31479
1027
1028 integer rvec, ido, info, ii, jj
1029 double precision tol, sigmar, sigmai
1030
1031 integer n, k, p, lwork
1032 parameter (n = 4, k = 1, p = 3, lwork = 3*p*(p+2))
1033
1034 integer ip (11)
1035 integer ipntr (14)
1036 integer sel (p)
1037
1038 double precision m (n, n)
1039 double precision resid (4)
1040 double precision v (n*(p+1));
1041 double precision workl (lwork+1)
1042 double precision workd (3*n+1)
1043 * In Octave, the dimensions of dr and di are k+1, but k+2 avoids segfault
1044 double precision dr (k+1)
1045 double precision di (k+1)
1046 double precision workev (3*p)
1047 * In Octave, this is n*(k+1), but k+2 avoids segfault
1048 double precision z (n*(k+1))
1049
1050 do 10 ii = 1, 100
1051
1052 m(1,1) = 1
1053 m(2,1) = 0
1054 m(3,1) = 0
1055 m(4,1) = 0
1056
1057 m(1,2) = 0
1058 m(2,2) = 1
1059 m(3,2) = 0
1060 m(4,2) = 0
1061
1062 m(1,3) = 0
1063 m(2,3) = 0
1064 m(3,3) = 1
1065 m(4,3) = 2
1066
1067 m(1,4) = -1
1068 m(2,4) = 0
1069 m(3,4) = 0
1070 m(4,4) = 1
1071
1072 resid(1) = 0.960966
1073 resid(1) = 0.741195
1074 resid(1) = 0.150143
1075 resid(1) = 0.868067
1076
1077 * ip(1) = ishift
1078 * ip(2) is not referenced
1079 * ip(3) = maximum number of iterations
1080 * ip(4) = NB blocksize in recurrence
1081 * ip(5) = nconv, number of Ritz values that satisfy convergence
1082 * ip(6) is not referenced
1083 * ip(7) = mode
1084 * ip(8) to ip(11) are return values
1085
1086 ip(1) = 1
1087 ip(2) = 0
1088 ip(3) = 300
1089 ip(4) = 1
1090 ip(5) = 0
1091 ip(6) = 0
1092 ip(7) = 1
1093 ip(8) = 0
1094 ip(9) = 0
1095 ip(10) = 0
1096 ip(11) = 0
1097
1098 ido = 0
1099 info = 0
1100 rvec = 1
1101 sigmar = 0
1102 sigmai = 0
1103 tol = 2.0d-15
1104
1105 1 continue
1106
1107 call dnaupd (ido, 'I', n, 'LM', k, tol, resid, p, v, n, ip,
1108 $ ipntr, workd, workl, lwork, info)
1109
1110 if (ido .eq. -1 .or. ido .eq. 1 .or. ido .eq. 2) then
1111 call dgemv ('N', n, n, 1.0, m, n, workd(ipntr(1)),
1112 $ 1, 0.0, workd(ipntr(2)), 1)
1113 goto 1
1114 else if (info .lt. 0) then
1115 * error
1116 goto 9999
1117 endif
1118
1119 do 10 jj = 1, k+1
1120 dr(jj) = 0
1121 di(jj) = 0
1122 10 continue
1123
1124 call dneupd (rvec, "A", sel, dr, di, z, n, sigmar, sigmai,
1125 $ workev,"I", n, "LM", k, tol, resid, p, v, n, ip, ipntr,
1126 $ workd,workl, lwork, info)
1127
1128 100 continue
1129
1130 9999 continue
1131 ]])],
1132 [octave_cv_lib_arpack_ok=yes],
1133 [octave_cv_lib_arpack_ok=no],
1134 [octave_cv_lib_arpack_ok=yes])])
1135 AC_LANG_POP(Fortran 77)
1136 if test "$octave_cv_lib_arpack_ok" = "yes"; then
1137 $1
1138 else
1139 $2
1140 fi
1141 ])
1142 dnl
1018 dnl Check for OpenGL. If found, define OPENGL_LIBS 1143 dnl Check for OpenGL. If found, define OPENGL_LIBS
1019 dnl 1144 dnl
1020 dnl FIXME -- the following tests should probably check for the 1145 dnl FIXME -- the following tests should probably check for the
1021 dnl libraries separately. 1146 dnl libraries separately.
1022 dnl 1147 dnl