Skip to content

Commit 06ddf4c

Browse files
Add RcppArmadillo dependency to get around R CMD Check NOTE
1 parent dba10d0 commit 06ddf4c

File tree

11 files changed

+60
-53
lines changed

11 files changed

+60
-53
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Imports:
6060
parallel,
6161
randtoolbox,
6262
Rcpp (>= 0.12.7),
63+
RcppArmadillo,
6364
stats,
6465
tibble,
6566
utils

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ importFrom(MASS,ginv)
4343
importFrom(MASS,mvrnorm)
4444
importFrom(Matrix,nearPD)
4545
importFrom(Rcpp,evalCpp)
46+
importFrom(RcppArmadillo,armadillo_reset_cores)
47+
importFrom(RcppArmadillo,armadillo_throttle_cores)
4648
importFrom(cobs,cobs)
4749
importFrom(doParallel,registerDoParallel)
4850
importFrom(generics,augment)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
- Add R-hub workflow to enable checks for platforms not covered already.
2626

27+
- Imported `RcppArmadillo` functions `armadillo_throttle_cores` and `armadillo_reset_cores` to try and prevent CRAN R CMD checks using multiple threads.
28+
29+
- Updated Makevars (now Makevars.in) and Makevars.win as part of previous update.
30+
2731
# joineRML 0.4.6
2832

2933
## Housekeeping

R/joineRML.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#'
1616
#' @useDynLib joineRML, .registration = TRUE
1717
#' @importFrom Rcpp evalCpp
18+
#' @importFrom RcppArmadillo armadillo_throttle_cores armadillo_reset_cores
1819
#'
1920
#' @references
2021
#' Wulfsohn MS, Tsiatis AA. A joint model for survival and longitudinal data

src/Makevars

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Makevars.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PKG_CPPFLAGS = -I../inst/include
2+
PKG_CXXFLAGS = @OPENMP_FLAG@
3+
PKG_LIBS= @OPENMP_FLAG@ $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

src/Makevars.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
1+
PKG_CXXFLAGS = -I../inst/include -I. $(SHLIB_OPENMP_CXXFLAGS)
22
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

src/RcppExports.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,19 @@ BEGIN_RCPP
125125
return rcpp_result_gen;
126126
END_RCPP
127127
}
128+
129+
static const R_CallMethodDef CallEntries[] = {
130+
{"_joineRML_expWArma", (DL_FUNC) &_joineRML_expWArma, 4},
131+
{"_joineRML_gammaUpdate", (DL_FUNC) &_joineRML_gammaUpdate, 11},
132+
{"_joineRML_hazHat", (DL_FUNC) &_joineRML_hazHat, 3},
133+
{"_joineRML_gammaUpdate_approx", (DL_FUNC) &_joineRML_gammaUpdate_approx, 10},
134+
{"_joineRML_lambdaUpdate", (DL_FUNC) &_joineRML_lambdaUpdate, 10},
135+
{"_joineRML_mvrnormArma", (DL_FUNC) &_joineRML_mvrnormArma, 3},
136+
{"_joineRML_bSim", (DL_FUNC) &_joineRML_bSim, 3},
137+
{NULL, NULL, 0}
138+
};
139+
140+
RcppExport void R_init_joineRML(DllInfo *dll) {
141+
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
142+
R_useDynamicSymbols(dll, FALSE);
143+
}

src/init.c

Lines changed: 0 additions & 34 deletions
This file was deleted.

vignettes/joineRML-tidy.Rmd

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ vignette: >
1010
---
1111

1212
```{r load-joineRML, include=FALSE}
13+
library(RcppArmadillo)
14+
RcppArmadillo::armadillo_throttle_cores(2)
15+
16+
Sys.setenv(OMP_THREAD_LIMIT = 1)
17+
Sys.setenv(OMP_NUM_THREADS = 1)
18+
Sys.setenv(OPENBLAS_NUM_THREADS = 1)
19+
Sys.setenv(ARMA_OPENMP_THREADS = 1)
20+
Sys.setenv(R_INSTALL_NCPUS = 1)
21+
options(Ncpus = 1)
22+
1323
library(joineRML)
1424
library(knitr)
15-
16-
Sys.setenv("OMP_THREAD_LIMIT" = 1)
17-
Sys.setenv("OMP_NUM_THREADS" = 1)
18-
Sys.setenv("OPENBLAS_NUM_THREADS" = 1)
19-
Sys.setenv("ARMA_OPENMP_THREADS" = 1)
20-
options(Ncpus = 1)
2125
```
2226

2327
# Introduction
@@ -60,7 +64,7 @@ Further to that, we only select the first 50 individuals to speed up these examp
6064
hvd <- hvd[hvd$num <= 50, ]
6165
```
6266

63-
```{r hvd_model_fit, cache=TRUE}
67+
```{r hvd_model_fit}
6468
set.seed(12345)
6569
fit <- mjoint(
6670
formLongFixed = list(
@@ -185,3 +189,7 @@ Several examples of how to use `broom` including more details are available on i
185189
```{r vignette-broom, eval=FALSE, purl=FALSE}
186190
vignette(topic = "broom", package = "broom")
187191
```
192+
193+
```{r, echo=FALSE, message=FALSE}
194+
RcppArmadillo::armadillo_reset_cores()
195+
```

0 commit comments

Comments
 (0)