Skip to content

compilation failure with openBLAS on Windows #1563

@paciorek

Description

@paciorek

On 2025-05-07, a user reported a compilation failure when switching from R's default BLAS to OpenBLAS on Windows.

@paul-vdb do you happen to have R set up with OpenBLAS? @weizhangstats do you use Windows? If so do you have R set up with OpenBLAS? I'd like to see if we can replicate the error but without any of us having to do anything time-consuming initially.

Here is some detail from the email chain showing NIMBLE's MCMC dll exists but cannot be loaded into R:

Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Users/SG14/AppData/Local/Temp/Rtmp2ZxEOB/nimble_generatedCode/P_1_MCMC_05_16_06_35_13.dll':
  LoadLibrary failure:  The specified module could not be found.

> file.exists("C:/Users/SG14/AppData/Local/Temp/Rtmp2ZxEOB/nimble_generatedCode/P_1_MCMC_05_16_06_35_13.dll")
[1] TRUE
> dyn.load("C:/Users/SG14/AppData/Local/Temp/Rtmp2ZxEOB/nimble_generatedCode/P_1_MCMC_05_16_06_35_13.dll")
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Users/SG14/AppData/Local/Temp/Rtmp2ZxEOB/nimble_generatedCode/P_1_MCMC_05_16_06_35_13.dll':
  LoadLibrary failure:  The specified module could not be found.

The user's example is here:

library(nimble)
# see ?jags.fit
nfun <- nimbleCode({
  for (i in 1:N) {
    Y[i] ~ dnorm(mu[i], tau)
    mu[i] <- alpha + beta * (x[i] - x.bar)
  }
  x.bar <- mean(x[])
  alpha ~ dnorm(0.0, 1.0E-4)
  beta ~ dnorm(0.0, 1.0E-4)
  sigma <- 1.0/sqrt(tau)
  tau ~ dgamma(1.0E-3, 1.0E-3)
})
## data generation
set.seed(1234)
N <- 100
alpha <- 1
beta <- -1
sigma <- 0.5
x <- runif(N)
linpred <- crossprod(t(model.matrix(~x)), c(alpha, beta))
Y <- rnorm(N, mean = linpred, sd = sigma)
## list of data for the model
ndata <- list(Y = Y, x = x)
## list of constants for the model
nconst <- list('N' = N)
## what to monitor
npara <- c("alpha", "beta", "sigma")
## do mcmc
regmod <- nimbleMCMC(code = nfun, constants = nconst, data = ndata, monitors = npara)
## model summary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions