Bug 16390 - missing 'const' declarations in R_ext/Lapack.h and R_ext/BLAS.h
Summary: missing 'const' declarations in R_ext/Lapack.h and R_ext/BLAS.h
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Add-ons (show other bugs)
Version: R 3.2.0
Hardware: Other Linux-Ubuntu
: P5 major
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-05-16 00:16 UTC by Bill Dunlap
Modified: 2015-05-16 00:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Dunlap 2015-05-16 00:16:46 UTC
Some of the complex versions of BLAS and Lapack routines are missing the 'const' declarations that are present on the double precision versions.  Hence C++ code that uses const variables will not compile.

Two offenders are Lapack's zlange (norm, m, n, a, lda) and BLAS' zcopy (n, incx, incy), but there are lots of others.

% grep -C2 '(.lange)' Lapack.h
/* value of a real matrix A */
La_extern double
F77_NAME(dlange)(const char* norm, const int* m, const int* n,
                 const double* a, const int* lda, double* work);
/* DLANGT - return the value of the one norm, or the Frobenius */
--

La_extern double
F77_NAME(zlange)(char *norm, int *m, int *n, Rcomplex *a, int *lda,
                 double *work);

% grep -C2 '(.copy)' BLAS.h
                double *dy, const int *incy);
BLAS_extern void   /* DCOPY - copy x to y */
F77_NAME(dcopy)(const int *n, const double *dx, const int *incx,
                double *dy, const int *incy);
BLAS_extern double /* DDOT - inner product of x and y */
--
                    int *incx, Rcomplex *zy, int *incy);
    BLAS_extern void
    F77_NAME(zcopy)(int *n, Rcomplex *zx, int *incx,
                    Rcomplex *zy, int *incy);