From 09be724c07686930c4c3771ef2e5532fd4134a30 Mon Sep 17 00:00:00 2001 From: Benjamin Christoffersen Date: Fri, 3 Jan 2020 10:10:16 +0100 Subject: [PATCH] fix lto issue prepare for submission --- NEWS.md | 1 + TODO | 4 +--- cran-comments.md | 34 +++++++++++++--------------------- src/Makevars | 1 + src/R_BLAS_LAPACK.cpp | 22 +++++++++++++++++----- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/NEWS.md b/NEWS.md index cbabb60..02b6dbb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # pargm 0.1.4 * `stop`s when there are more variables than observations. Previously, this caused a crash. +* handle Fortran string length argument. # pargm 0.1.3 * Fix bug found with Valgrind. diff --git a/TODO b/TODO index 510a712..598113e 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ make a function which can take a function input which yields the input for each chunk to allow for larger data sets that do not fit in memory -make a method like `speedglm` which computes the cross product of the weighted -design matrix which is faster but less stable -the Armadillo `rows` may be slow when the copy is made? +the Armadillo `rows` may be slow when the copy is made? there may be an overhead with the current abstract family class fix issue with order in `summary.glm` diff --git a/cran-comments.md b/cran-comments.md index 63f8a16..91adbe2 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,24 +1,16 @@ ## Test environments -* Ubuntu 18.04 LTS - R version 3.5.3 -* Ubuntu 14.04.5 LTS (on travis-ci with codename: trusty) - R version 3.5.2 -* win-builder (devel and release) -* Local Ubuntu 18.04 with R 3.5.2 and with clang 6.0.0 with ASAN and +* Ubuntu 18.04 LTS with gcc 8.3.0 + R version 3.6.1 +* Ubuntu 16.04 LTS (on travis-ci) + R version 3.6.1 +* Ubuntu 18.04 LTS with gcc 8.3.0 with --enable-lto + R devel (2019-11-06 r77376) +* Ubuntu 18.04 LTS with clang 6.0.0 with ASAN and UBSAN checks -* The following rhub platforms: - fedora-clang-devel - fedora-gcc-devel - debian-gcc-patched - debian-gcc-devel - debian-gcc-release - linux-x86_64-rocker-gcc-san - solaris-x86-patched - + R devel (2019-11-06 r77376) +* win-builder (devel and release) +* `rhub::check_on_solaris()` + ## R CMD check results -There were no ERRORs, or WARNINGs. There is a NOTE on `fedora-gcc-devel` -on rhub, my local machine, and `debian-gcc-release` on rhub about the size -of the package. - -## Resubmission -`R CMD check --use-valgrind --as-cran` passes without any errors. +The LTO issue have been solved. There is a note about the size of the +package on some platforms. diff --git a/src/Makevars b/src/Makevars index 22ebc63..dd9d6cc 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1 +1,2 @@ +PKG_CPPFLAGS = -DUSE_FC_LEN_T PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) diff --git a/src/R_BLAS_LAPACK.cpp b/src/R_BLAS_LAPACK.cpp index 57a9280..a0d4aef 100644 --- a/src/R_BLAS_LAPACK.cpp +++ b/src/R_BLAS_LAPACK.cpp @@ -1,6 +1,15 @@ -#include +#include #include +#ifndef FCLEN +#define FCLEN +#endif +#ifndef FCONE +#define FCONE +#endif #include + +#include + #include #include "R_BLAS_LAPACK.h" @@ -27,7 +36,7 @@ namespace R_BLAS_LAPACK { &n, &nrhs, A, &n, B, &n, - &info); + &info FCONE FCONE FCONE); if(info != 0){ std::stringstream str; @@ -42,7 +51,8 @@ namespace R_BLAS_LAPACK { const double* tau, double* c, const int* ldc, double* work, const int* lwork, int* info){ F77_CALL(dormqr)( - side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info); + side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info + FCONE FCONE); } void dgeqp3(const int* m, const int* n, double* a, const int* lda, @@ -65,13 +75,15 @@ namespace R_BLAS_LAPACK { const double *alpha, const double *a, const int *lda, const double *x, const int *incx, const double *beta, double *y, const int *incy){ - F77_CALL(dgemv)(trans, m, n, alpha, a, lda, x, incx, beta, y, incy); + F77_CALL(dgemv)(trans, m, n, alpha, a, lda, x, incx, beta, y, incy + FCONE); } void dsyrk(const char *uplo, const char *trans, const int *n, const int *k, const double *alpha, const double *a, const int *lda, const double *beta, double *c, const int *ldc){ - F77_CALL(dsyrk)(uplo, trans, n, k, alpha, a, lda, beta, c, ldc); + F77_CALL(dsyrk)(uplo, trans, n, k, alpha, a, lda, beta, c, ldc + FCONE FCONE); } }