Quentin Spencer wrote:
> I tried compiling the cvs version of octave-forge with the cvs version
> of octave, and two functions failed to compile:
>
> 1. main/fixed/fixedNDArray.cc
>
> fixedNDArray.o
> fixedNDArray.cc:407:59: error: macro "MX_ND_REDUCTION" passed 5
> arguments, but takes just 3
> fixedNDArray.cc:421:61: error: macro "MX_ND_REDUCTION" passed 5
> arguments, but takes just 3
> fixedNDArray.cc:436:61: error: macro "MX_ND_REDUCTION" passed 5
> arguments, but takes just 3
>
> This appears to be caused by recent changes to octave. I don't know
> enough about this code to debug it, but from looking at it, it appears
> that this macro has changed periodically in the past and there is
> already some cruft in the code to handle different cases. To whoever
> fixes this I suggest removing the old stuff since we are trying to
> clean up before octave 3.0.
>
Try the attached patch, that I'll commit soon. Yes it adds more cruft,
but we'll get rid of that soon, as I said..
D.
--
David Bateman
[hidden email]
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax)
91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
Nov 4 10:55:03 cvs[24790]: dante/client v1.1.14 running
Nov 4 10:55:03 cvs[24790]: Rgethostbyname2(): 66.35.250.207
Nov 4 10:55:03 cvs[24790]: Rconnect(): 66.35.250.207.2401
Nov 4 10:55:03 cvs[24790]: fakesockaddr2sockshost(): 66.35.250.207.2401 -> 66.35.250.207.2401
Nov 4 10:55:03 cvs[24790]: addressmatch(): address: 0.0.0.0/0, tcp: 0, udp : 0, op: none, end: 0, 0.0.0.0.0, tcp, 0
Nov 4 10:55:03 cvs[24790]: addressmatch(): address: 0.0.0.0/0, tcp: 0, udp : 0, op: none, end: 0, 66.35.250.207.2401, tcp, 0
Nov 4 10:55:03 cvs[24790]: addressmatch(): address: 0.0.0.0/0, tcp: 0, udp : 0, op: none, end: 0, 0.0.0.0.0, tcp, 0
Nov 4 10:55:03 cvs[24790]: addressmatch(): address: 0.0.0.0/0, tcp: 0, udp : 0, op: none, end: 0, 66.35.250.207.2401, tcp, 0
Nov 4 10:55:03 cvs[24790]: socketoptdup(): setsockopt(0, 32): Invalid argument (errno = 22)
Nov 4 10:55:03 cvs[24790]: socketoptdup(): setsockopt(0, 33): Invalid argument (errno = 22)
Nov 4 10:55:03 cvs[24790]: socks_connectroute(): trying route #1 (129.188.33.1.1090)
Nov 4 10:55:03 cvs[24790]: Rconnect(): route = found, errno = 0
Nov 4 10:55:03 cvs[24790]: negotiate_method(): established socks v5 connection using authentication method 2
Nov 4 10:55:03 cvs[24790]: socks_sendrequest(): sending request: VER: 5 CMD: 1 FLAG: 0 ATYP: 1 address: 66.35.250.207.2401
Nov 4 10:55:04 cvs[24790]: socks_recvresponse(): received response: VER: 5 REP: 0 FLAG: 0 ATYP: 1 address: 129.188.33.193.47235
Nov 4 10:55:29 cvs[24790]: Rread()
Nov 4 10:55:29 cvs[24790]: Rrecv()
Nov 4 10:55:29 cvs[24790]: Rrecvmsg()
Nov 4 10:55:29 cvs[24790]: Rread()
Nov 4 10:55:29 cvs[24790]: Rrecv()
Nov 4 10:55:29 cvs[24790]: Rrecvmsg()
Nov 4 10:55:29 cvs[24790]: Rread()
Nov 4 10:55:29 cvs[24790]: Rrecv()
Nov 4 10:55:29 cvs[24790]: Rrecvmsg()
Nov 4 10:55:29 cvs[24790]: Rread()
Nov 4 10:55:29 cvs[24790]: Rrecv()
Nov 4 10:55:29 cvs[24790]: Rrecvmsg()
Nov 4 10:55:29 cvs[24790]: Rread()
Nov 4 10:55:29 cvs[24790]: Rrecv()
Nov 4 10:55:29 cvs[24790]: Rrecvmsg()
Nov 4 10:55:29 cvs[24790]: Rread()
Nov 4 10:55:29 cvs[24790]: Rrecv()
Nov 4 10:55:29 cvs[24790]: Rrecvmsg()
Nov 4 10:55:30 cvs[24790]: Rread()
Nov 4 10:55:30 cvs[24790]: Rrecv()
Nov 4 10:55:30 cvs[24790]: Rrecvmsg()
Nov 4 10:55:30 cvs[24790]: Rread()
Nov 4 10:55:30 cvs[24790]: Rrecv()
Nov 4 10:55:30 cvs[24790]: Rrecvmsg()
? patch
Index: Makeconf.add
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/fixed/Makeconf.add,v
retrieving revision 1.2
diff -c -r1.2 Makeconf.add
*** Makeconf.add 28 Jun 2004 19:35:19 -0000 1.2
--- Makeconf.add 4 Nov 2005 09:55:29 -0000
***************
*** 1,4 ****
HAVE_RESIZE_AND_FILL = @HAVE_RESIZE_AND_FILL@
! HAVE_6ARG_MX_ND_RED = @HAVE_6ARG_MX_ND_RED@
OCTAVEFIXEDVERSION = @OCTAVEFIXEDVERSION@
--- 1,4 ----
HAVE_RESIZE_AND_FILL = @HAVE_RESIZE_AND_FILL@
! MX_ND_RED_NUM = @MX_ND_RED_NUM@
OCTAVEFIXEDVERSION = @OCTAVEFIXEDVERSION@
Index: configure.add
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/fixed/configure.add,v
retrieving revision 1.2
diff -c -r1.2 configure.add
*** configure.add 28 Jun 2004 19:35:19 -0000 1.2
--- configure.add 4 Nov 2005 09:55:29 -0000
***************
*** 39,46 ****
testclass a ( Matrix (1,1,1));
testclass b = a.testfun(0);
}
! ],[HAVE_6ARG_MX_ND_RED="-DHAVE_6ARG_MX_ND_RED"],)
! AC_SUBST(HAVE_6ARG_MX_ND_RED)
dnl version of the fixed point code
OCTAVEFIXEDVERSION="0.7.0"
--- 39,71 ----
testclass a ( Matrix (1,1,1));
testclass b = a.testfun(0);
}
! ],[MX_ND_RED_NUM="-DMX_ND_RED_NUM=6"],
! [TRY_MKOCTFILE([for 5 argument MX_ND_REDUCTION],[
! #include <octave/oct.h>
! #include <octave/ops.h>
! #include <octave/mx-inlines.cc>
! class testclass : public MArrayN<double>
! {
! public:
! testclass (void) : MArrayN<double> () { }
! testclass (const Matrix& a) : MArrayN<double> (a) { }
! testclass testfun (int dim) {
! MX_ND_REDUCTION (acc += elem (iter_idx),
! retval.elem(iter_idx) = acc, 0,
! double acc = 0, testclass);
! }
! static void increment_index (Array<int>& ra_idx,
! const dim_vector& dimensions,
! int start_dimension = 0) {
! ::increment_index (ra_idx, dimensions, start_dimension);
! }
! };
! int main(void) {
! testclass a ( Matrix (1,1,1));
! testclass b = a.testfun(0);
! }
! ],[MX_ND_RED_NUM="-DMX_ND_RED_NUM=5"],[MX_ND_RED_NUM="-DMX_ND_RED_NUM=3"])])
! AC_SUBST(MX_ND_RED_NUM)
dnl version of the fixed point code
OCTAVEFIXEDVERSION="0.7.0"
Index: fixedCNDArray.cc
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/fixed/fixedCNDArray.cc,v
retrieving revision 1.9
diff -c -r1.9 fixedCNDArray.cc
*** fixedCNDArray.cc 12 Oct 2005 15:13:30 -0000 1.9
--- fixedCNDArray.cc 4 Nov 2005 09:55:30 -0000
***************
*** 616,629 ****
FixedComplexNDArray::prod (octave_idx_type dim) const
{
FixedPointComplex one(1, 0, 1, 0);
! #if HAVE_6ARG_MX_ND_RED
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPointComplex acc = one,
FixedComplexNDArray, FixedPointComplex);
! #else
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPointComplex acc = one,
FixedComplexNDArray);
#endif
}
--- 616,632 ----
FixedComplexNDArray::prod (octave_idx_type dim) const
{
FixedPointComplex one(1, 0, 1, 0);
! #if (MX_ND_RED_NUM == 6)
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPointComplex acc = one,
FixedComplexNDArray, FixedPointComplex);
! #elif (MX_ND_RED_NUM == 5)
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPointComplex acc = one,
FixedComplexNDArray);
+ #else
+ MX_ND_REDUCTION (retval(result_idx) *= elem (iter_idx), one,
+ FixedComplexNDArray);
#endif
}
***************
*** 632,645 ****
FixedComplexNDArray::sum (octave_idx_type dim) const
{
FixedPointComplex zero;
! #if HAVE_6ARG_MX_ND_RED
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPointComplex acc = zero,
FixedComplexNDArray, FixedPointComplex);
! #else
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPointComplex acc = zero,
FixedComplexNDArray);
#endif
}
--- 635,651 ----
FixedComplexNDArray::sum (octave_idx_type dim) const
{
FixedPointComplex zero;
! #if (MX_ND_RED_NUM == 6)
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPointComplex acc = zero,
FixedComplexNDArray, FixedPointComplex);
! #elif (MX_ND_RED_NUM == 5)
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPointComplex acc = zero,
FixedComplexNDArray);
+ #else
+ MX_ND_REDUCTION (retval(result_idx) += elem (iter_idx), zero,
+ FixedComplexNDArray);
#endif
}
***************
*** 647,662 ****
FixedComplexNDArray::sumsq (octave_idx_type dim) const
{
FixedPointComplex zero;
! #if HAVE_6ARG_MX_ND_RED
MX_ND_REDUCTION (acc += elem (iter_idx) * conj (elem (iter_idx)),
retval.elem (iter_idx) = acc, zero,
FixedPointComplex acc = zero,
FixedComplexNDArray, FixedPointComplex);
! #else
MX_ND_REDUCTION (acc += elem (iter_idx) * conj (elem (iter_idx)),
retval.elem (iter_idx) = acc, zero,
FixedPointComplex acc = zero,
FixedComplexNDArray);
#endif
}
--- 653,671 ----
FixedComplexNDArray::sumsq (octave_idx_type dim) const
{
FixedPointComplex zero;
! #if (MX_ND_RED_NUM == 6)
MX_ND_REDUCTION (acc += elem (iter_idx) * conj (elem (iter_idx)),
retval.elem (iter_idx) = acc, zero,
FixedPointComplex acc = zero,
FixedComplexNDArray, FixedPointComplex);
! #elif (MX_ND_RED_NUM == 5)
MX_ND_REDUCTION (acc += elem (iter_idx) * conj (elem (iter_idx)),
retval.elem (iter_idx) = acc, zero,
FixedPointComplex acc = zero,
FixedComplexNDArray);
+ #else
+ MX_ND_REDUCTION (retval(result_idx) += elem (iter_idx) *
+ conj (elem (iter_idx)), zero, FixedComplexNDArray);
#endif
}
Index: fixedNDArray.cc
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/fixed/fixedNDArray.cc,v
retrieving revision 1.8
diff -c -r1.8 fixedNDArray.cc
*** fixedNDArray.cc 12 Oct 2005 15:13:30 -0000 1.8
--- fixedNDArray.cc 4 Nov 2005 09:55:30 -0000
***************
*** 399,410 ****
FixedNDArray::prod (octave_idx_type dim) const
{
FixedPoint one(1,0,1,0);
! #if HAVE_6ARG_MX_ND_RED
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPoint acc = one, FixedNDArray, FixedPoint);
! #else
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPoint acc = one, FixedNDArray);
#endif
}
--- 399,412 ----
FixedNDArray::prod (octave_idx_type dim) const
{
FixedPoint one(1,0,1,0);
! #if (MX_ND_RED_NUM == 6)
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPoint acc = one, FixedNDArray, FixedPoint);
! #elif (MX_ND_RED_NUM == 5)
MX_ND_REDUCTION (acc *= elem (iter_idx), retval.elem (iter_idx) = acc,
one, FixedPoint acc = one, FixedNDArray);
+ #else
+ MX_ND_REDUCTION (retval(result_idx) *= elem (iter_idx), one, FixedNDArray);
#endif
}
***************
*** 413,424 ****
FixedNDArray::sum (octave_idx_type dim) const
{
FixedPoint zero;
! #if HAVE_6ARG_MX_ND_RED
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray, FixedPoint);
! #else
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray);
#endif
}
--- 415,428 ----
FixedNDArray::sum (octave_idx_type dim) const
{
FixedPoint zero;
! #if (MX_ND_RED_NUM == 6)
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray, FixedPoint);
! #elif (MX_ND_RED_NUM == 5)
MX_ND_REDUCTION (acc += elem (iter_idx), retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray);
+ #else
+ MX_ND_REDUCTION (retval(result_idx) += elem (iter_idx), zero, FixedNDArray);
#endif
}
***************
*** 426,439 ****
FixedNDArray::sumsq (octave_idx_type dim) const
{
FixedPoint zero;
! #if HAVE_6ARG_MX_ND_RED
MX_ND_REDUCTION (acc += pow (elem (iter_idx), 2),
retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray, FixedPoint);
! #else
MX_ND_REDUCTION (acc += pow (elem (iter_idx), 2),
retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray);
#endif
}
--- 430,446 ----
FixedNDArray::sumsq (octave_idx_type dim) const
{
FixedPoint zero;
! #if (MX_ND_RED_NUM == 6)
MX_ND_REDUCTION (acc += pow (elem (iter_idx), 2),
retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray, FixedPoint);
! #elif (MX_ND_RED_NUM == 5)
MX_ND_REDUCTION (acc += pow (elem (iter_idx), 2),
retval.elem (iter_idx) = acc,
zero, FixedPoint acc = zero, FixedNDArray);
+ #else
+ MX_ND_REDUCTION (retval(result_idx) += pow (elem (iter_idx), 2), zero,
+ FixedNDArray);
#endif
}