annotate INSTALL.txt @ 67:b8f8ed1ef8dd tip

Provide .wav suffix in delivered filename
author Chris Cannam
date Tue, 30 Sep 2014 16:52:50 +0100
parents 84d02afe28e6
children
rev   line source
Chris@41 1
luis@33 2 === Build Instructions ===
luis@0 3
Chris@41 4
Chris@41 5 == Prerequisites ==
Chris@41 6
luis@34 7
luis@34 8 = MATLAB Compiler Runtime (MCR) =
luis@34 9
Chris@41 10 The MCR allows you to run compiled MATLAB applications or components
Chris@41 11 without installing MATLAB.
Chris@41 12
Chris@41 13 In this WebApp we are redistributing pre-compiled MATLAB code in
Chris@41 14 isvr.jar (found at WebContent/WEB-INF/lib/isvr.jar).
luis@34 15
luis@34 16 To install MCR, please proceed to:
Chris@41 17
luis@34 18 http://www.mathworks.co.uk/products/compiler/mcr/
luis@34 19
Chris@41 20 and follow the installer's instructions. You need to install MATLAB
Chris@41 21 MCR 2013b (8.2).
luis@35 22
Chris@41 23 Attention: take a note of the environment variable DYLD_LIBRARY_PATH
Chris@41 24 which the MCR installer will show - if this is not correctly set the
Chris@41 25 webapp will not run.
Chris@41 26
luis@34 27
luis@34 28 = System variables =
luis@34 29
Chris@41 30 On OSX you need to do the following (if you installed MCR to the
Chris@41 31 /Applications/MATLAB/MATLAB_Compiler_Runtime/ folder):
luis@0 32
luis@35 33 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/MATLAB/MATLAB_Compiler_Runtime/v82/runtime/maci64:/Applications/MATLAB/MATLAB_Compiler_Runtime/v82/sys/os/maci64:/Applications/MATLAB/MATLAB_Compiler_Runtime/v82/bin/maci64
luis@0 34
luis@35 35 (Please not that only the above paths are necessary.)
luis@35 36
luis@37 37 If you have MATLAB installed, the path is probably:
luis@35 38
luis@35 39 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/MATLAB_R2013b.app/sys/os/maci64/:/Applications/MATLAB_R2013b.app/runtime/maci64/:/Applications/MATLAB_R2013b.app/bin/maci64/
luis@34 40
Chris@41 41
luis@34 42 = Other jar files =
luis@34 43
luis@35 44 1. Copy your web server's servlet-api.jar file into this directory:
luis@0 45
Chris@41 46 (For example, on Linux you might find this file in /usr/share/java/tomcat7/servlet-api.jar)
Chris@41 47
luis@35 48 cp $CATALINA_BASE/libs/servlet-api.jar .
luis@35 49
Chris@41 50
Chris@41 51 2. Copy the javabuilder.jar file from your MATLAB or MCR install root
Chris@41 52 into the webapp lib folder:
luis@35 53
luis@35 54 (if you installed the MATLAB MCR to /Applications/MATLAB/MATLAB_Compiler_Runtime/)
luis@35 55
luis@35 56 cp /Applications/MATLAB/MATLAB_Compiler_Runtime/v82/toolbox/javabuilder/jar/javabuilder.jar ./WebContent/WEB-INF/lib/
luis@34 57
luis@34 58
luis@34 59 == Building the Web Application (echoapp.war) ==
luis@0 60
Chris@43 61 3. Run 'ant -f build.xml'. This should create the echoapp.war file. If
Chris@41 62 this fails, follow "Compiling and Generating the echoapp.war file"
Chris@41 63 instructions below.
luis@0 64
luis@35 65 4. Copy the echoapp.war file to your web server's webapps folder:
luis@35 66
luis@35 67 cp echoapp.war $CATALINA_BASE/webapps
luis@0 68
luis@33 69 5. Start/Restart Tomcat, making sure the webapp is correctly deployed;
luis@0 70
luis@35 71 6. Start the web server and navigate in a browser to the following url:
luis@0 72
luis@35 73 http://localhost:8080/echoapp/
luis@0 74
luis@33 75
luis@33 76 == Compiling and Generating the echoapp.war file ==
luis@33 77
Chris@43 78 Note: You only need to follow this instructions if run 'ant -f build.xml'
Chris@41 79 correctly and you were unable to generate the echoapp.war file. The
Chris@41 80 steps described in this section assume that you already have a working
Chris@41 81 version of the isvr.jar package. The isvr.jar file should be located
Chris@41 82 in WebContent/WEB-INF/lib/isvr.jar.
luis@33 83
Chris@41 84 1. Copy the deployed component from the scratch folder to the web
Chris@41 85 applications lib folder:
luis@33 86
luis@33 87 cp ./scratch/isvr.jar ./WebContent/WEB-INF/lib
luis@33 88
Chris@41 89 2. Compile the web application, making sure to reference the
Chris@41 90 servlet-api.jar, the deployed component jar, and the javabuilder.jar:
luis@33 91
luis@33 92 javac -cp servlet-api.jar:./WebContent/WEB-INF/lib/javabuilder.jar:./WebContent/WEB-INF/lib/examples.jar: -d ./WebContent/WEB-INF/classes ./src/HumanEchoServlet.class
luis@0 93
luis@0 94 This will create the servlet:
luis@0 95
luis@33 96 WebContent/WEB-INF/classes/HumanEchoServlet.class
luis@0 97
luis@33 98 3.4. Navigate to the web applications directory and create the war file.
luis@0 99
luis@33 100 cd WebContent
luis@34 101 jar -cvf ../echoapp.war .
luis@0 102 cd ..
luis@34 103
luis@34 104
luis@34 105 == Building isvr.jar ==
luis@34 106
Chris@41 107 If you have access to the MATLAB code and wish to make any changes to
Chris@41 108 its core functionality, you can recompile the isvr.jar package.
luis@34 109
Chris@41 110 You can only compile the isvr.jar if you have MATLAB and the
Chris@41 111 JavaBuilder toolbox: please check this with you systems administrator.
luis@34 112
Chris@43 113 To compile isvr.jar, simply run 'ant -f build-isvr.xml'.
Chris@41 114
Chris@41 115 If this fails, you may be able to recompile the MATLAB component by
Chris@41 116 running the following MCC command:
luis@34 117
Chris@46 118 /Applications/MATLAB_R2013b.app/bin/mcc -W "java:uk.ac.soton.isvr,HumanEcho" -d ./scratch -T "link:lib" -v "class{HumanEcho:./mcode/simulateBinauralSignals.m}"
luis@34 119