/[escript]/trunk/mk
ViewVC logotype

Diff of /trunk/mk

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/mk revision 103 by jgs, Fri Dec 17 07:43:04 2004 UTC trunk/mk revision 171 by jgs, Fri Nov 11 02:02:37 2005 UTC
# Line 1  Line 1 
1  #!/bin/env bash  #!/bin/bash
2    
3  # $Id$  # $Id$
4  # a brutal building script for esys  # An explicit building script for esys
5    
6  export ESYS_ROOT=${ESYS_ROOT:=`pwd`}  #**********************************************************************
7    # NB: this script is setup to perform default developmental builds
8    # change any settings you require, but PLEASE do not check any changes
9    # to this script back into the repository - talk to Jon first
10    #**********************************************************************
11    
12    # the modules to make
13    MODULES="tools/CppUnitTest tools/mmio esysUtils escript paso finley bruce modellib"
14    
15    # the modules to test
16    TESTS="escript bruce finley"
17    
18    # the python tests to run
19    #FINLEY_PYTESTS="ImportTest.py SimpleSolve.py GradTest.py test_linearPDEsOnFinley.py test_generators.py test_visualization_interface.py"
20    FINLEY_PYTESTS="ImportTest.py SimpleSolve.py GradTest.py"
21    ESCRIPT_PYTESTS="ImportTest.py BinaryOps.py UnaryOps.py SliceGetting.py SliceSetting.py MiscTests.py newEscriptTests.py DataVariableTests.py test_xml.py"
22    BRUCE_PYTESTS="ImportTest.py BruceTest.py"
23    
24  MODULES="tools/CppUnitTest tools/mmio esysUtils escript finley"  # use this setting for local developmental builds
25  #MODULES="escript finley"  ENVVARS="DODEBUG=YES"
26    
27  if [ "$1" == "clean" ];  if [ "$2" == "DEBUG" ]
28  then  then
29      for module in $MODULES ; do \      ENVVARS="DODEBUG=YES"
30          (echo Cleaning: $module; cd $module; gmake clean) \  fi
31    
32    if [ "$2" == "NODEBUG" ]
33    then
34        ENVVARS="DODEBUG=NO"
35    fi
36    
37    # use this setting for production installs on altix
38    # ** NB: overwrites centrally installed esys libraries on altix ***
39    #ENVVARS="$ENVVARS L_INSTLIB_DIR=/raid2/tools/esys/lib L_PYTH_DIR=/raid2/tools/esys/esys"
40    
41    # ensure required symlinks are setup first
42    (cd esysUtils/inc; if [ ! -h esysUtils ]; then ln -s ../src esysUtils; fi)
43    (cd escript/inc; if [ ! -h escript ]; then ln -s ../src escript; fi)
44    (cd finley/inc; if [ ! -h finley ]; then ln -s ../src finley; fi)
45    (cd paso/inc; if [ ! -h paso ]; then ln -s ../src paso; fi)
46    (cd bruce/inc; if [ ! -h bruce ]; then ln -s ../src bruce; fi)
47    
48    (cd tools/mmio; if [ ! -h Makefile ]; then ln -s ./mmio.mk Makefile; fi)
49    (cd tools/CppUnitTest; if [ ! -h Makefile ]; then ln -s ./CppUnitTest.mk Makefile; fi)
50    (cd esysUtils; if [ ! -h Makefile ]; then ln -s ./esysUtils.mk Makefile; fi)
51    (cd escript; if [ ! -h Makefile ]; then ln -s ./escript.mk Makefile; fi)
52    (cd finley; if [ ! -h Makefile ]; then ln -s ./finley.mk Makefile; fi)
53    (cd paso; if [ ! -h Makefile ]; then ln -s ./paso.mk Makefile; fi)
54    (cd bruce; if [ ! -h Makefile ]; then ln -s ./bruce.mk Makefile; fi)
55    (cd modellib; if [ ! -h Makefile ]; then ln -s ./modellib.mk Makefile; fi)
56    
57    # clean all modules
58    if [ "$1" == "clean" ]
59    then
60        for module in $MODULES ; do
61            (echo Cleaning: $module; cd $module; make clean)
62      done      done
63          exit          exit 0
64  fi  fi
65    
66  (cd escript/lib; if [ ! -e py_src ]; then mkdir py_src; fi)  # uninstall all modules
67    if [ "$1" == "uninstall" ]
68    then
69        for module in $MODULES ; do
70            (echo Cleaning: $module; cd $module; make clean)
71        done
72        for module in $MODULES ; do
73            (echo Uninstalling: $module; cd $module; make uninstall)
74        done
75            exit 0
76    fi
77    
78  (cd escript/inc; if [ ! -e escript ]; then ln -s ../src escript; fi)  # run the unit tests
79  (cd esysUtils/inc; if [ ! -e esysUtils ]; then ln -s ../src esysUtils; fi)  if [ "$1" == "unit_test" ]
80  (cd finley/inc; if [ ! -e finley ]; then ln -s ../src finley; fi)  then
81        for module in $TESTS
82        do
83        echo "Running unit tests for: $module"
84        cd $ESYS_ROOT/$module/test
85        ./unit_test
86            if [ $? != 0 ]
87            then
88              echo Unit Testing FAILED for module: $module
89              exit 1
90            fi
91        done
92        exit 0
93    fi
94    
95  (cd escript; if [ ! -e Makefile ]; then ln -s ./escript.mk Makefile; fi)  # run the python tests
96  (cd esysUtils; if [ ! -e Makefile ]; then ln -s ./esysUtils.mk Makefile; fi)  if [ "$1" == "py_test" ]
97  (cd finley; if [ ! -e Makefile ]; then ln -s ./finley.mk Makefile; fi)  then
98  (cd tools/mmio; if [ ! -e Makefile ]; then ln -s ./mmio.mk Makefile; fi)      for module in $TESTS
99  (cd tools/CppUnitTest; if [ ! -e Makefile ]; then ln -s ./CppUnitTest.mk Makefile; fi)      do
100        echo "Running python tests for: $module"
101        cd $ESYS_ROOT/$module/test/python
102        if [ "$module" == "finley" ]
103        then
104                for pytest in $FINLEY_PYTESTS
105                do
106                echo "Running python test: $pytest"
107                    python $pytest
108                    if [ $? != 0 ]
109                    then
110                      echo Python Testing FAILED for $pytest in module $module
111                      exit 1
112                    fi
113                done
114        elif [ "$module" == "escript" ]
115        then
116                for pytest in $ESCRIPT_PYTESTS
117                do
118                echo "Running python test: $pytest"
119                    python $pytest
120                    if [ $? != 0 ]
121                    then
122                      echo Python Testing FAILED for $pytest in module $module
123                      exit 1
124                    fi
125                done
126        elif [ "$module" == "bruce" ]
127        then
128                for pytest in $BRUCE_PYTESTS
129                do
130                echo "Running python test: $pytest"
131                    python $pytest
132                    if [ $? != 0 ]
133                    then
134                      echo Python Testing FAILED for $pytest in module $module
135                      exit 1
136                    fi
137                done
138        fi
139        done
140        exit 0
141    fi
142    
143  for module in $MODULES ; do \  # default case - just build all modules
144      (echo Building: $module; cd $module; gmake) \  echo "*************** build ************************************"
145    for module in $MODULES ; do
146        (echo Building: $module; cd $module; env $ENVVARS make -j 10)
147            if [ $? != 0 ]
148            then
149                echo Build FAILED for module: $module
150                exit 1
151            fi
152  done  done
153    
154  if [ "$1" == "install" ];  # install all modules
155    if [ "$1" == "install" ]
156  then  then
157            echo "***************installation ************************************"
158      for module in $MODULES ; do \      for module in $MODULES ; do \
159          (echo Installing: $module; cd $module; gmake install) \                  echo ENVVARS = $ENVVARS
160            (echo Installing: $module; cd $module; env $ENVVARS make install)
161                    if [ $? != 0 ]
162                    then
163                      echo Installation FAILED for module: $module
164                      exit 1
165                    fi
166      done      done
167      (cd esys; if [ ! -e escriptcpp.so ]; then ln -s ../lib/libescriptcpp.so escriptcpp.so; fi)          (cd esys; touch __init__.py)
168      (cd esys; if [ ! -e finleycpp.so ]; then ln -s ../lib/libfinleycpp.so finleycpp.so; fi)          (cd esys/escript; if [ ! -h escriptcpp.so ]; then ln -s ../../lib/libescriptcpp.so escriptcpp.so; fi)
169            (cd esys/finley; if [ ! -h finleycpp.so ]; then ln -s ../../lib/libfinleycpp.so finleycpp.so; fi)
170            (cd esys/bruce; if [ ! -h brucecpp.so ]; then ln -s ../../lib/libbrucecpp.so brucecpp.so; fi)
171            exit 0
172  fi  fi
   

Legend:
Removed from v.103  
changed lines
  Added in v.171

  ViewVC Help
Powered by ViewVC 1.1.26