1 |
#!/bin/bash |
2 |
|
3 |
# $Id$ |
4 |
# An explicit building script for esys |
5 |
|
6 |
#********************************************************************** |
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 finley" |
14 |
|
15 |
# the tests to run |
16 |
TESTS="escript finley" |
17 |
|
18 |
# use this setting for local developmental builds |
19 |
ENVVARS="DODEBUG=YES" |
20 |
|
21 |
if [ "$2" == "NODEBUG" ]; |
22 |
then |
23 |
ENVVARS="DODEBUG=NO" |
24 |
fi |
25 |
|
26 |
# use this setting for production installs on altix |
27 |
# ** NB: overwrites centrally installed esys libraries on altix *** |
28 |
#ENVVARS="L_INSTLIB_DIR=/raid2/tools/esys/lib L_PYTH_DIR=/raid2/tools/esys/esys" |
29 |
|
30 |
# ensure required symlinks are setup first |
31 |
(cd escript/inc; if [ ! -h escript ]; then ln -s ../src escript; fi) |
32 |
(cd esysUtils/inc; if [ ! -h esysUtils ]; then ln -s ../src esysUtils; fi) |
33 |
(cd finley/inc; if [ ! -h finley ]; then ln -s ../src finley; fi) |
34 |
|
35 |
(cd escript; if [ ! -h Makefile ]; then ln -s ./escript.mk Makefile; fi) |
36 |
(cd esysUtils; if [ ! -h Makefile ]; then ln -s ./esysUtils.mk Makefile; fi) |
37 |
(cd finley; if [ ! -h Makefile ]; then ln -s ./finley.mk Makefile; fi) |
38 |
(cd tools/mmio; if [ ! -h Makefile ]; then ln -s ./mmio.mk Makefile; fi) |
39 |
(cd tools/CppUnitTest; if [ ! -h Makefile ]; then ln -s ./CppUnitTest.mk Makefile; fi) |
40 |
|
41 |
# clean all modules |
42 |
if [ "$1" == "clean" ]; |
43 |
then |
44 |
for module in $MODULES ; do \ |
45 |
(echo Cleaning: $module; cd $module; gmake clean) \ |
46 |
done |
47 |
exit |
48 |
fi |
49 |
|
50 |
# uninstall all modules |
51 |
if [ "$1" == "uninstall" ]; |
52 |
then |
53 |
for module in $MODULES ; do \ |
54 |
(echo Cleaning: $module; cd $module; gmake uninstall) \ |
55 |
done |
56 |
exit |
57 |
fi |
58 |
|
59 |
# default case - just build all modules |
60 |
for module in $MODULES ; do \ |
61 |
(echo Building: $module; cd $module; env $ENVVARS gmake -j 10) \ |
62 |
done |
63 |
|
64 |
# install all modules |
65 |
if [ "$1" == "install" ]; |
66 |
then |
67 |
for module in $MODULES ; do \ |
68 |
(echo Installing: $module; cd $module; env $ENVVARS gmake install) \ |
69 |
done |
70 |
(cd esys; if [ ! -h escriptcpp.so ]; then ln -s ../lib/libescriptcpp.so escriptcpp.so; fi) |
71 |
(cd esys; if [ ! -h finleycpp.so ]; then ln -s ../lib/libfinleycpp.so finleycpp.so; fi) |
72 |
fi |
73 |
|
74 |
# run the unit tests |
75 |
if [ "$1" == "unit_test" ] |
76 |
then |
77 |
for module in $TESTS |
78 |
do |
79 |
echo "Running unit tests for: $module" |
80 |
cd $ESYS_ROOT/$module/test |
81 |
unit_test |
82 |
done |
83 |
fi |
84 |
|
85 |
# run the python tests |
86 |
if [ "$1" == "py_test" ] |
87 |
then |
88 |
for module in $TESTS |
89 |
do |
90 |
echo "Running python tests for: $module" |
91 |
if [ "$module" == "finley" ] |
92 |
then |
93 |
cd $ESYS_ROOT/$module/test/python |
94 |
python ImportTest.py |
95 |
python SimpleSolve.py |
96 |
python GradTest.py |
97 |
elif [ "$module" == "escript" ] |
98 |
then |
99 |
cd $ESYS_ROOT/$module/test/python |
100 |
python ImportTest.py |
101 |
python BinaryOps.py |
102 |
python UnaryOps.py |
103 |
python SliceGetting.py |
104 |
python SliceSetting.py |
105 |
python MiscTests.py |
106 |
fi |
107 |
done |
108 |
fi |