source: configs/testing/setup.sh @ 503

Last change on this file since 503 was 503, checked in by dubos, 8 years ago

configs/testing : towards first working version

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