octave-3.0.2: compilation error csparse.cc
Jaroslav Hajek
highegg at gmail.com
Fri Oct 10 09:51:02 CDT 2008
On Fri, Oct 10, 2008 at 4:18 AM, JuergenNeubauer
<jneubauer at mednet.ucla.edu> wrote:
>
> Hi,
>
> I get an error during compilation of octave-3.0.2.
>
> Architecture: Linux localhost.localdomain 2.6.18-92.1.13.el5 #1 SMP Wed Sep
> 24 16:44:34 EDT 2008 i686 i686 i386 GNU/Linux
>
> gcc: version 4.1.2
> g++: version 4.1.2
>
> make[2]: Entering directory `/opt/octave/octave-3.0.2/liboctave'
> g++ -c -I/usr/include/suitesparse -fPIC -I. -I.. -I../liboctave -I../src
> -I../libcruft/misc -DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow
> -Wold-style-cast -g -O2 CSparse.cc -o pic/CSparse.o
> CSparse.cc: In member function 'ComplexMatrix
> SparseComplexMatrix::fsolve(MatrixType&, const Matrix&, octave_idx_type&,
> double&, void (*)(double), bool) const':
> CSparse.cc:5769: error: invalid conversion from 'void (*)(int, char*, int,
> char*)' to 'void (*)(int, const char*, int, const char*)'
> CSparse.cc: In member function 'SparseComplexMatrix
> SparseComplexMatrix::fsolve(MatrixType&, const SparseMatrix&,
> octave_idx_type&, double&, void (*)(double), bool) const':
> CSparse.cc:6012: error: invalid conversion from 'void (*)(int, char*, int,
> char*)' to 'void (*)(int, const char*, int, const char*)'
> CSparse.cc: In member function 'ComplexMatrix
> SparseComplexMatrix::fsolve(MatrixType&, const ComplexMatrix&,
> octave_idx_type&, double&, void (*)(double), bool) const':
> CSparse.cc:6303: error: invalid conversion from 'void (*)(int, char*, int,
> char*)' to 'void (*)(int, const char*, int, const char*)'
> CSparse.cc: In member function 'SparseComplexMatrix
> SparseComplexMatrix::fsolve(MatrixType&, const SparseComplexMatrix&,
> octave_idx_type&, double&, void (*)(double), bool) const':
> CSparse.cc:6525: error: invalid conversion from 'void (*)(int, char*, int,
> char*)' to 'void (*)(int, const char*, int, const char*)'
> make[2]: *** [pic/CSparse.o] Error 1
> make[2]: Leaving directory `/opt/octave/octave-3.0.2/liboctave'
> make[1]: *** [liboctave] Error 2
> make[1]: Leaving directory `/opt/octave/octave-3.0.2'
> make: *** [all] Error 2
>
> I attached the config.log here:
> http://www.nabble.com/file/p19910718/config.log config.log
>
> I need help to resolve this issue. Please let me know if you need more
> information.
>
> Thanks for your help and advice.
>
> Ciao, Juergen
> --
Apparently there has been a subtle API change in SuiteSparse between
3.1 and 3.2. I believe the attached patch should solve the problem. I
pushed this to the development sources; if nobody reports a compiler
choking on this (IMHO it's standard C++, but a subtle issue), I'll
transplant this into 3-0-x, so that it will appear in 3.0.4.
regards
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
# HG changeset patch
# User Jaroslav Hajek <highegg at gmail.com>
# Date 1223649861 -7200
# Node ID 60b4c75287a13ed3a16e414c466802c2549ba93c
# Parent 0168d22e6bba2c24342079e49cc65a9a3afef693
fix for SuiteSparse 3.2
diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -0,0 +1,6 @@
+2008-10-10 Jaroslav Hajek <highegg at gmail.com>
+
+ * sparse-util.h (SparseCholPrint): Change char * argument to const
+ char *.
+ * sparse-util.cc (SparseCholPrint): Likewise.
+
diff --git a/liboctave/sparse-util.cc b/liboctave/sparse-util.cc
--- a/liboctave/sparse-util.cc
+++ b/liboctave/sparse-util.cc
@@ -30,8 +30,15 @@
#include "lo-error.h"
#include "sparse-util.h"
+// FIXME this overload is here due to API change in SuiteSparse (3.1 -> 3.2)
void
SparseCholError (int status, char *file, int line, char *message)
+{
+ SparseCholError (status, file, line, message);
+}
+
+void
+SparseCholError (int status, const char *file, int line, const char *message)
{
(*current_liboctave_warning_handler)("warning %i, at line %i in file %s",
status, line, file);
diff --git a/liboctave/sparse-util.h b/liboctave/sparse-util.h
--- a/liboctave/sparse-util.h
+++ b/liboctave/sparse-util.h
@@ -24,7 +24,11 @@
#if !defined (octave_sparse_util_h)
#define octave_sparse_util_h 1
-extern OCTAVE_API void SparseCholError (int status, char *file, int
line, char *message);
+// FIXME this overload is here due to API change in SuiteSparse (3.1 -> 3.2)
+extern OCTAVE_API void SparseCholError (int status, char *file,
+ int line, char *message);
+extern OCTAVE_API void SparseCholError (int status, const char *file,
+ int line, const char *message);
extern OCTAVE_API int SparseCholPrint (const char *fmt, ...);
#endif
More information about the Bug-octave
mailing list