source: TOOLS/MOSAIX/make_mosaix @ 6446

Last change on this file since 6446 was 6235, checked in by omamce, 21 months ago

O.M. : MOSAIX :

  • update README.md for the propoer revision of XIOS
  • change make_mosaix to adapt to different fcm versions
  • Property svn:executable set to *
  • Property svn:keywords set to Date Revision HeadURL Author Id
File size: 3.5 KB
Line 
1#!/bin/bash
2# --
3## SVN information
4#  $Author$
5#  $Date$
6#  $Revision$
7#  $Id$
8#  $HeadURL$
9#
10##  MOSAIX s under CeCILL_V2 licence. See "Licence_CeCILL_V2-en.txt"
11##  file for an english version of the licence and
12##  "Licence_CeCILL_V2-fr.txt" for a french version.
13##
14##  Permission is hereby granted, free of charge, to any person or
15##  organization obtaining a copy of the software and accompanying
16##  documentation covered by this license (the "Software") to use,
17##  reproduce, display, distribute, execute, and transmit the
18##  Software, and to prepare derivative works of the Software, and to
19##  permit third-parties to whom the Software is furnished to do so,
20##  all subject to the following:
21##
22##  Warning, to install, configure, run, use any of MOSAIX software or
23##  to read the associated documentation you'll need at least one (1)
24##  brain in a reasonably working order. Lack of this implement will
25##  void any warranties (either express or implied).  Authors assumes
26##  no responsability for errors, omissions, data loss, or any other
27##  consequences caused directly or indirectly by the usage of his
28##  software by incorrectly or partially configured
29##
30
31# Default values for command line parameters
32install_dir=${PWD}
33xios_dir="$(realpath ../XIOS)"
34compil_full=false
35           
36# Traitement de la ligne de commande
37fcm_version=OLD
38
39while (( ${#} > 0 )) ; do
40    case ${1} in
41        "-h"|"--help"|"-help")
42            echo "make_mosaix - installs MOSAIX on your architecture"
43            echo "make_xios [options]"
44            echo "options :"
45            echo "       [--xios path] : path to XIOS. Default is ${xios_dir}"
46            echo "       [--full]      : to generate dependencies and recompile from scratch"
47            echo "       [--fcm]       : fcm version compatibility : 'new'/'old'/'OLD'/'NEW'"
48            echo "Example : ./make_mosaix --xios ../XIOS"
49            exit
50            ;;
51        "--xios")  xios_dir=$(realpath ${2})   ; xios_path_defined="TRUE"; shift ; shift ;;
52        "--full")  compil_full="true"  ; shift ;;
53        "--fcm")   fcm_version=${2^^}  ; shift ; shift ;;
54    esac
55done
56
57
58# Definition of the root directory of the build
59install_dir=${PWD}
60
61rm -f ${PWD}/bld_dir.cfg
62
63echo "inc        ${install_dir}/arch.fcm"   >> ${PWD}/bld_dir.cfg
64echo "inc        ${install_dir}/config.fcm" >> ${PWD}/bld_dir.cfg
65echo "dir::root  ${install_dir}"            >> ${PWD}/bld_dir.cfg
66
67# Use the arch files used to compile XIOS
68ln -fs ${xios_dir}/arch.fcm   .
69ln -fs ${xios_dir}/arch.env   .
70ln -fs ${xios_dir}/arch.path  .
71
72rm -f .void_file
73echo > .void_file
74rm -rf .void_dir
75mkdir .void_dir
76
77
78XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR"
79XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR"
80XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB"
81
82# Use config.fcm from XIOS
83rm -f ${install_dir}/config.fcm
84
85echo "%XIOS_DIR      ${xios_dir} "    > ${install_dir}/config.fcm
86cat ${xios_dir}/config.fcm >> ${install_dir}/config.fcm
87
88make_dir=${PWD}
89
90if [[ -d ${xios_dir}/tools/FCM ]] ; then
91    export PATH=${xios_dir}/tools/FCM/bin:${PATH}
92else
93    export PATH=${xios_dir}/tools/FCM_${fcm_version}/bin:${PATH}
94fi
95
96source ${install_dir}/arch.env
97source ${install_dir}/arch.path
98
99if [[ "${compil_full}" == "true" ]]
100then
101    fcm build --clean --ignore-lock
102    fcm build -f --ignore-lock
103else
104    fcm build --ignore-lock
105fi
106
107build_exit_status=${?}
108
109if [[ ${build_exit_status} == 0 ]]
110then
111    set nothing
112fi
113
114echo PATH : ${PATH}
115echo fcm : $(which fcm)
116
117exit ${build_exit_status}
118
119
120
Note: See TracBrowser for help on using the repository browser.