File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Script used to install cmdstan on a GColab Machine and create a .tgz archive with the installation
4+
5+ # Arguments:
6+ # $1: cmdstan version in the form of 2.29.0 (major.minor.patch)
7+
8+ # On a fresh colab instance simply run:
9+ # !curl https://raw.githubusercontent.com/stan-dev/ci-scripts/master/release-scripts/build-conda-tgz.sh | bash -s -- 2.29.0
10+ # You can follow all the progress in the console, should take around 10 minutes
11+ # At the end the console will print a URL where you can download the .tgz archive
12+
13+ VERSION=" $1 "
14+ INSTALLATION_HOME=" /root"
15+
16+ echo " Creating v$VERSION conda .tgz archive !"
17+
18+ # Install cmdstanpy
19+ pip install --upgrade cmdstanpy
20+
21+ # Install cmdstan
22+ python -c " from cmdstanpy import install_cmdstan; install_cmdstan(cores=2, progress=True, version=\" $VERSION \" )"
23+
24+ # Create tgz archive
25+ cd $INSTALLATION_HOME /.cmdstan; tar -cf - cmdstan-$VERSION | gzip > $INSTALLATION_HOME /cmdstan-$VERSION .tgz
26+ tar -tzf $INSTALLATION_HOME /cmdstan-$VERSION .tgz | head
27+
28+ # Use transfer.sh to upload our achive for easy retrieval
29+ curl --upload-file /root/cmdstan-$VERSION .tgz https://transfer.sh/cmdstan-$VERSION .tgz
You can’t perform that action at this time.
0 commit comments