An Installation Bash Script

Suggestions for improvements, new features, etc.
Post Reply
ehsan
Posts: 88
Joined: Sun Jun 16, 2013 11:31 am

An Installation Bash Script

Post by ehsan » Sun Jun 16, 2013 11:59 am

Hello all,
I just very simply wrapped together the set of bash commands to install and/or update GYRE, based on Rich's installation documentation, as an alternate.
- Besides following the installation procedure, copy-paste the code below this message into a new file (I call it install_update_gyre).
The forum, unfortunately, does not allow me to attach this file.
- Edit the first line by uncommenting "what_to_do"
- Make the file executable

Code: Select all

 chmod +x install_update_gyre 
- execute it with fingers crossed.

Best regards
Ehsan.

Code: Select all

# what_to_do='install'
what_to_do='update'

main=$(pwd)

# One-time installer
if [ $what_to_do = 'install' ]
   then
   echo - Downloading the Source Files
   hg clone -r stable https://bitbucket.org/rhdtownsend/core
   hg clone -r stable https://bitbucket.org/rhdtownsend/build
   hg clone -r stable https://bitbucket.org/rhdtownsend/gyre
   echo
fi

# Or updater:
if [ $what_to_do = 'update' ]
   then
   echo - Updating ...
   cd $main/core  && hg pull && hg update #; cd -
   cd $main/build && hg pull && hg update #; cd -
   cd $main/gyre  && hg pull && hg update #; cd -
   echo - Cleaning ...
   cd $main/gyre/ad;  make clean && cd $main
   cd $main/gyre/nad; make clean && cd $main
   echo
fi

echo - Installing Adiabatic Package
cd $main/gyre/ad
make
echo - Running Examples
cd examples
./run_examples.sh
cd $main
echo

echo - Installing Non-Adiabatic Package
cd $main/gyre/nad
make
echo - Running Examples
cd examples
./run_examples.sh
cd $main

echo
echo Installation Completed
echo

Post Reply