Error running R code on Linux computing cluster


#1

Hi all,

I’m trying to run my R code on a remote server (Linux computing cluster). I’ve succesully installed the necessary R packages to the server such as rstan and loo packages. However, when submitting a job to the server, the following warning and error messages appear:

During startup - Warning messages:
1: Setting LC_CTYPE failed, using “C”
2: Setting LC_COLLATE failed, using “C”
3: Setting LC_TIME failed, using “C”
4: Setting LC_MESSAGES failed, using “C”
5: Setting LC_MONETARY failed, using “C”
6: Setting LC_PAPER failed, using “C”
7: Setting LC_MEASUREMENT failed, using “C”

Loading required package: ggplot2
Loading required package: StanHeaders
rstan (Version 2.17.3, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)
This is loo version 2.0.0.
**NOTE: As of version 2.0.0 loo defaults to 1 core but we recommend using as many as possible. Use the ‘cores’ argument or set options(mc.cores = NUM_CORES) for an entire session. Visit mc-stan.org/loo/news for details on other changes.
Error in system2(file.path(R.home(component = “bin”), “R”), args = paste(“CMD config”, : **
** error in running command

Calls: stan_model -> get_CXX -> system2
Execution halted

Any idea how can I solve this problem? Is it somehow related to installing Xcode on the server? and how can I do this?

Given that I can run the R code on my Mac laptop without any problems.

Thanks


#2

You can’t install Xcode on a Linux server, but you don’t need to because it should already have a C++ toolchain. Can you run rstan:::get_CXX() on the login node of the cluster? Due to all the Setting LC_* warning messages, it may be a problem with localization of the quotation marks.


#3

Hi bgoodri,

Thank you for your reply. I’m new to linux remote server.

What I just did, connect to the linux server, load R and run the script: rstan:::get_CXX(). I got the following output: “g++”

I can run the R code directly when I load R on the server. That is, I write the command: “module load R”, then I copy and paste the R code and it works. But this is not practical since it only uses one node as I’m running it on my laptop.

The problem occurs when submitting the job to the server using the command:
sbatch command.

What do you mean by “localization of the quotation marks.” ?


#4

OK. The execute nodes are for some reason not finding g++ or are not finding the necessary MAKEVARS files. Try to run a script that just has

system2(file.path(R.home(component = "bin"), "R"), 
                args = "CMD config CXX")

to see if you get a better error message.


#5

Ok. I submitted a job with the script you specified. Here is what I get in the output file:

During startup - Warning messages:
1: Setting LC_CTYPE failed, using “C”
2: Setting LC_COLLATE failed, using “C”
3: Setting LC_TIME failed, using “C”
4: Setting LC_MESSAGES failed, using “C”
5: Setting LC_MONETARY failed, using “C”
6: Setting LC_PAPER failed, using “C”
7: Setting LC_MEASUREMENT failed, using “C”
/opt/ohpc/pub/libs/gnu7/R/3.4.2/lib64/R/bin/config: line 177: make: command not found
/opt/ohpc/pub/libs/gnu7/R/3.4.2/lib64/R/bin/config: line 178: make: command not found
/opt/ohpc/pub/libs/gnu7/R/3.4.2/lib64/R/bin/config: line 179: make: command not found
/opt/ohpc/pub/libs/gnu7/R/3.4.2/lib64/R/bin/config: line 180: make: command not found
/opt/ohpc/pub/libs/gnu7/R/3.4.2/lib64/R/bin/config: line 181: make: command not found
/opt/ohpc/pub/libs/gnu7/R/3.4.2/lib64/R/bin/config: line 313: make: command not found


#6

You are probably going to have to take that up with the system administrator for the cluster. In any event, a Stan model is not going to compile if it cannot find make.

As an alternative, you may be able to compile the model once on the login node after calling

rstan_options(auto_write = TRUE)

and the execute nodes should be able to load the compiled model from the disk without recompiling it.


#7

Ok. I’m going to try both options and see how it goes. Thank you so much for your help