| 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 | 
 | 
|---|
| 21 | echo "Checking for environment variables..."
 | 
|---|
| 22 | echo ""
 | 
|---|
| 23 | if [ -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 ""
 | 
|---|
| 28 | else
 | 
|---|
| 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
 | 
|---|
| 32 | fi
 | 
|---|
| 33 | 
 | 
|---|
| 34 | if [ -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 ""
 | 
|---|
| 41 | else
 | 
|---|
| 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
 | 
|---|
| 45 | fi
 | 
|---|
| 46 | 
 | 
|---|
| 47 | if [ -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 ""
 | 
|---|
| 51 | else
 | 
|---|
| 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
 | 
|---|
| 55 | fi
 | 
|---|
| 56 | 
 | 
|---|
| 57 | echo "Ready to install [Y/N]?"
 | 
|---|
| 58 | read ANSWER
 | 
|---|
| 59 | if [[ ! $ANSWER = Y ]] ; then
 | 
|---|
| 60 |   echo "Nothing done."
 | 
|---|
| 61 |   exit 0
 | 
|---|
| 62 | fi
 | 
|---|
| 63 | 
 | 
|---|
| 64 | # Go for it!
 | 
|---|
| 65 | 
 | 
|---|
| 66 | echo "Installing dependencies using the ifort compiler..."
 | 
|---|
| 67 | echo ""
 | 
|---|
| 68 | echo "cd $ROPP_BLD"
 | 
|---|
| 69 | cd $ROPP_BLD
 | 
|---|
| 70 | echo "build_deps ifort"
 | 
|---|
| 71 | build_deps ifort
 | 
|---|
| 72 | echo ""
 | 
|---|
| 73 | 
 | 
|---|
| 74 | echo "Configuring, building, and installing ROPP using the ifort compiler..."
 | 
|---|
| 75 | echo ""
 | 
|---|
| 76 | echo "cd $ROPP_SRC"
 | 
|---|
| 77 | cd $ROPP_SRC
 | 
|---|
| 78 | echo "$ROPP_BLD/roppauto"
 | 
|---|
| 79 | $ROPP_BLD/roppauto
 | 
|---|
| 80 | echo "$ROPP_BLD/roppconfig -c ifort -i $ROPP_ROOT -m"
 | 
|---|
| 81 | $ROPP_BLD/roppconfig -c ifort -i $ROPP_ROOT -m
 | 
|---|
| 82 | echo ""
 | 
|---|
| 83 | echo "Done! Check files for successful installation."
 | 
|---|
| 84 | 
 | 
|---|
| 85 | exit 0
 | 
|---|