Skip to content

Commit

Permalink
add --preclean to R CMD SHLIB (#1393)
Browse files Browse the repository at this point in the history
* update LICENSE to 2024

* add --preclean to R CMD SHLIB to address issue 1368

* fix typo
  • Loading branch information
paciorek authored Jan 18, 2024
1 parent 2353702 commit a317d77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/nimble/R/cppDefs_cppProject.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ cppProjectClass <- setRefClass('cppProjectClass',
ssDllName <- normalizePath(file.path(dirName, paste0(dllName, .Platform$dynlib.ext)), winslash = "\\", mustWork=FALSE)
ssdSHLIBcmd <- normalizePath(file.path(R.home('bin'), 'R'),
winslash = "\\", mustWork=FALSE)
ssdSHLIBargs <- paste('CMD SHLIB', cppName, '-o', basename(ssDllName))
ssdSHLIBargs <- paste('CMD SHLIB',
ifelse(nimbleOptions()$precleanCompilation, '--preclean', ''),
cppName, '-o', basename(ssDllName))

logFile <- paste0(dllName, ".log")
errorFile <- paste0(dllName, ".err")
Expand Down Expand Up @@ -276,7 +278,9 @@ cppProjectClass <- setRefClass('cppProjectClass',
includes <- c(includes, Oincludes) ## normal operation will have Oincludes.
}
SHLIBcmd <- normalizePath(file.path(R.home('bin'), 'R'), winslash = "\\", mustWork=FALSE)
SHLIBargs <- paste('CMD SHLIB', paste(c(mainfiles, includes), collapse = ' '), '-o', basename(outputSOfile))
SHLIBargs <- paste('CMD SHLIB',
ifelse(nimbleOptions()$precleanCompilation, '--preclean', ''),
paste(c(mainfiles, includes), collapse = ' '), '-o', basename(outputSOfile))

cur = getwd()
setwd(dirName)
Expand Down
1 change: 1 addition & 0 deletions packages/nimble/R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ nimbleUserNamespace <- as.environment(list(sessionSpecificDll = NULL))
checkModel = FALSE,
checkNimbleFunction = TRUE,
checkDuplicateNodeDefinitions = TRUE,
precleanCompilation = TRUE,
verbose = TRUE,
verboseErrors = FALSE,

Expand Down

0 comments on commit a317d77

Please sign in to comment.