octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MSVC patch: CXSparse support for MSVC


From: John W. Eaton
Subject: MSVC patch: CXSparse support for MSVC
Date: Wed, 6 Jun 2007 01:49:50 -0400

On  5-Jun-2007, Michael Goffioul wrote:

| Michael.
| 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 <suitesparse/cs.h>
| + #elif defined (HAVE_UFSPARSE_CS_H)
| + #include <ufsparse/cs.h>
| + #elif defined (HAVE_CXSPARSE_CS_H)
| + #include <cxsparse/cs.h>
| + #elif defined (HAVE_CS_H)
| + #include <cs.h>
| + #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)])

Why would this test be for MSVC only?

| 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)

Octave's configure script has always cheated a bit and used C language
checks and then typically calls functions directly from C++.  A nice
small project for someone would be to determine which checks should
really be done with the C++ compiler and fix configure.in.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]