Ticket #249: ropp_svn_install.sh

File ropp_svn_install.sh, 2.4 KB (added by Ian Culverwell, 13 years ago)
Line 
1#!/bin/bash
2#
3# NAME:
4# ropp_svn_install.sh
5#
6# DESCRIPTION:
7# This script configures, builds, and installs ROPP when checked out from SVN.
8# It assumes that the user has SVN copies of ropp_src and ropp_bld in
9# directories given by the $ROPP_SRC and $ROPP_BLD environment variables,
10# respectively. It checks if environment variables are set. It is intended
11# as a help for the development team at DMI, and uses the ifort compiler.
12# Executables and libraries are put in $ROPP_ROOT/ifort. The script can
13# be run from any directory.
14#
15# AUTHOR:
16# Stig Syndergaard
17#
18
19# Check for environment variables.
20
21echo "Checking for environment variables..."
22echo ""
23if [ -n "$ROPP_SRC" ] ; then
24 echo "Your ROPP_SRC environment variable is set to: "
25 echo "$ROPP_SRC"
26 echo "This is where you should have a copy of ropp_src from SVN."
27 echo ""
28else
29 echo "Failed: Please set the ROPP_SRC environment variable "
30 echo "to the path where you have checked out ropp_src from SVN."
31 exit 0
32fi
33
34if [ -n "$ROPP_BLD" ] ; then
35 echo "Your ROPP_BLD environment variable is set to: "
36 echo "$ROPP_BLD"
37 echo "This is where you should have a copy of ropp_bld from SVN."
38 echo "Dependency packages (e.g. NetCDF and BUFR tar-balls) "
39 echo "should be located here as well."
40 echo ""
41else
42 echo "Failed: Please set the ROPP_BLD environment variable "
43 echo "to the path where you have checked out ropp_bld from SVN."
44 exit 0
45fi
46
47if [ -n "$ROPP_ROOT" ] ; then
48 echo "Your ROPP_ROOT environment variable is set to $ROPP_ROOT"
49 echo "After installation, executables and libraries will be located here."
50 echo ""
51else
52 echo "Failed: Please set the ROPP_ROOT environment variable "
53 echo "to the path where you want ROPP executables to be installed."
54 exit 0
55fi
56
57echo "Ready to install [Y/N]?"
58read ANSWER
59if [[ ! $ANSWER = Y ]] ; then
60 echo "Nothing done."
61 exit 0
62fi
63
64# Go for it!
65
66echo "Installing dependencies using the ifort compiler..."
67echo ""
68echo "cd $ROPP_BLD"
69cd $ROPP_BLD
70echo "build_deps ifort"
71build_deps ifort
72echo ""
73
74echo "Configuring, building, and installing ROPP using the ifort compiler..."
75echo ""
76echo "cd $ROPP_SRC"
77cd $ROPP_SRC
78echo "$ROPP_BLD/roppauto"
79$ROPP_BLD/roppauto
80echo "$ROPP_BLD/roppconfig -c ifort -i $ROPP_ROOT -m"
81$ROPP_BLD/roppconfig -c ifort -i $ROPP_ROOT -m
82echo ""
83echo "Done! Check files for successful installation."
84
85exit 0