Installing rstan or cmdstanr from source

I work on a machine with overly clamped down security in a very large system. Unfortunately I was forced to update R and Rtools to the latest versions, R 4.4.2 and Rtools44. Now I need to install rstan and/or cmdstanr back on the machine. However, due to SSL errors, I cannot install any packages in R. Getting IT to help with these errors is very unlikely (I suspect it has to do with some security thing).

I am hoping to install rstan and/or cmdstanr from source, where I download the necessary zip files or .tar.gz files and install from source. I started doing this and realized an endless number of dependencies. Is there not a way/place to download everything needed to a folder on my computer and then install it from source in R?

Thanks.

This doesn’t answer the question about where to get everything in one place to install from source efficiently, but I was able to resolve the SSL error and thankfully can download packages again.

Not a Stan issue per se, but in case anyone faces this SSL issue, the solution that worked for me is found here r - SSL connect error in httr / curl - Stack Overflow

There might be a better way, but you could use miniCRAN to make a repo with the dependencies you need (you may have to do this on a computer without the restrictions), then transfer that to the computer with restrictions and build the packages from source. I’ve never tried this before but miniCRAN should be able to figure out all the dependencies you need and get the sources for you, or so it claims:

So basically:

  1. Create a local folder on a machine with normal internet access, which includes rstan and all required dependencies (miniCRAN can help with this)

  2. Copy that folder to your offline machine.

  3. Install from the local folder using install.packages(..., repos = "path/to/folder", type = "source").

Not sure if this works, but maybe!

2 Likes

Thanks for the reply! In case this happens in the future, and I am unable to resolve security errors, I will try this (conditional on a way to get the folder from the unrestricted machine to the restricted machine).

1 Like