[OctDev] Compile failures in octave-forge with CVS octave

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[OctDev] Compile failures in octave-forge with CVS octave

Quentin Spencer
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.


2. main/image/pngread.cc

/usr/include/pngconf.h:307: error: expected constructor, destructor, or
type conversion before ‘.’ token
/usr/include/pngconf.h:308: error: ‘__dont__’ does not name a type
pngread.cc: In function ‘canvas* load_canvas(char*)’:
pngread.cc:156: warning: ignoring return value of ‘size_t fread(void*,
size_t, size_t, FILE*)’, declared with attribute warn_unused_result

I'm not sure what's causing this. I'm using Fedora Core 4, with
libpng-1.2.8-2 installed, and the compiler is gcc 4.0.1.

I have a related question to this. I see that octave-forge now has the
option of using ImageMagick++, but I didn't follow the earlier
discussion about this closely. Is this intended to provide new features
that are unavailable in libjpg and libpng, or does it provide an
alternate way of getting the same features? This will influence whether
I add ImageMagick-c++-devel as a build dependency for the Fedora Extras
octave-forge package.

-Quentin



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev
Reply | Threaded
Open this post in threaded view
|

Re: [OctDev] Compile failures in octave-forge with CVS octave

Dmitri A. Sergatskov
On 11/3/05, Quentin Spencer <[hidden email]> wrote:

> 2. main/image/pngread.cc
>
> /usr/include/pngconf.h:307: error: expected constructor, destructor, or
> type conversion before '.' token
> /usr/include/pngconf.h:308: error: '__dont__' does not name a type
> pngread.cc: In function 'canvas* load_canvas(char*)':
> pngread.cc:156: warning: ignoring return value of 'size_t fread(void*,
> size_t, size_t, FILE*)', declared with attribute warn_unused_result
>
> I'm not sure what's causing this. I'm using Fedora Core 4, with
> libpng-1.2.8-2 installed, and the compiler is gcc 4.0.1.

This is libpng doing. If you look at pngconf.h it has the following:

#ifdef PNG_SETJMP_SUPPORTED
/* This is an attempt to force a single setjmp behaviour on Linux.  If
 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
 */

#  ifdef __linux__
#    ifdef _BSD_SOURCE
#      define PNG_SAVE_BSD_SOURCE
#      undef _BSD_SOURCE
#    endif
#    ifdef _SETJMP_H
     /* If you encounter a compiler error here, see the explanation
      * near the end of INSTALL.
      */
         __png.h__ already includes setjmp.h;
         __dont__ include it again.;
#    endif
#  endif /* __linux__ */

I do not know who this problem should be handled...

> -Quentin
>

Sincerely,

Dmitri.
--


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev
Reply | Threaded
Open this post in threaded view
|

Re: [OctDev] Compile failures in octave-forge with CVS octave

David Bateman-3
In reply to this post by Quentin Spencer
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.

Grrr, that ones mine. It seems to me that a new 2.1.x release of
octave-forge is a reasonable goal as the code in octave-forge is still
compatible with 2.1.x. So I'd like to keep a 2.1.71 (or 2.1.72 if it
comes out) and 2.9.4 (when it comes out) compatible version of the this
change for now. I'd suggest an octave-forge release soon after the next
2.9 and perhaps 2.1 release.

There doesn't seem all that much point to me in completely decrufting
octave-forge at this point as when Soren's package management code is
include in octave, then the whole paradigm of octave-forge will change
and that is the best point to do the decrufting at the time of that
transition...

Regards
David

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



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev
Reply | Threaded
Open this post in threaded view
|

Re: [OctDev] Compile failures in octave-forge with CVS octave

David Bateman-3
In reply to this post by Quentin Spencer
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
  }