Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2013 23:44:52 GMT
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/180337: devel/tnt: tnt_sparse_matrix_csr.h:97:3: error: no matching constructor for initialization of 'Array1D<int>'
Message-ID:  <201307052344.r65NiqlQ037386@oldred.freebsd.org>
Resent-Message-ID: <201307052350.r65No1DE094583@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         180337
>Category:       ports
>Synopsis:       devel/tnt: tnt_sparse_matrix_csr.h:97:3: error: no matching constructor for initialization of 'Array1D<int>'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 05 23:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     O. Hartmann
>Release:        FreeBSD 10.0-CURRENT/amd64 and FreeBSD 9.1-STABLE/amd64
>Organization:
FU Berlin
>Environment:
>Description:
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);
             ^

>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).
>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:

diff -Nur tnt.orig/Makefile tnt/Makefile
--- tnt.orig/Makefile	2013-07-05 21:37:29.000000000 +0200
+++ tnt/Makefile	2013-07-06 01:29:08.000000000 +0200
@@ -7,13 +7,14 @@
 
 PORTNAME=	tnt
 PORTVERSION=	1.2.6
+PORTREVISION=	1
 CATEGORIES=	devel math
 MASTER_SITES=	http://math.nist.gov/tnt/
 DISTNAME=	${PORTNAME}_126
 .ifndef NOPORTDOCS
 DISTFILES=${DISTNAME}${EXTRACT_SUFX} tnt120doc.zip
 .endif
-DIST_SUBDIR=	tnt
+DIST_SUBDIR=	${PORTNAME}
 EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
 
 MAINTAINER=	erik@bz.bzflag.bz
@@ -28,9 +29,14 @@
 PORTDOCS=	*
 .endif
 
+extract:
+	@${MKDIR} ${WRKSRC}
+	@${EXTRACT_CMD} ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} \
+		-d ${WRKSRC}
+
 do-install:
 	${MKDIR} ${PREFIX}/include/tnt
-	${INSTALL_DATA} ${WRKDIR}/*.h ${PREFIX}/include/tnt
+	${INSTALL_DATA} ${WRKSRC}/*.h ${PREFIX}/include/tnt
 .ifndef NOPORTDOCS
 	${MKDIR} ${DOCSDIR}
 	${EXTRACT_CMD} ${DISTDIR}/${DIST_SUBDIR}/tnt120doc \
diff -Nur tnt.orig/files/patch-tnt_sparse_matrix_csr.h tnt/files/patch-tnt_sparse_matrix_csr.h
--- tnt.orig/files/patch-tnt_sparse_matrix_csr.h	1970-01-01 01:00:00.000000000 +0100
+++ tnt/files/patch-tnt_sparse_matrix_csr.h	2013-07-05 22:10:50.000000000 +0200
@@ -0,0 +1,13 @@
+--- tnt_sparse_matrix_csr.h.orig	2013-07-05 22:10:25.000000000 +0200
++++ tnt_sparse_matrix_csr.h	2013-07-05 22:10:35.000000000 +0200
+@@ -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


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307052344.r65NiqlQ037386>