Skip to content
Snippets Groups Projects
Commit a7f8da36 authored by Anthony's avatar Anthony
Browse files

Merge branch 'master' of gitlab.in2p3.fr:jan.polcher/routingpp

parents 35dcbb9c cca7e5df
No related branches found
No related tags found
No related merge requests found
......@@ -14,16 +14,23 @@
# Functions
#
function hasanaconda (){
condahost="camelot climserv ciclad"
h=$(hostname)
res=1
for ch in ${condahost} ; do
if [ $(echo $h | grep ${ch} | wc -c) != "0" ] ; then
res=0
fi
done
return $res
ipsl="ipsl camelot climserv ciclad"
idris="idris jean-zay"
case $(hostname -d) in
climserv*|private.ipsl.fr|ipsl.polytechnique.fr)
echo "IPSL"
eval "$1='ipsl'"
;;
idris*|jean-zay*)
echo "IDRIS"
eval "$1='idris'"
;;
*)
echo "unknown machine : $(hostname -d)"
eval "$1='unknown'"
esac
}
function checkenv (){
rm -f checkenv.py
cat <<EOF > checkenv.py
......@@ -48,30 +55,63 @@ EOF
#
# Main
#
if ( hasanaconda ) ; then
loc=''
hasanaconda loc
if [ loc != "unknown" ] ; then
#
# Make sure the right version of Python
#
module unload python
module load python/3.6-anaconda50
#
# Test if the MPI environment is installed.
#
if [ ! -e ${HOME}/.conda/envs/MPI ] ; then
#
# Create the MPI environment as it does not exist.
#
conda create -y -n MPI mpi4py numba astropy netcdf4 matplotlib basemap ConfigParser
source activate MPI
conda install -y cartopy
conda install -y --channel astropy spherical-geometry
fi
#
# Activate the MPI environment
#
source activate MPI
case $loc in
"ipsl")
module unload python
module load python/3.6-anaconda50
#
# Test if the MPI environment is installed.
#
if [ ! -e ${HOME}/.conda/envs/MPI ] ; then
#
# Create the MPI environment as it does not exist.
#
conda create -y -n MPI mpi4py numba astropy netcdf4 matplotlib basemap ConfigParser
source activate MPI
conda install -y cartopy
conda install -y --channel astropy spherical-geometry
else
source activate MPI
fi
;;
"idris")
module load python/3.7.3
if [[ -L ${HOME}/.conda && -d ${HOME}/.conda ]] ; then
if [ ! -e ${WORK}/.conda/envs/MPI ] ; then
conda create -y -n MPI mpi4py numba astropy netcdf4 matplotlib basemap ConfigParser cartopy
conda activate MPI
if [[ -L ${HOME}/.local && -d ${HOME}/.local ]] ; then
export PYTHONUSERBASE=$WORK/.local
if [ $(find $PYTHONUSERBASE -name spherical_geometry -ls | wc -l) -le 0 ] ; then
git clone https://github.com/spacetelescope/spherical_geometry.git
cd spherical_geometry
python setup.py install --user
fi
else
echo "Make sure \$HOME/.link is a link to your \$WORK/.local"
fi
else
conda activate MPI
fi
else
echo "Make sure \$HOME/.conda is a link to your \$WORK/.conda"
fi
;;
*)
echo "Environment for $loc is not foreseen yet"
exit
;;
esac
fi
#
# Verify we can load all the needed modules.
#
#
checkenv
......@@ -4,10 +4,10 @@ obj = defprec.o ioipsl.o constantes_var.o haversine.o grid.o routing_reg.o routi
#
FC = gfortran
FFLAG = -fPIC
FDBG = -g -fbounds-check
#FDBG = -g -fbounds-check
#
FPY = f2py
PDBG = --debug
#PDBG = --debug
#
all : routing_interface.so
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment