[R-pkg-devel] R, BLAS, and FCLEN

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Aug 31 21:26:24 CEST 2019

On 31/08/2019 12:47 p.m., Göran Broström wrote:
> I'm having difficulties updating my package eha: When I run standard
> checks 'at home' everything is fine, but 'CRAN-submissions' reports
> (among other things):
> geomsup.f:324:9: warning: type of ‘dgemv’ does not match original
> declaration [-Wlto-type-mismatch]
>     324 |      &     one, score, ione)
>         |         ^
> /home/tmp/R-d-gcc-LTO/include/R_ext/BLAS.h:107:1: note: type mismatch in
> parameter 12
>     107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
>         | ^
> This is odd since the LAPACK subroutine dgemv takes only 11 parameters.
> However, in include/R_ext/BLAS.h we have
> F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
> 		const double *alpha, const double *a, const int *lda,
> 		const double *x, const int *incx, const double *beta,
> 		double *y, const int *incy FCLEN);
> with a 12th parameter FCLEN?? How am I supposed to fix this, and what
> the ... is FCLEN? googling leads to nothing useful (for me). It seems as
> if R is redefining some standard LAPACK routines.
> Also a note I do not understand (in this context):
> note: type ‘void’ should match type ‘long int’
> Any help is much appreciated.

Sounds likely to be related to this item from R-devel NEWS:


"   Header ‘Rconfig.h’ contains the value of ‘FC_LEN_T’ deduced at 
installation which is used by the prototypes in headers ‘R_ext/BLAS.h’ 
and ‘R_ext/Lapack.h’ but to avoid extensive breakage this is only 
exposed when ‘USE_FC_LEN_T’ is defined.

     If a package's C/C++ calls to BLAS/LAPACK allow for the ‘hidden’ 
arguments used by most Fortran compilers to pass the lengths of Fortran 
character arguments, define ‘USE_FC_LEN_T’ and include ‘Rconfig.h’ 
(possibly _via_ ‘R.h’) before including ‘R_ext/BLAS.h’ or ‘R_ext/Lapack.h’."

Duncan Murdoch

More information about the R-package-devel mailing list