#!/bin/sh # Installing the necessary software to execute the RCVSIM human # cardiovascular simulator, and then creating an executable shell # script, called rcvsim, which is linked to /usr/local/bin and # linking the MATLAB executable, called simulate.mexlx, to the # MATLAB path, if it exists. # Defining directories. DIRBIN=$PWD/bin DIRSRC=$PWD/src DIRLIB=$PWD/lib # Checkinging if WFDB version 10.1.6 or greater is installed. If not, # installing this software. FLAG=`$DIRBIN/check_wfdb install` if test "$FLAG" -eq 1 then cd lib tar xvzf wfdb-10.1.6.tar.gz cd wfdb-10.1.6 ./configure make make install cd .. rm -rf wfdb-10.1.6 cd .. fi # Checking if Linux Redhat 6.2 or greater is installed. If so, # installing libc5 libraries and linker. $DIRBIN/check_redhat install # Creating shell executable which also sets LD_LIBRARY_PATH. rm -f $DIRBIN/rcvsim echo '#!/bin/sh' > $DIRBIN/rcvsim echo 'DIRLIB='$DIRLIB >> $DIRBIN/rcvsim echo 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:'$DIRLIB >> $DIRBIN/rcvsim echo 'export LD_LIBRARY_PATH' >> $DIRBIN/rcvsim echo 'WFDB='$DIRBIN':$WFDB' >> $DIRBIN/rcvsim echo 'export WFDB' >> $DIRBIN/rcvsim echo $DIRSRC'/rcvsim $1 $2' >> $DIRBIN/rcvsim chmod 755 $DIRBIN/rcvsim # Linking both shell and MATLAB executable. rm -f /usr/local/bin/rcvsim ln -s $DIRBIN/rcvsim /usr/local/bin/. MATLABDIR=`locate toolbox/matlab/general -n 1` rm -f $MATLABDIR/simulate.mexlx rm -f $MATLABDIR/simulate.m ln -s $DIRSRC/simulate.mexlx $MATLABDIR/. ln -s $DIRSRC/simulate.m $MATLABDIR/.