martingkelly / imms

The new home of IMMS after Google Code
http://www.luminal.org/wiki/index.php/IMMS
GNU General Public License v2.0
4 stars 2 forks source link

Analyzer is not a completely optional component #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Analyzer is not a completely optional component of IMMS. If you attempt to 
build IMMS with the --disable-analyzer option you receive several torch-related 
errors during compilation.

Repro steps:
1. Attempt to build IMMS on a system that does not have torch installed
2. Run './configure --disable-analyzer'. It should complete with no issues.
3. Run 'make'. Notice several torch-related errors (usually "No such file or 
directory" while attempting to include header files)

Notes and plan for solution:

It is possible to work around this by wrapping torch code with '#ifdef 
WITH_TORCH' pragmas. However, peppering the code with a number of #ifdefs is 
not the most elegant, readable, or maintainable solution. What we would like to 
do is to isolate all of the acoustic analysis logic in immscore behind an 
interface. Then we can have two implementations of the interface: one that 
depends on Torch and does all the real logic, and one that is a blank dummy. We 
should then only need one #ifdef to select between the two implementations, 
which can be configured with --disable-analyzer.

While the code could be refactored to work like this, that is a large task. 
Changing the code is probably not worth doing in and of itself, unless it also 
buys us something else. For now, since all of the platforms where IMMS runs can 
successfully compile torch (and thus the analyzer) this is a low priority task. 
If we run into a platform that cannot compile torch we could then look at 
refactoring the code to fix this bug.

Original issue reported on code.google.com by dave.sch...@gmail.com on 16 Oct 2010 at 6:00

GoogleCodeExporter commented 9 years ago
Could we also follow up on fixing the torch code so you don't have to perform 
manual steps on OSX? I'm not sure if this is still relevant or if the code has 
been fixed in the meantime.

Credit to Hans for deducing the steps.

--
To build torch on OSX

Extract into Torch3/ then cd Torch3, copy the appropriate .cfg file from
config/ to ./ then edit it so that

       packages = gradients distributions

Then run ./xmake

Now for the manual bit,

       mkdir -p /usr/local/include/torch
       cp core/*.h gradients/*.h distributions/*.h \
               /usr/local/include/torch
       cp libs/*/libtorch.a /usr/local/lib

Original comment by dave.sch...@gmail.com on 16 Oct 2010 at 6:09

GoogleCodeExporter commented 9 years ago
We should also see if building analyzer works with torch3, torch5, or both.

Original comment by dave.sch...@gmail.com on 16 Oct 2010 at 6:09

GoogleCodeExporter commented 9 years ago

Original comment by dave.sch...@gmail.com on 18 Oct 2010 at 6:14

GoogleCodeExporter commented 9 years ago

Original comment by dave.sch...@gmail.com on 19 Nov 2010 at 4:58