source: dynamico_lmdz/aquaplanet/IOIPSL/makeioipsl_fcm @ 3952

Last change on this file since 3952 was 3907, checked in by ymipsl, 9 years ago

Compilation of IOIPSL is now made by FCM

YM

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