Changeset 1139 for trunk/examples


Ignore:
Timestamp:
Sep 3, 2008 12:01:50 PM (16 years ago)
Author:
dkearney
Message:

adding example of compiling matlab. this uses simsim to generate a temporary driver.xml and automatically deletes it.

Location:
trunk/examples/app-fermi/matlab/compiled
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/app-fermi/matlab/compiled/Makefile

    r1004 r1139  
    33${APPNAME}: fermi_main.m fermi.m
    44        mcc -m -R -nojvm -I /apps/rappture/lib/matlab -o $@ $^
     5
     6all: ${APPNAME}
    57
    68install: ${APPNAME}
     
    1012#       mv readme.txt ../bin/$^.readme
    1113#       LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/apps/rappture/lib `pwd`/../bin/run_$^.sh /apps/matlab/mcr `pwd`/driver.xml `pwd`/../data
    12         LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/apps/rappture/lib `pwd`/run_$^.sh /apps/matlab/mcr `pwd`/driver.xml
    13         rm -f run*.xml
    14         echo "Install Successful"
     14        simsim --tool tool.xml --driver-only driver.${APPNAME}
     15        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/apps/rappture/lib `pwd`/run_$^.sh /apps/matlab/mcr `pwd`/driver.${APPNAME}
     16        rm -f run*.xml driver.${APPNAME}
     17        @echo "Install Successful"
    1518
    1619clean:
    17         rm -rf ${APPNAME} ${APPNAME}_main.c ${APPNAME}.ctf \
    18                 ${APPNAME}.prj ${APPNAME}_mcc_component_data.c run_${APPNAME}.sh \
    19                 mccExcludedFiles.log readme.txt ${APPNAME}_mcr
     20        rm -rf ${APPNAME} \
     21                ${APPNAME}_main.c \
     22                ${APPNAME}.ctf \
     23                ${APPNAME}.prj \
     24                ${APPNAME}_mcc_component_data.c \
     25                run_${APPNAME}.sh \
     26                mccExcludedFiles.log \
     27                readme.txt \
     28                ${APPNAME}_mcr
    2029
    2130distclean: clean
  • trunk/examples/app-fermi/matlab/compiled/fermi.m

    r1004 r1139  
    11% ----------------------------------------------------------------------
    2 %  EXAMPLE: Fermi-Dirac function in Octave.
     2%  EXAMPLE: Fermi-Dirac function in Matlab.
    33%
    44%  This script represents a newly written application with rappture
     
    88%  AUTHOR:  Michael McLennan, Purdue University
    99%  AUTHOR:  Derrick Kearney, Purdue University
    10 %  Copyright (c) 2004-2007  Purdue Research Foundation
     10%  Copyright (c) 2004-2008  Purdue Research Foundation
    1111%
    1212%  See the file "license.terms" for information on usage and
     
    1414% ======================================================================
    1515
    16 function retVal=fermi(infile);
     16function retVal=fermi;
    1717
    18 % open our xml input file.
    19 lib = rpLib(infile);
     18% We open the xml file in the main function and make lib global
     19global lib;
    2020
    2121% retrieve user specified data out of the input file
  • trunk/examples/app-fermi/matlab/compiled/fermi_main.m

    r1004 r1139  
    11function fermi_main(infile)
    22
     3global lib;
     4
    35try
    4     fermi(infile);
     6    lib = rpLib(infile);
     7    fermi;
    58catch
    6     lasterr
     9    lastmsg = lasterr
    710    fid = fopen('errorDetected.txt','wt');
    811    fprintf(fid,'1\n');
     12    fprintf(fid,'%s\n',lastmsg);
    913    fclose(fid);
     14    append = 1;
     15    rpLibPutString(lib,'output.log',lastmsg,append)
     16    rpLibResult(lib,1);
    1017end
Note: See TracChangeset for help on using the changeset viewer.