forked from stan-dev/rstan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sh_b.sh
executable file
·39 lines (29 loc) · 1.16 KB
/
sh_b.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
red='\033[0;31m'
NC='\033[0m' # no color
STAN_REPO_BRANCH=develop
grepstanbranch=`git ls-remote --heads https://github.com/stan-dev/stan.git | grep "/${STAN_REPO_BRANCH}"`
if [ -z "$grepstanbranch" ]; then
echo -e "${red}ERROR:${NC} stan repo does not have {STAN_REPO_BRANCH}"
exit 20
fi
STAN_MATH_REPO_BRANCH=develop
grepstanmathbranch=`git ls-remote --heads https://github.com/stan-dev/math.git | grep "/${STAN_MATH_REPO_BRANCH}"`
if [ -z "$grepstanmathbranch" ]; then
echo -e "${red}ERROR:${NC} stan math repo does not have {STAN_MATH_REPO_BRANCH}"
exit 20
fi
git config -f .gitmodules submodule.stan.branch ${STAN_REPO_BRANCH}
git config -f .gitmodules submodule.StanHeaders/inst/include/mathlib.branch ${STAN_MATH_REPO_BRANCH}
git submodule update --init --remote
git submodule status
R CMD build StanHeaders/
stanheadtargz=`find StanHeaders*.tar.gz | sort | tail -n 1`
lookforverfile=`tar ztf ${stanheadtargz} | grep stan/version.hpp`
if [ -z "$lookforverfile" ]; then
echo -e "${red}ERROR:${NC} stan/version.hpp is not found in StanHeaders pkg"
exit 2
fi
git checkout .gitmodules
# git submodule deinit -f .
R CMD INSTALL ${stanheadtargz}