Closed yendls closed 3 years ago
fatal error: opening dependency file stan/src/stan/model/model_header.d: Permission denied
This line says you don't have write permission at path /pkpd/Torsten/cmdstan/
. You can try to put Torsten somewhere you can write to, say, ~/pkpd/Torsten
.
Can I know why does the compilation requires write access to the installation folder? and also do we have to compile all the models as part of the installation of Torsten? Please advise.
It's related to how makefile works. You don't need to compile any model when building cmdstan. Torsten doesn't require installation per se, instead it asks for installed cmdstan. The error you see is when cmdstan requires write permission. For that reason I suggest put cmdstan in user's home directory.
I have tried out your suggestion where I placed cmdstan in the user writeable area user-readonly and "/home/resdonly". I am seeing the following:
library("cmdstanr") This is cmdstanr version 0.4.0
- Online documentation and vignettes at mc-stan.org/cmdstanr
- Use set_cmdstan_path() to set the path to CmdStan
- Use install_cmdstan() to install CmdStan set_cmdstan_path("cmdstan") CmdStan path set to: /home/readonly/cmdstan file.dir <- file.path("/pkpd/Torsten", "example-models", "pk2cpt") file <- file.path(file.dir, "pk2cpt.stan") model <- cmdstan_model(file) Compiling Stan program... ar: creating stan/lib/stan_math/lib/sundials_5.2.0/lib/libsundials_nvecserial.a ar: creating stan/lib/stan_math/lib/sundials_5.2.0/lib/libsundials_cvodes.a ar: creating stan/lib/stan_math/lib/sundials_5.2.0/lib/libsundials_idas.a ar: creating stan/lib/stan_math/lib/sundials_5.2.0/lib/libsundials_kinsol.a % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 619 100 619 0 0 1018 0 --:--:-- --:--:-- --:--:-- 1016 100 16.6M 100 16.6M 0 0 1314k 0 0:00:12 0:00:12 --:--:-- 2275k /home/readonly/cmdstan/stan/lib/stan_math/lib/tbb_2019_U8/build/Makefile.tbb:28: CONFIG: cfg=release arch=intel64 compiler=gcc target=linux runtime=cc8.3.1_libc2.28_kernel4.19.76 Warning message: In file.create(to[okay]) : cannot create file '/pkpd/Torsten/example-models/pk2cpt/pk2cpt', reason 'Permission denied'
The code is still trying to write the "/pkpd/Torsten/example-models/" location which is under the installation directory "/pkpd/Torsten"
That's because the "pk2cpt" model is not moved. If you copy that model to your home directory it should work fine, same as now there's no longer
fatal error: opening dependency file stan/src/stan/model/model_header.d: Permission denied
error because the change you've made.
Hi Yi,
I have tried running "pk2cpt" example-model in a centos-8, gcc-8.3.1 and R-4.0.4 environment. When I run as a root user the execution goes through successfully as root has write access to all the locations. However, when running as a non-root user.. I am seeing the below errors, also below is the source code for pk2cpt example model..:
R version 4.0.4 (2021-02-15) -- "Lost Library Book" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-redhat-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
Source: library("cmdstanr") set_cmdstan_path("/pkpd/Torsten/cmdstan") file.dir <- file.path("./") file <- file.path(file.dir, "pk2cpt.stan") model <- cmdstan_model(file) fit <- model$sample(data = file.path(file.dir, "pk2cpt.data.R"), init = file.path(file.dir, "pk2cpt.init.R"), seed = 123, chains = 4, parallel_chains = 2, refresh = 500) bayesplot::mcmc_dens_overlay(fit$draws("CL"))