#!/bin/bash # -- ## SVN information # $Author$ # $Date$ # $Revision$ # $Id$ # $HeadURL$ # ## MOSAIX s under CeCILL_V2 licence. See "Licence_CeCILL_V2-en.txt" ## file for an english version of the licence and ## "Licence_CeCILL_V2-fr.txt" for a french version. ## ## Permission is hereby granted, free of charge, to any person or ## organization obtaining a copy of the software and accompanying ## documentation covered by this license (the "Software") to use, ## reproduce, display, distribute, execute, and transmit the ## Software, and to prepare derivative works of the Software, and to ## permit third-parties to whom the Software is furnished to do so, ## all subject to the following: ## ## Warning, to install, configure, run, use any of MOSAIX software or ## to read the associated documentation you'll need at least one (1) ## brain in a reasonably working order. Lack of this implement will ## void any warranties (either express or implied). Authors assumes ## no responsability for errors, omissions, data loss, or any other ## consequences caused directly or indirectly by the usage of his ## software by incorrectly or partially configured ## # Default values for command line parameters install_dir=${PWD} xios_dir="$(realpath ../XIOS)" compil_full=false # Traitement de la ligne de commande fcm_version=OLD while (( ${#} > 0 )) ; do case ${1} in "-h"|"--help"|"-help") echo "make_mosaix - installs MOSAIX on your architecture" echo "make_xios [options]" echo "options :" echo " [--xios path] : path to XIOS. Default is ${xios_dir}" echo " [--full] : to generate dependencies and recompile from scratch" echo " [--fcm] : fcm version compatibility : 'new'/'old'/'OLD'/'NEW'" echo "Example : ./make_mosaix --xios ../XIOS" exit ;; "--xios") xios_dir=$(realpath ${2}) ; xios_path_defined="TRUE"; shift ; shift ;; "--full") compil_full="true" ; shift ;; "--fcm") fcm_version=${2^^} ; shift ; shift ;; esac done # Definition of the root directory of the build install_dir=${PWD} rm -f ${PWD}/bld_dir.cfg echo "inc ${install_dir}/arch.fcm" >> ${PWD}/bld_dir.cfg echo "inc ${install_dir}/config.fcm" >> ${PWD}/bld_dir.cfg echo "dir::root ${install_dir}" >> ${PWD}/bld_dir.cfg # Use the arch files used to compile XIOS ln -fs ${xios_dir}/arch.fcm . ln -fs ${xios_dir}/arch.env . ln -fs ${xios_dir}/arch.path . rm -f .void_file echo > .void_file rm -rf .void_dir mkdir .void_dir XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR" XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR" XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB" # Use config.fcm from XIOS rm -f ${install_dir}/config.fcm echo "%XIOS_DIR ${xios_dir} " > ${install_dir}/config.fcm cat ${xios_dir}/config.fcm >> ${install_dir}/config.fcm make_dir=${PWD} if [[ -d ${xios_dir}/tools/FCM ]] ; then export PATH=${xios_dir}/tools/FCM/bin:${PATH} else export PATH=${xios_dir}/tools/FCM_${fcm_version}/bin:${PATH} fi source ${install_dir}/arch.env source ${install_dir}/arch.path if [[ "${compil_full}" == "true" ]] then fcm build --clean --ignore-lock fcm build -f --ignore-lock else fcm build --ignore-lock fi build_exit_status=${?} if [[ ${build_exit_status} == 0 ]] then set nothing fi echo PATH : ${PATH} echo fcm : $(which fcm) exit ${build_exit_status}