Hi everyone,
I want to run a brms model with opencl() function in Rstudio, windows 10 pro. See my code below:
library(brms)
# Compile and sample
fit <- brm(value ~ name,
df,
family = student(link_nu = "logm1"),
iter = 2000,
warmup = 1000,
chains = 2,
cores = 2,
opencl = opencl(c(0, 0)),
backend = "cmdstan")
But I got the following error messages:
###################################
At global scope:
cc1plus.exe: warning: unrecognized command line option “-Wno-ignored-attributes”
cc1plus.exe: warning: unrecognized command line option “-Wno-ignored-attributes”
cc1plus.exe: warning: unrecognized command line option “-Wno-int-in-bool-context”
mingw32-make.exe: *** [src/cmdstan/main_threads_opencl.o] Error 1
Error: An error occured during compilation! See the message above for more information.
###################################
I had tried some suggestions in other similar posts, like:
###########################################
cmdstan_make_local(cpp_options = “CXXFLAGS += -fpermissive”)
rebuild_cmdstan(cores = 4)
###########################################
or
###########################################
install_cmdstan(cores=4, overwrite = TRUE)
cmdstan_make_local(cpp_options = “CXXFLAGS += --Wno-int-in-bool-context”, append = TRUE)
path_to_opencl_lib ← “C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4/lib/x64”
cpp_options = list(
“CXXFLAGS += -fpermissive”,
“PRECOMPILED_HEADERS”=FALSE,
paste0(“LDFLAGS+= -L”",path_to_opencl_lib,"" -lOpenCL")
)
cmdstan_make_local(cpp_options = cpp_options)
rebuild_cmdstan(cores=4)
###########################################
But I still got the same error messages: “mingw32-make.exe: *** [src/cmdstan/main_threads_opencl.o] Error 1”.
And, everytime when I run the above code, it will show that “NOTE: Please add C:/Users/Administrator/Documents/.cmdstanr/cmdstan-2.27.0/stan/lib/stan_math/lib/tbb to your PATH variable. You may call mingw32-make install-tbb to automatically update your user configuration.”
I had added it into my path variable like this:
But it seems to be not helpful…I really need your help, thanks a lot!
Best,
Jacob
- Operating System: win10
- CmdStan Version: cmdstan 2.27.0
- Compiler/Toolkit: g++
other versions of my packages:
R version 3.6.3
R studio Version 1.3.1056
brms 2.15.9
cmdstanr 0.4.0