source: TOOLS/MOSAIX/make_mosaix @ 6048

Last change on this file since 6048 was 6043, checked in by omamce, 2 years ago

O.M. : add choice of fcm (old/new) to make_mosaix like in XIOS

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