/[escript]/trunk/mk
ViewVC logotype

Annotation of /trunk/mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 268 - (hide annotations)
Wed Nov 30 01:39:47 2005 UTC (13 years, 7 months ago) by jgs
File size: 5487 byte(s)
setup scons configuration to make and install python code

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

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26