Problem running cmdstan on computing cluster

My system admin just installed cmdstan 2.34.1 and cmdstanr 0.7.1 on the computing cluster. I am trying to run the bernoulli example.

Here is the log file. I am trying to help them troubleshoot, and was wondering if it is obvious whether this is a problem related to cmdstan or cmdstanr.

Loading r/4.3.2
  Loading requirement: hdf5/1.10.1 gcc/8.1.0 lapack/gcc/64/3.8.0 jags/4.3.0
    jdk/8u181 gsl/2.5 udunits/2.2.28 imagemagick/6.9.10 icu/70.1 tiff/4.1.0
    geos/3.9.1 pcre2/10.35 proj/6.1.0-gcc8.1.0 sqlite/3.28.0.1 gdal/3.8.4
    python/cpu/3.7.2 bzip2/1.1.0 curl/7.60.0 jbig/2.1 webp/1.2.1 gmp/6.1.2
    glpk/4.55 libpng/1.6.37
This is cmdstanr version 0.7.1
- CmdStanR documentation and vignettes: mc-stan.org/cmdstanr
- CmdStan path: /gpfs/share/apps/cmdstan/2.34.1
- CmdStan version: 2.34.1
CmdStan path set to: /gpfs/share/apps/cmdstan/2.34.1
<built-in>: fatal error: opening dependency file stan/src/stan/model/model_header_8_1.d: Permission denied
compilation terminated.

In file included from <command-line>:
/usr/include/stdc-predef.h:1: fatal error: can’t create precompiled header stan/src/stan/model/model_header_8_1.hpp.gch: Permission denied
 /* Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
compilation terminated.

make: *** [make/program:27: stan/src/stan/model/model_header_8_1.hpp.gch] Error 1

Error: An error occured during compilation! See the message above for more information.
In addition: Warning messages:
1: CmdStan's precompiled header (PCH) files may need to be rebuilt.
If your model failed to compile please run rebuild_cmdstan().
If the issue persists please open a bug report. 
2: CmdStan's precompiled header (PCH) files may need to be rebuilt.
If your model failed to compile please run rebuild_cmdstan().
If the issue persists please open a bug report. 
Execution halted

We were able to compile the stan code and run the model using cmdstan on the cluster outside of R, so I am assuming the problem is related to cmdstanr. Hope that helps point to the issue.

Can you check, if you have write permission to that folder? I think they are missing.
You can either copy the model to your home folder or install cmdstan/cmdstanr to your
home folder.

2 Likes

It is a bit odd that I would be required to write to a system folder - this was not the case with earlier versions of cmdstan/cmdstanr which ran just fine using a similar setup. I do not have write privileges to that directory, only read privileges. Is there any way to set it up so that the I can write to a different file?

CmdStan’s current build system always assumes it has write permissions over its own directory. This is something of a pain point, but not one with an easy solution. There is some discussion here: Error compiling a simple model with read-only access to CmdStan · Issue #1175 · stan-dev/cmdstan · GitHub

1 Like

Thanks so much. It turns out that we stumbled onto the same solution raised in the link. I asked to the system admin to run my cmdstan/cmdstanr code to see if indeed it was an issue of access privileges. He was able to successfully run the code. And, in the process, he created that initial header file that no longer needs to be created, so that I am now able to run cmdstan/cmdstanr on the HPC.

1 Like