1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
#!/bin/sh
if test -z "$PCx_ARCH" ; then
PCx_ARCH=`./pcxarch`; export PCx_ARCH
fi
if test "$1" = "PCx_wssmp" ; then
echo ;
echo "***************************************************";
echo Building PCx with the IBM WSSMP Cholesky solver....;
echo "***************************************************";
echo ;
if test -z "$WSSMP_LIB" ; then
if (test -f wssmp/libwssmpp2.a) then
WSSMP_LIB=../wssmp/libwssmpp2.a
else
if test -f wssmp/libwssmp.a ; then
WSSMP_LIB=../wssmp/libwssmp.a;
else
echo WSSMP library not found in ./wssmp/ - aborting ;
exit 1 ;
fi
fi
fi
export WSSMP_LIB ;
# go ahead and make it
TARGETDIR=.; export TARGETDIR;
make $1 ;
else
# here if user typed "build PCx_NgPeyton" or "build PCx" or "build"
if (test "$1" = "PCx_NgPeyton" -o "$1" = "PCx" -o -z "$1") then
echo ;
echo "***************************************************";
echo Building PCx with the Ng Peyton Cholesky solver....
echo "***************************************************";
echo ;
if test -z "$NG_LIB" ; then
NG_LIB=../Ng-Peyton/cholesky.a
if (test ! -f Ng-Peyton/cholesky.a) then
if (test -d Ng-Peyton) then
cd Ng-Peyton;
make;
cd ../ ;
else
echo No directory ./Ng-Peyton, aborting.... ;
exit 1 ;
fi
fi
if (test ! -f Ng-Peyton/cholesky.a) then
echo Tried to build cholesky.a in Ng-Peyton, but ;
echo this file was apparently not created. ;
fi
export NG_LIB ;
fi
# go ahead and make it
TARGETDIR=.; export TARGETDIR;
make $1 ;
else
if test "$1" = "PCx_mysolver" ; then
echo ;
echo "***********************************************";
echo Building PCx with the user-supplied solver ;
echo Requires file ./SRC/mysolver.c and ;
echo library ./mysolver/libmysolver.a to be present ;
echo "***********************************************";
echo ;
if (test ! -f ./SRC/mysolver.c) then
echo File ./SRC/mysolver.c not present - aborting ;
exit 1 ;
fi
if (test ! -f ./mysolver/libmysolver.a) then
echo Library ./mysolver/libmysolver.a not present - aborting ;
exit 1 ;
fi
# go ahead and make PCx_mysolver
TARGETDIR=.; export TARGETDIR;
make $1 ;
else
if test "$1" = "mex" ; then
echo ;
echo "***********************************************";
echo The Matlab Interface is only available with ;
echo the Ng-Peyton solver, checking its availability.... ;
echo ;
if test -z "$NG_LIB" ; then
NG_LIB=../Ng-Peyton/cholesky.a ;
if (test ! -f Ng-Peyton/cholesky.a) then
if (test -d Ng-Peyton) then
cd Ng-Peyton ;
echo ;
echo Building Ng-Peyton library..... ;
echo "***********************************************";
make;
cd ../ ;
else
echo No directory ./Ng-Peyton, aborting.... ;
echo ;
echo "***********************************************";
exit 1 ;
fi
else
echo ;
echo Found! ;
echo
fi
if (test ! -f Ng-Peyton/cholesky.a) then
echo Tried to build cholesky.a in Ng-Peyton, but ;
echo this file was apparently not created. ;
echo Aborting.....
exit ;
fi
export NG_LIB ;
export MEX ;
make mex ;
echo ;
echo Now set your MATLABPATH to include PCx/mex, and you ;
echo should be able to run PCx.m from the MATLAB prompt. ;
echo Type 'help PCx' on the prompt for syntax information. ;
echo "***********************************************" ;
else
echo Argument "$1" not recognized - aborting.... ;
echo ;
exit 1 ;
fi
fi
fi
fi
fi
|