source: configs/testing/bash/build.sh @ 1044

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

testing : complete DCMIP41 test case for JEANZAY_PGI_ACC

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2
3function build_dynamico_()
4{
5    NAME=$1 ; shift
6    LOGFILE=$1 ; shift
7    echo "# command used to build DYNAMICO ($NAME) :" >> logs/build.sh
8    echo "./make_icosa $*" >> logs/build.sh
9
10    cd $ROOT/build_$NAME
11    echo "In $PWD : building DYNAMICO with options $*"
12    echo "Watch logfile $LOGFILE"
13
14    ./make_icosa $* > $LOGFILE 2>&1
15}
16 
17function build_dynamico()
18{
19    NAME=$1 ; shift
20    LOGFILE=$ROOT/logs/dynamico_${NAME}.log
21    BUILD=$ROOT/build_$NAME
22    build_dynamico_ $NAME $LOGFILE -arch $arch -job $job $* || ( tail $LOGFILE ; exit 1 )
23    cp -pr $BUILD/bin/icosa_gcm.exe  $ROOT/bin/icosa_$NAME.exe
24}
25
26function build_xios()
27{
28    LOGFILE=$1 ; shift
29    echo '# command used to build XIOS :' >> logs/build.sh
30    echo "./make_xios $*" >> logs/build.sh
31   
32    cd -P $ROOT/XIOS
33    echo "In $PWD : Building XIOS"
34    echo "Watch logfile $LOGFILE"
35    echo "./make_xios $*"
36    ./make_xios $* > $LOGFILE 2>&1
37}
38
39function main()
40{
41    rm -f tmp/build.sh
42    LOGFILE=$ROOT/logs/build_xios.log
43    build_xios $LOGFILE --arch $arch_XIOS $other_XIOS --job $job || ( tail $LOGFILE ; exit 1 )
44
45    cd $ROOT
46    # compile all variants in parallel
47#    build_dynamico serial -parallel none $FULL &
48    build_dynamico mpi -parallel mpi -with_xios $other $FULL &
49    build_dynamico mpi_omp -parallel mpi_omp -with_xios $other $FULL &
50    wait
51    # check success
52#    ls bin/icosa_serial.exe || exit 1
53    ls bin/icosa_mpi.exe || exit 1
54    ls bin/icosa_mpi_omp.exe || exit 1
55}
56
57FULL=$1
58source current_args
59rm -rf bin logs
60mkdir bin logs
61( main ) || ( echo ; echo "***************** Build FAILED ******************" )
62
63echo
64echo "You may now run create_runs.sh"
Note: See TracBrowser for help on using the repository browser.