Wiki » History » Version 18

Chris Cannam, 2014-02-13 02:43 PM

1 1 Luis Figueira
h1. Wiki
2 1 Luis Figueira
3 18 Chris Cannam
 * [[Deployment runthrough]]
4 18 Chris Cannam
5 18 Chris Cannam
6 2 Luis Figueira
h3. Some issues on building the compiled version of the MATLAB code
7 2 Luis Figueira
8 3 Luis Figueira
h4. Reading config files (m files using eval)
9 3 Luis Figueira
10 2 Luis Figueira
When reading/writing files - such as config files - not everything will behave like in the matlab console. 
11 2 Luis Figueira
12 11 Luis Figueira
The way the config files were being read was not working - was simply using eval. It was necessary to read the file manually, adapting the suggestion found here: http://stackoverflow.com/questions/185461/reading-input-m-file-in-a-main-m-file#185660
13 2 Luis Figueira
14 4 Luis Figueira
> (...)in a function we would create a text file, INP, containing our parameters. 
15 2 Luis Figueira
> We create this file in the directory returned by the ctfroot function. 
16 1 Luis Figueira
> Then, in MAIN, we would use the following to retrieve these parameters:
17 1 Luis Figueira
> 
18 3 Luis Figueira
<pre>
19 3 Luis Figueira
  eval(char(textread(fullfile(ctfroot, INP), '%s', 'whitespace', '');
20 3 Luis Figueira
</pre>
21 1 Luis Figueira
22 1 Luis Figueira
See commit:d9262cdbfb38d9262cdbfb38 on the jabuilder-int branch.
23 3 Luis Figueira
24 3 Luis Figueira
h4. Other input/output files
25 3 Luis Figueira
26 5 Luis Figueira
At the moment the input/output is done in the same folder where the the java class is being called from (hrir_final.mat and binsimecho.wav...).
27 3 Luis Figueira
28 1 Luis Figueira
h3. Building the isvr jar 
29 1 Luis Figueira
30 1 Luis Figueira
<pre>
31 1 Luis Figueira
> /Applications/MATLAB_R2013b.app/bin/mcc -W "java:uk.ac.soton.isvr,HumanEcho" -d ./scratch -T "link:lib" -v "class{HumanEcho:./webapp/WEB-INF/mcode/gen_echo.m}"
32 1 Luis Figueira
</pre>
33 1 Luis Figueira
34 1 Luis Figueira
h4. Contents of the isvr jar
35 1 Luis Figueira
36 1 Luis Figueira
<pre>
37 1 Luis Figueira
> jar tvf scratch/isvr.jar
38 1 Luis Figueira
     0 Tue Nov 26 16:47:42 GMT 2013 META-INF/
39 1 Luis Figueira
    68 Tue Nov 26 16:47:44 GMT 2013 META-INF/MANIFEST.MF
40 1 Luis Figueira
     0 Tue Nov 26 16:47:30 GMT 2013 uk/
41 1 Luis Figueira
     0 Tue Nov 26 16:47:30 GMT 2013 uk/ac/
42 1 Luis Figueira
     0 Tue Nov 26 16:47:30 GMT 2013 uk/ac/soton/
43 1 Luis Figueira
     0 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/
44 1 Luis Figueira
  3895 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/HumanEcho.class
45 1 Luis Figueira
   336 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/HumanEchoRemote.class
46 1 Luis Figueira
168802 Tue Nov 26 16:47:30 GMT 2013 uk/ac/soton/isvr/isvr.ctf
47 1 Luis Figueira
  1798 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/IsvrMCRFactory.class
48 6 Luis Figueira
</pre>
49 6 Luis Figueira
50 1 Luis Figueira
h3. Configuration 
51 6 Luis Figueira
52 17 Luis Figueira
The app configuration file can be found in @WebContent/WEB-INF/classes/myapp.properties@
53 6 Luis Figueira
54 7 Luis Figueira
h3. Logging
55 7 Luis Figueira
56 9 Luis Figueira
We are using log4j for logging. The log4j jar (1.2.17) is included in the repository. The configuration file is in @webapp/WEB-INF/classes/@
57 8 Luis Figueira
58 14 Luis Figueira
h2. Building the webapp with Javabuilder/MATLAB (using the precompiled isvr.jar)
59 1 Luis Figueira
60 12 Luis Figueira
* Download MATLAB MCR 2013b (8.2) version from this page: 
61 12 Luis Figueira
<pre>
62 12 Luis Figueira
http://www.mathworks.co.uk/products/compiler/mcr/
63 12 Luis Figueira
</pre>
64 15 Luis Figueira
65 15 Luis Figueira
h2. Tomcat 
66 15 Luis Figueira
67 16 Luis Figueira
* Using Tomcat 7 (Catalina). Download from 
68 16 Luis Figueira
<pre>
69 16 Luis Figueira
http://tomcat.apache.org/download-70.cgi
70 16 Luis Figueira
</pre>