source: palm/trunk/SCRIPTS/palm_simple_install @ 2225

Last change on this file since 2225 was 2225, checked in by raasch, 7 years ago

shell for simple installation and run script changed to bash

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1#!/bin/bash
2#--------------------------------------------------------------------------------#
3# This file is part of PALM.
4#
5# PALM is free software: you can redistribute it and/or modify it under the terms
6# of the GNU General Public License as published by the Free Software Foundation,
7# either version 3 of the License, or (at your option) any later version.
8#
9# PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along with
14# PALM. If not, see <http://www.gnu.org/licenses/>.
15#
16# Copyright 1997-2014  Leibniz Universitaet Hannover
17#--------------------------------------------------------------------------------#
18#
19# Current revisions:
20# -----------------
21# shell changed to bash
22#
23# Former revisions:
24# -----------------
25# $Id: palm_simple_install 2225 2017-05-16 11:36:20Z raasch $
26#
27# 1046 2012-11-09 14:38:45Z maronga
28# code put under GPL (PALM 3.9)
29#
30# palm_simple_install - a script for simple installation and compilation of
31#                       the palm code without using mbuild
32     # This script creates (from the working copy of the palm repository)
33     # a subdirectory MAKE_DEPOSITORY_simple which contains a copy of the
34     # palm source code and  a modified makefile which loads required compiler
35     # and preprocessor settings via "include MAKE.inc"
36
37     # Options: -i <include file>
38     #          one of the include files in ~/palm/current_version/trunk/INSTALL
39
40     # Last changes:
41     # 25/01/10 - Siggi - Generating the first version
42     # 18/03/10 - Siggi - switch to palm/current_version removed: working
43     #                    copy can be in any directory
44
45
46    # Variable declarations + default values
47 include_file=unknown
48
49
50    # Read shellscript options
51 while  getopts  :i:  option
52 do
53   case  $option  in
54       (i)   include_file=$OPTARG;;
55       (\?)  printf "\n  +++ unknown option $OPTARG \n"
56             printf "\n      allowed option are -d, -f, -l, -s \n"
57             exit;;
58   esac
59 done
60
61
62
63    # Check, if include file exists
64 if [[ ! -f trunk/INSTALL/$include_file ]]
65 then
66    echo "+++ ERROR: include file"
67    echo "    \"trunk/INSTALL/$include_file\""
68    echo "    not found"
69    exit
70 fi
71
72
73     # Create the make depository
74 if [[ ! -d MAKE_DEPOSITORY_simple ]]
75 then
76    mkdir  MAKE_DEPOSITORY_simple
77 else
78    rm  MAKE_DEPOSITORY_simple/*
79 fi
80
81
82     # Copy makefile and all source code files to make depository
83 cp  trunk/SOURCE/Makefile        MAKE_DEPOSITORY_simple/Makefile_old
84 cp  trunk/INSTALL/$include_file  MAKE_DEPOSITORY_simple/MAKE.inc
85 cp  trunk/SOURCE/*.f90           MAKE_DEPOSITORY_simple
86
87
88     # Replace comment in makefile by include statement
89 sed  's/#to_be_replaced_by_include/include MAKE.inc/g'  MAKE_DEPOSITORY_simple/Makefile_old  >  MAKE_DEPOSITORY_simple/Makefile
90 rm  MAKE_DEPOSITORY_simple/Makefile_old
91
92
93     # Create directory for input files
94 if [[ ! -d JOBS/example_cbl/INPUT ]]
95 then
96    mkdir -p  JOBS/example_cbl/INPUT
97    cp trunk/INSTALL/example_cbl_p3d  JOBS/example_cbl/INPUT
98 fi
Note: See TracBrowser for help on using the repository browser.