source: TOOLS/MOSAIX/make_mosaix @ 6090

Last change on this file since 6090 was 6065, checked in by omamce, 2 years ago

O.M. : make_mosaix, add propset

  • Property svn:executable set to *
  • Property svn:keywords set to Date Revision HeadURL Author Id
File size: 2.3 KB
Line 
1#!/bin/bash
2# --
3## SVN information
4#  $Author$
5#  $Date$
6#  $Revision$
7#  $Id$
8#  $HeadURL$
9#
10
11# Default values for command line parameters
12install_dir=${PWD}
13xios_dir="$(realpath ../XIOS)"
14compil_full=false
15           
16# Traitement de la ligne de commande
17fcm_version=OLD
18
19while ((${#} > 0)) ; do
20    case ${1} in
21        "-h"|"--help"|"-help")
22            echo "make_mosaix - installs MOSAIX on your architecture"
23            echo "make_xios [options]"
24            echo "options :"
25            echo "       [--xios path] : path to XIOS. Default is ${xios_dir}"
26            echo "       [--full]      : to generate dependencies and recompile from scratch"
27            echo "       [--fcm]       : fcm version compatibility : 'new'/'old'/'OLD'/'NEW'"
28            echo "Example : ./make_mosaix --xios ../XIOS"
29            exit
30            ;;
31        "--xios")  xios_dir=$(realpath ${2})   ; xios_path_defined="TRUE"; shift ; shift ;;
32        "--full")  compil_full="true"  ; shift ;;
33        "--fcm")   fcm_version=${2^^}  ; shift ; shift ;;
34    esac
35done
36
37
38# Definition of the root directory of the build
39install_dir=${PWD}
40
41rm -f ${PWD}/bld_dir.cfg
42
43echo "inc        ${install_dir}/arch.fcm"   >> ${PWD}/bld_dir.cfg
44echo "inc        ${install_dir}/config.fcm" >> ${PWD}/bld_dir.cfg
45echo "dir::root  ${install_dir}"            >> ${PWD}/bld_dir.cfg
46
47# Use the arch files used to compile XIOS
48ln -fs ${xios_dir}/arch.fcm   .
49ln -fs ${xios_dir}/arch.env   .
50ln -fs ${xios_dir}/arch.path  .
51
52rm -f .void_file
53echo > .void_file
54rm -rf .void_dir
55mkdir .void_dir
56
57
58XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR"
59XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR"
60XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB"
61
62# Use config.fcm from XIOS
63rm -f ${install_dir}/config.fcm
64
65echo "%XIOS_DIR      ${xios_dir} "    > ${install_dir}/config.fcm
66cat ${xios_dir}/config.fcm >> ${install_dir}/config.fcm
67
68make_dir=${PWD}
69
70export PATH=${xios_dir}/tools/FCM_${fcm_version}/bin:${PATH}
71
72source ${install_dir}/arch.env
73source ${install_dir}/arch.path
74
75if [[ "${compil_full}" == "true" ]]
76then
77    fcm build --clean --ignore-lock
78    fcm build -f --ignore-lock
79else
80    fcm build --ignore-lock
81fi
82
83build_exit_status=${?}
84
85if [[ ${build_exit_status} == 0 ]]
86then
87    set nothing
88fi
89
90echo PATH : ${PATH}
91echo fcm : $(which fcm)
92
93exit ${build_exit_status}
94
95
96
Note: See TracBrowser for help on using the repository browser.