source: configs/testing/setup.sh @ 1036

Last change on this file since 1036 was 1036, checked in by dubos, 4 years ago

testing : porting to Jean Zay

  • Property svn:executable set to *
File size: 1.8 KB
RevLine 
[501]1#!/bin/bash
2
3export ROOT=$PWD
[503]4CMD_LINE="$0 $*"
[501]5
6full_defined="FALSE"
7arch_defined="FALSE"
[740]8proj_defined="FALSE"
[501]9job=1
10
11CPP_KEY="CPP_NONE"
12ICOSA_LIB=""
13
[547]14while (($# > 0)) ; do
[501]15  case $1 in
16      "-h") cat <<EOF
17Usage :
[547]18setup [options]
[501]19[-h]                       : help
20 -arch nom_arch            : nom de l\'architecture cible
[547]21 -job N                    : parallel compilation
[740]22 -project X                : project name for job submission
[547]23 -full                     : full compilation
24extra options will be passed to make_icosa
[501]25EOF
26          exit;;
27      "-arch")
28          arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
29      "-job")
30          job=$2 ; shift ; shift;;
[740]31      "-project")
32          project=$2 ; proj_defined="TRUE"; shift; shift;;
[501]33      "-full")
34          full_defined="TRUE" ; shift ;;
35      *)
[547]36          echo "Unknown options < $* > will be passed to make_icosa"
37          other="$*"
38          break
[501]39  esac
40done
41
42if [[ "$arch_defined" == "TRUE" ]]
43then
44  cat <<EOF >current_args
[503]45# This file was generated by running :
46# $CMD_LINE
[501]47ROOT="$ROOT"
48arch="$arch"
49job="$job"
[740]50project="$project"
[702]51other_XIOS="$pther_XIOS"
[547]52other="$other"
[501]53EOF
54
55  echo "Setup saved in file current_args :"
56  cat current_args
57  # create separate build dirs sharing the same src/ and tools/ subdirs to save disk and time
[547]58  BUILD=$ROOT/build_serial
[502]59  echo "Creating build directory $BUILD"
60  rm -rf $BUILD
61  mkdir -p $BUILD
62  cd $ROOT/DYNAMICO
[1036]63  for NAME in arch build compile make_icosa src bld.cfg  clean doc tools xml ; do
[502]64      ln -s $ROOT/DYNAMICO/$NAME $BUILD/
65  done
[501]66  for NAME in mpi mpi_omp ; do
[556]67      echo "Creating build directory $ROOT/build_$NAME"
[547]68      rm -rf $ROOT/build_$NAME
69      cp -pr $BUILD $ROOT/build_$NAME
[501]70  done
71 
[547]72  echo "You may now run bash/build.sh"
[501]73else
[740]74  echo "Please define a target architecture with -arch XXX"
[501]75  exit 1
76fi
Note: See TracBrowser for help on using the repository browser.