-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_forecast_dev_env.sh
More file actions
executable file
·79 lines (67 loc) · 2.01 KB
/
setup_forecast_dev_env.sh
File metadata and controls
executable file
·79 lines (67 loc) · 2.01 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#! /bin/env bash
update_users_bashrc_file=0
conda_packages_file=packages.list
repo_url=https://github.com/hydrology-tep/fanfar-forecast
git_branch=develop
local_dir=fanfar-forecast
echo "Download git repository fanfar-forecast from github"
sleep 3
git clone ${repo_url} ${local_dir}
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Problem cloning repository, aborting"
exit 1
fi
if [ ! -d ${local_dir} ]; then
echo "The dir ${local_dir} with the cloned repository doesn't exist, aborting"
exit 1
fi
pushd ${local_dir}
git checkout ${git_branch}
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Problem changing to branch ${git_branch}, aborting"
exit 1
fi
popd
echo "Install base SW libraries and components via yum"
sleep 3
# proj?
# libgfortran for HYPE 5.x.0 built with gcc 4.4.7
sudo yum install -y miniconda proj libgfortran hdf5 netcdf
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Problem installing with yum, aborting"
exit 1
fi
# Due to run-time problems
echo "Downgrade proj from version 4.8 to 4.7"
sleep 3
sudo yum downgrade proj
echo "Install additional SW libraries and components via conda"
sleep 3
# Since post-processing moved to fanfar-postprocessing and
# 'netcdf to obs' do not use cdo, we ignore the previous used conda
# environments cairo-env and cdo-env and only use the default base environemnt
if [ "x${update_users_bashrc_file}" == "x1" ]; then
echo "Update users .bashrc with path to conda"
echo "export PATH=/opt/anaconda/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
#else
# export PATH=/opt/anaconda/bin:$PATH
fi
# Source above may not affect this session, do this anyway for this session
export PATH=/opt/anaconda/bin:$PATH
sudo conda install -y --file ${local_dir}/src/main/app-resources/dependencies/R/${conda_packages_file}
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Problem installing with conda, aborting"
exit 1
fi
echo "Install the fanfar-forecast application in /application/"
sleep 3
pushd ${local_dir}
mvn clean install
popd
echo ""
echo "Done"