source: dynamico_lmdz/aquaplanet/IOIPSL/makeioipsl_fcm @ 4036

Last change on this file since 4036 was 4032, checked in by dubos, 8 years ago

aquaplanet/IOIPSL : bugfix compilation script

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2export ROOT=$PWD
3
4
5compil_mode_defined="FALSE"
6compil_mode="prod"
7
8job=1
9full_defined="FALSE"
10arch_defined="FALSE"
11arch_path="arch"
12arch_default_path="arch"
13arch_path_defined="FALSE"
14CPP_KEY="CPP_NONE" 
15
16while (($# > 0))
17  do
18  case $1 in
19      "-h") cat <<fin
20Usage :
21makegcm [options] -m arch exec
22[-h]                       : help
23[-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug .
24 -arch nom_arch            : nom de l\'architecture cible
25fin
26          exit;;
27
28      "-prod")
29          compil_mode="prod" ; shift ;;
30
31      "-dev")
32          compil_mode="dev" ; shift ;;
33
34      "-debug")
35          compil_mode="debug" ; shift ;;
36
37      "-arch")
38          arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
39 
40      "-arch_path")
41          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
42
43      "-job")
44          job=$2 ; shift ; shift;;
45
46      "-full")
47          full_defined="TRUE" ; shift ;;
48
49      *)
50          code="$1" ; shift ;;
51  esac
52done
53
54rm -f .void_file
55echo > .void_file
56rm -rf .void_dir
57mkdir .void_dir
58
59if [[ "$arch_defined" == "TRUE" ]]
60then
61  rm -f arch.path
62  rm -f arch.fcm
63  rm -f arch.env
64
65  if test -f $arch_path/arch-${arch}.path
66  then
67    ln -s $arch_path/arch-${arch}.path arch.path
68  elif test -f $arch_default_path/arch-${arch}.path
69  then
70    ln -s $arch_default_path/arch-${arch}.path arch.path
71  fi
72       
73  if test -f $arch_path/arch-${arch}.fcm
74  then
75    ln -s $arch_path/arch-${arch}.fcm arch.fcm
76  elif test -f $arch_default_path/arch-${arch}.fcm
77  then
78    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
79  fi
80
81  if test -f $arch_path/arch-${arch}.env
82  then
83    ln -s $arch_path/arch-${arch}.env arch.env
84  elif test -f $arch_default_path/arch-${arch}.env
85  then
86    ln -s $arch_default_path/arch-${arch}.env arch.env
87  else
88    ln -s .void_file arch.env
89  fi
90  source arch.env
91  source arch.path
92else
93  echo "Veuillez definir une architecture cible"
94  exit 1
95fi
96LD_FLAGS="%BASE_LD"
97
98if [[ "$compil_mode" == "prod" ]]
99then
100  COMPIL_FFLAGS="%PROD_FFLAGS"
101elif [[ "$compil_mode" == "dev" ]]
102then
103  COMPIL_FFLAGS="%DEV_FFLAGS"
104elif [[ "$compil_mode" == "debug" ]]
105then
106  COMPIL_FFLAGS="%DEBUG_FFLAGS"
107fi
108
109
110IOIPSL_LIB="$NETCDF_LIBDIR $NETCDF_LIB $HDF5_LIBDIR $HDF5_LIB"
111
112rm -f config.fcm
113
114echo "%COMPIL_FFLAGS $COMPIL_FFLAGS $NETCDF_INCDIR" >> config.fcm
115echo "%LD_FLAGS $LD_FLAGS" >> config.fcm
116echo "%CPP_KEY $CPP_KEY" >> config.fcm
117echo "%LIB $IOIPSL_LIB">> config.fcm
118
119if [[ "$full_defined" == "TRUE" ]]
120then
121  ./build --job $job --full
122else
123  ./build --job $job
124fi
Note: See TracBrowser for help on using the repository browser.