Compiling software packages utilizing port math/jama with CLANG (3.2/3.3) results in the error shown below. This error seems to be well known since 2011 (see for instance http://sourceforge.net/p/pymol/bugs/100/). [...] In file included from ForstnerOperator.cpp:7: In file included from /usr/local/include/tnt/jama_lu.h:4: In file included from /usr/local/include/tnt/tnt.h:55: /usr/local/include/tnt/tnt_sparse_matrix_csr.h:97:3: error: no matching constructor for initialization of 'Array1D<int>' rowptr_(M, r), colind_(nz, c), dim1_(M), dim2_(N) {} ^ ~~~~ /usr/local/include/tnt/tnt_array1d.h:63:11: note: candidate constructor not viable: no known conversion from 'const int *' to 'const int' for 2nd argument; dereference the argument with * Array1D(int n, const T &a); ^ /usr/local/include/tnt/tnt_array1d.h:64:11: note: candidate constructor not viable: 2nd argument ('const int *') would lose const qualifier Array1D(int n, T *a); ^ /usr/local/include/tnt/tnt_array1d.h:61:11: note: candidate constructor not viable: requires 0 arguments, but 2 were provided Array1D(); ^ /usr/local/include/tnt/tnt_array1d.h:62:11: note: candidate constructor not viable: requires single argument 'n', but 2 arguments were provided explicit Array1D(int n); ^ /usr/local/include/tnt/tnt_array1d.h:65:14: note: candidate constructor not viable: requires single argument 'A', but 2 arguments were provided inline Array1D(const Array1D &A); ^ In file included from ForstnerOperator.cpp:7: In file included from /usr/local/include/tnt/jama_lu.h:4: In file included from /usr/local/include/tnt/tnt.h:55: /usr/local/include/tnt/tnt_sparse_matrix_csr.h:97:18: error: no matching constructor for initialization of 'Array1D<int>' rowptr_(M, r), colind_(nz, c), dim1_(M), dim2_(N) {} ^ ~~~~~ /usr/local/include/tnt/tnt_array1d.h:63:11: note: candidate constructor not viable: no known conversion from 'const int *' to 'const int' for 2nd argument; dereference the argument with * Array1D(int n, const T &a); ^ /usr/local/include/tnt/tnt_array1d.h:64:11: note: candidate constructor not viable: 2nd argument ('const int *') would lose const qualifier Array1D(int n, T *a); ^ /usr/local/include/tnt/tnt_array1d.h:61:11: note: candidate constructor not viable: requires 0 arguments, but 2 were provided Array1D(); ^ /usr/local/include/tnt/tnt_array1d.h:62:11: note: candidate constructor not viable: requires single argument 'n', but 2 arguments were provided explicit Array1D(int n); ^ /usr/local/include/tnt/tnt_array1d.h:65:14: note: candidate constructor not viable: requires single argument 'A', but 2 arguments were provided inline Array1D(const Array1D &A); ^ Fix: As mentioned and suggested at http://sourceforge.net/p/pymol/bugs/100/, change file tnt/tnt_sparse_matrix_csr.h according --- tnt/tnt_sparse_matrix_csr.h.sav 2011-05-11 22:24:31.000000000 -0400 +++ tnt/tnt_sparse_matrix_csr.h 2011-05-11 22:29:32.000000000 -0400 @@ -49,8 +49,8 @@ private: Array1D<T> val_; // data values (nz_ elements) - Array1D<int> rowptr_; // row_ptr (dim_[0]+1 elements) - Array1D<int> colind_; // col_ind (nz_ elements) + Array1D<T> rowptr_; // row_ptr (dim_[0]+1 elements) + Array1D<T> colind_; // col_ind (nz_ elements) int dim1_; // number of rows int dim2_; // number of cols Find a patched version of the ports Makefile and patched file attached. Patch attached with submission follows: How-To-Repeat: Try compiling a client using the mentioned constructor with CLANG (I use a USGS specific planetary software package called ISIS3 which compiles well with GCC and fails with CLANG with the mentioned error).
Maintainer of devel/tnt, Please note that PR ports/180337 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/180337 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Hi, sorry for the delayed response I'm a bit concerned that the patch removes type checking to avoid what seems on the surface like a legitimate warning (casting "const int" to "const int *"). Is it possible that isis3 is using TNT incorrectly? BRL-CAD seems to use the TNT Array1D with clang without issue... Thanks -Erik
On Mon, 5 Aug 2013 09:36:43 -0400 Erik Greenwald <erik@elfga.com> wrote: > Hi, sorry for the delayed response > > I'm a bit concerned that the patch removes type checking to avoid > what seems on the surface like a legitimate warning (casting "const > int" to "const int *"). Is it possible that isis3 is using TNT > incorrectly? BRL-CAD seems to use the TNT Array1D with clang without > issue... > > Thanks > -Erik Hello. It's possible that ISIS3 isn't using the object the correct way. CLANG fails on that subject, gcc 4.6 doesn't.
Is this PR still valid?
Adding Erik back to PR
I think the PR can be closed.
Submitter indicates PR can be closed.