Wiki » History » Version 10

Luis Figueira, 2013-12-06 04:07 PM

1 1 Luis Figueira
h1. Wiki
2 1 Luis Figueira
3 2 Luis Figueira
h3. Some issues on building the compiled version of the MATLAB code
4 2 Luis Figueira
5 3 Luis Figueira
h4. Reading config files (m files using eval)
6 3 Luis Figueira
7 2 Luis Figueira
When reading/writing files - such as config files - not everything will behave like in the matlab console. 
8 2 Luis Figueira
9 2 Luis Figueira
The way teh 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
10 2 Luis Figueira
11 4 Luis Figueira
> (...)in a function we would create a text file, INP, containing our parameters. 
12 2 Luis Figueira
> We create this file in the directory returned by the ctfroot function. 
13 1 Luis Figueira
> Then, in MAIN, we would use the following to retrieve these parameters:
14 1 Luis Figueira
> 
15 3 Luis Figueira
<pre>
16 3 Luis Figueira
  eval(char(textread(fullfile(ctfroot, INP), '%s', 'whitespace', '');
17 3 Luis Figueira
</pre>
18 1 Luis Figueira
19 1 Luis Figueira
See commit:d9262cdbfb38d9262cdbfb38 on the jabuilder-int branch.
20 3 Luis Figueira
21 3 Luis Figueira
h4. Other input/output files
22 3 Luis Figueira
23 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...).
24 3 Luis Figueira
25 1 Luis Figueira
h3. Building the isvr jar 
26 1 Luis Figueira
27 1 Luis Figueira
<pre>
28 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}"
29 1 Luis Figueira
</pre>
30 1 Luis Figueira
31 1 Luis Figueira
h4. Contents of the isvr jar
32 1 Luis Figueira
33 1 Luis Figueira
<pre>
34 1 Luis Figueira
> jar tvf scratch/isvr.jar
35 1 Luis Figueira
     0 Tue Nov 26 16:47:42 GMT 2013 META-INF/
36 1 Luis Figueira
    68 Tue Nov 26 16:47:44 GMT 2013 META-INF/MANIFEST.MF
37 1 Luis Figueira
     0 Tue Nov 26 16:47:30 GMT 2013 uk/
38 1 Luis Figueira
     0 Tue Nov 26 16:47:30 GMT 2013 uk/ac/
39 1 Luis Figueira
     0 Tue Nov 26 16:47:30 GMT 2013 uk/ac/soton/
40 1 Luis Figueira
     0 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/
41 1 Luis Figueira
  3895 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/HumanEcho.class
42 1 Luis Figueira
   336 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/HumanEchoRemote.class
43 1 Luis Figueira
168802 Tue Nov 26 16:47:30 GMT 2013 uk/ac/soton/isvr/isvr.ctf
44 1 Luis Figueira
  1798 Tue Nov 26 16:47:36 GMT 2013 uk/ac/soton/isvr/IsvrMCRFactory.class
45 6 Luis Figueira
</pre>
46 6 Luis Figueira
47 1 Luis Figueira
h3. Configuration 
48 6 Luis Figueira
49 9 Luis Figueira
The app configuration file can be found in @webapp/WEB-INF/classes/myapp.properties@ 
50 6 Luis Figueira
51 7 Luis Figueira
h3. Logging
52 7 Luis Figueira
53 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/@
54 8 Luis Figueira
55 8 Luis Figueira
h2. Using Eclipse
56 1 Luis Figueira
57 1 Luis Figueira
(tested on Eclipse Kepler Service Release 1 under OSX 10.9)
58 8 Luis Figueira
59 9 Luis Figueira
* Launch Eclipse, choosing @EchoWebApp@ as your workspace folder;
60 9 Luis Figueira
* Create a new Java project from existing sources
61 10 Luis Figueira
* Add Tomcat to Eclipse->Preferences->Runtime Environment (Tomcat 7)
62 10 Luis Figueira
* Add the servlet-api.jar library to Eclipse>Preferences (general, not project)>Java>BuildPath>User Libraries