Index: aclocal.m4 =================================================================== RCS file: /cvs/octave/aclocal.m4,v retrieving revision 1.104 diff -c -p -r1.104 aclocal.m4 *** aclocal.m4 7 Feb 2007 09:01:24 -0000 1.104 --- aclocal.m4 5 Jun 2007 14:48:47 -0000 *************** AC_DEFUN([OCTAVE_HDF5_DLL], [ *** 1005,1007 **** --- 1005,1031 ---- if test "$octave_cv_hdf5_dll" = yes; then AC_DEFINE(_HDF5USEDLL_, 1, [Define if using HDF5 dll (Win32)]) fi]) + dnl + dnl Check whether using CXSparse in C++ form (MSVC only) + dnl + AC_DEFUN([OCTAVE_CXSPARSE_CXX], [ + AC_MSG_CHECKING([if using C++ version of CXSparse]) + LIBS_old=$LIBS + LIBS="$LIBS -lcxsparse" + AC_TRY_LINK([ + #if defined (HAVE_SUITESPARSE_CS_H) + #include + #elif defined (HAVE_UFSPARSE_CS_H) + #include + #elif defined (HAVE_CXSPARSE_CS_H) + #include + #elif defined (HAVE_CS_H) + #include + #endif], [ + cs_dis *c = cs_di_sqr(0, (const cs_di*)NULL, 0); + return c->pinv[0];], [ + with_cxsparse=yes + CXSPARSE_LIBS=-lcxsparse + AC_DEFINE(HAVE_CXSPARSE_CXX, 1, [Define if using C++ version of CXSparse])]) + LIBS=$LIBS_old + AC_MSG_RESULT($with_cxsparse)]) Index: configure.in =================================================================== RCS file: /cvs/octave/configure.in,v retrieving revision 1.563 diff -c -p -r1.563 configure.in *** configure.in 3 Jun 2007 20:58:28 -0000 1.563 --- configure.in 5 Jun 2007 14:48:50 -0000 *************** AC_ARG_WITH(cxsparse, *** 995,1007 **** --- 995,1012 ---- warn_cxsparse="CXSparse not found. This will result in some lack of functionality for sparse matrices." if test "$with_cxsparse" = yes; then with_cxsparse=no + AC_LANG_PUSH(C++) AC_CHECK_HEADERS([suitesparse/cs.h ufsparse/cs.h cxsparse/cs.h cs.h], [ AC_CHECK_LIB(cxsparse, cs_di_sqr, [CXSPARSE_LIBS="-lcxsparse"; with_cxsparse=yes]) + if test "$with_cxsparse" = no; then + OCTAVE_CXSPARSE_CXX + fi if test "$with_cxsparse" = yes; then AC_DEFINE(HAVE_CXSPARSE, 1, [Define if the CXSparse library is used.]) warn_cxsparse= fi break]) + AC_LANG_POP(C++) fi if test -n "$warn_cxsparse"; then AC_MSG_WARN($warn_cxsparse) Index: liboctave/SparseCmplxQR.cc =================================================================== RCS file: /cvs/octave/liboctave/SparseCmplxQR.cc,v retrieving revision 1.9 diff -c -p -r1.9 SparseCmplxQR.cc *** liboctave/SparseCmplxQR.cc 2 Jun 2007 11:39:42 -0000 1.9 --- liboctave/SparseCmplxQR.cc 5 Jun 2007 14:48:52 -0000 *************** typedef double _Complex cs_complex_t; *** 37,49 **** OCTAVE_LOCAL_BUFFER (double, buf ## tmp, (2 * (n))); \ cs_complex_t *buf = reinterpret_cast (buf ## tmp); #else #define OCTAVE_C99_COMPLEX(buf, n) \ OCTAVE_LOCAL_BUFFER (cs_complex_t, buf, (n)); #endif - #define OCTAVE_C99_ZERO (0. + 0.iF) - SparseComplexQR::SparseComplexQR_rep::SparseComplexQR_rep (GCC_ATTR_UNUSED const SparseComplexMatrix& a, GCC_ATTR_UNUSED int order) { --- 37,49 ---- OCTAVE_LOCAL_BUFFER (double, buf ## tmp, (2 * (n))); \ cs_complex_t *buf = reinterpret_cast (buf ## tmp); + #define OCTAVE_C99_ZERO (0. + 0.iF); #else #define OCTAVE_C99_COMPLEX(buf, n) \ OCTAVE_LOCAL_BUFFER (cs_complex_t, buf, (n)); + #define OCTAVE_C99_ZERO cs_complex_t(0., 0.); #endif SparseComplexQR::SparseComplexQR_rep::SparseComplexQR_rep (GCC_ATTR_UNUSED const SparseComplexMatrix& a, GCC_ATTR_UNUSED int order) {