bugGNU Octave - Bugs: bug #43646, Build failure with Array.h after...

 
 

bug #43646: Build failure with Array.h after commit 19326:5b263e517c95

Submitter:  Philipp Kutin <pkutin>
Submitted:  Thu 20 Nov 2014 02:26:56 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 22 Nov 2014 06:51:28 PM UTC, comment #8: 

I changed the example in kron.cc to a column vector as well (http://hg.savannah.gnu.org/hgweb/octave/rev/718aaf1e84f7).

Rik <rik5>
Group administrator
Sat 22 Nov 2014 01:28:35 PM UTC, comment #7: 

Rik, I saw you transposing the 'dim_vector's. This either 1) doesn't change the meaning or 2) makes it correct (as jwe said, the old constructor did a column "dimensions" vector), but note that I merely followed the example of cset 1f4455ff2329 -- in other words, my fix was "by analogy". Right now, kron.cc still has


  Array<octave_idx_type> res_perm (dim_vector (1, na * nb));


so you might want to change that, too.

Philipp Kutin <pkutin>
Fri 21 Nov 2014 06:03:35 PM UTC, comment #6: 

Yeah, I saw that too.  It didn't seem to make a difference, i.e., 'make check' passed.  But I agree it's probably a better idea to keep everything exactly the same.  I'll swap them around.

Rik <rik5>
Group administrator
Fri 21 Nov 2014 05:46:08 PM UTC, comment #5: 

I haven't looked closely, so maybe it doesn't matter, but the changeset http://hg.savannah.gnu.org/hgweb/octave/rev/d47e50953abc replaces the Array<> (n) constructor with Array<> (dim_vector (1, n)), but the deprecated code that was removed had Array<> (n) : dimensions (n, 1) so it seems to me that the orientation has been switched.

John W. Eaton <jwe>
Group administrator
Fri 21 Nov 2014 05:12:18 PM UTC, comment #4: 

You found the problem.  It is the alternate routines used when qrupdate isn't available that have the issue.  I just added '--without-qrupdate' and I now get the same error.

I modified your commit message to reference the functions within each file that were changed and what was done to them, and then checked it in here (http://hg.savannah.gnu.org/hgweb/octave/rev/d47e50953abc).

Thanks for discovering and solving this bug.  Closing report.

Rik <rik5>
Group administrator
Fri 21 Nov 2014 11:03:00 AM UTC, comment #3: 

By the way, here's how I configure Octave. Maybe the liboctave/numeric/*QR.cc are built only without 'qrupdate'?


../configure \
    --disable-docs \
    --without-qrupdate \
    --without-glpk \
    --disable-java \
    --disable-gui \
    --disable-jit \
    --enable-silent-rules \
    --enable-strict-warnings


Philipp Kutin <pkutin>
Fri 21 Nov 2014 10:51:23 AM UTC, comment #2: 

No, not for me. I have badly worded my initial report. What doesn't work is not including Array.h per se, but attempts to construct an Array<octave_idx_type> like these (where 'n' has type 'octave_idx_type'):


Array<octave_idx_type> p (n);


Changing these to


Array<octave_idx_type> p (dim_vector (1, n));


in the four remaining places (liboctave/numeric/{CmpplxQR,dbleQR,fCmplxQR,floatQR}.cc) analogously to the fix in libinterp/corefcn/kron.cc of cset 1f4455ff2329 makes everything build again.

Here's an example error message from G++. (The first report was with Clang simply because I wanted the colorful error message highlighting.)


../../liboctave/numeric/CmplxQR.cc: In function 'ComplexMatrix shift_cols(const ComplexMatrix&, octave_idx_type, octave_idx_type)':
../../liboctave/numeric/CmplxQR.cc:552:30: error: no matching function for call to 'Array<int>::Array(octave_idx_type&)'
   Array<octave_idx_type> p (n);
                              ^
../../liboctave/numeric/CmplxQR.cc:552:30: note: candidates are:
In file included from ../../liboctave/array/MArray.h:28:0,
                 from ../../liboctave/array/CMatrix.h:26,
                 from ../../liboctave/numeric/CmplxQR.h:29,
                 from ../../liboctave/numeric/CmplxQR.cc:29:
../../liboctave/array/Array.h:212:3: note: Array<T>::Array(const Array<T>&) [with T = int]
   Array (const Array<T>& a)
   ^
../../liboctave/array/Array.h:212:3: note:   no known conversion for argument 1 from 'octave_idx_type {aka int}' to 'const Array<int>&'
../../liboctave/array/Array.h:205:3: note: template<class U> Array<T>::Array(const Array<U>&)
   Array (const Array<U>& a)
   ^
../../liboctave/array/Array.h:205:3: note:   template argument deduction/substitution failed:
../../liboctave/numeric/CmplxQR.cc:552:30: note:   mismatched types 'const Array<T>' and 'octave_idx_type {aka int}'
   Array<octave_idx_type> p (n);
                              ^
In file included from ../../liboctave/array/MArray.h:28:0,
                 from ../../liboctave/array/CMatrix.h:26,
                 from ../../liboctave/numeric/CmplxQR.h:29,
                 from ../../liboctave/numeric/CmplxQR.cc:29:
../../liboctave/array/Array.h:201:3: note: Array<T>::Array(const Array<T>&, const dim_vector&) [with T = int]
   Array (const Array<T>& a, const dim_vector& dv);
   ^
../../liboctave/array/Array.h:201:3: note:   candidate expects 2 arguments, 1 provided
../../liboctave/array/Array.h:191:12: note: Array<T>::Array(const dim_vector&, const T&) [with T = int]
   explicit Array (const dim_vector& dv, const T& val)
            ^
../../liboctave/array/Array.h:191:12: note:   candidate expects 2 arguments, 1 provided
../../liboctave/array/Array.h:182:12: note: Array<T>::Array(const dim_vector&) [with T = int]
   explicit Array (const dim_vector& dv)
            ^
../../liboctave/array/Array.h:182:12: note:   no known conversion for argument 1 from 'octave_idx_type {aka int}' to 'const dim_vector&'
../../liboctave/array/Array.h:174:3: note: Array<T>::Array() [with T = int]
   Array (void)
   ^
../../liboctave/array/Array.h:174:3: note:   candidate expects 0 arguments, 1 provided
../../liboctave/array/Array.h:166:3: note: Array<T>::Array(T*, octave_idx_type, octave_idx_type*, void*) [with T = int; octave_idx_type = int]
   Array (T *sdata, octave_idx_type slen, octave_idx_type *adims, void *arep)
   ^
../../liboctave/array/Array.h:166:3: note:   candidate expects 4 arguments, 1 provided
../../liboctave/array/Array.h:143:3: note: Array<T>::Array(const Array<T>&, const dim_vector&, octave_idx_type, octave_idx_type) [with T = int; octave_idx_type = int]
   Array (const Array<T>& a, const dim_vector& dv,
   ^
../../liboctave/array/Array.h:143:3: note:   candidate expects 4 arguments, 1 provided


A patch that fixes it for me is attached.

I didn't know about 'make maintainer-clean' and have previously used a simple 'make clean'. Thanks for the information.

(file #32495)

Philipp Kutin <pkutin>
Thu 20 Nov 2014 03:52:45 PM UTC, comment #1: 

The cset 1f4455ff2329 fixed the building of the default branch.  You might want to start over with


make maintainer-clean
./bootstrap
./configure --ANY_OPTIONS_YOU_USE
make


This might also be particular to Clang.  Most of the developers are using gcc.

Rik <rik5>
Group administrator
Thu 20 Nov 2014 02:26:56 PM UTC, original submission:  

After the following commit,


changeset:   19326:5b263e517c95
user:        CarnĂ« Draug <carandraug@octave.org>
date:        Mon Nov 10 12:37:04 2014 +0000
summary:     Remove liboctave methods and classes deprecated for longer than 3 years.


source files including Array.h fail to be compiled. Here's an example output with Clang.


../../liboctave/numeric/CmplxQR.cc:552:26: error: no matching constructor for initialization of
      'Array<octave_idx_type>'
  Array<octave_idx_type> p (n);
                         ^  ~
../../liboctave/array/Array.h:182:12: note: candidate constructor not viable: no known conversion from
      'octave_idx_type' (aka 'int') to 'const dim_vector' for 1st argument
  explicit Array (const dim_vector& dv)
           ^
../../liboctave/array/Array.h:212:3: note: candidate constructor not viable: no known conversion from
      'octave_idx_type' (aka 'int') to 'const Array<int>' for 1st argument
  Array (const Array<T>& a)
  ^
../../liboctave/array/Array.h:205:3: note: candidate template ignored: could not match
      'Array<type-parameter-0-0>' against 'int'
  Array (const Array<U>& a)
  ^
../../liboctave/array/Array.h:143:3: note: candidate constructor not viable: requires 4 arguments, but 1 was
      provided
  Array (const Array<T>& a, const dim_vector& dv,
  ^
../../liboctave/array/Array.h:166:3: note: candidate constructor not viable: requires 4 arguments, but 1 was
      provided
  Array (T *sdata, octave_idx_type slen, octave_idx_type *adims, void *arep)
  ^
../../liboctave/array/Array.h:174:3: note: candidate constructor not viable: requires 0 arguments, but 1 was
      provided
  Array (void)
  ^
../../liboctave/array/Array.h:191:12: note: candidate constructor not viable: requires 2 arguments, but 1 was
      provided
  explicit Array (const dim_vector& dv, const T& val)
           ^
../../liboctave/array/Array.h:201:3: note: candidate constructor not viable: requires 2 arguments, but 1 was
      provided
  Array (const Array<T>& a, const dim_vector& dv);
  ^


Resurrecting the two Array ctors marked GCC_ATTR_DEPRECATED fixes it (haven't checked which).

The revision is 19334:1213af866a89, plus my patches on top.

Philipp Kutin <pkutin>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pkutin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-21 rik5 StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2014-11-21 pkutin Attached File- Added fix-compilation-QR-cc_bug43646.patch, #32495
    2014-11-20 rik5 StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code