IMMS on Windows is currently experimental. Here are some instructions to get it running under Cygwin.
1. Install cygwin (download and run setup.exe from www.cygwin.com )
2. Install the following cygwin binaries (no source needed):
- sqlite3-devel
- libglib2.0-devel
- automake
- cygport
- gcc4
- gcc4-fortran (for building fftw3)
- pkg-config (so aclocal can find the PKG_CHECK_MODULES macro)
- libbz2-devel (for pcre)
- readline (for pcre)
- libpcre-devel
- libfftw3-devel
Cygwin should pull in the needed dependencies.
3. Sync IMMS source code from the repository
(use something like:
> svn checkout http://imms.googlecode.com/svn/trunk/ imms-read-only
or see http://code.google.com/p/imms/source/checkout )
4. Build Torch:
Download 'Torch 3 src' from http://www.torch.ch/downloads.php
Copy the makefile 'config/Makefile_options_Linux' to 'Makefile_options_Cygwin_NT-5.1' in the main Torch3 directory.
Edit the makefile and remove the '-mcpu=' switches
Set 'PACKAGES = distributions gradients kernels'
In the cygwin console, in the Torch3 directory, run
make depend
make
When torch has finished compiling, copy Torch3\lib\CYGWIN_NT-5.1_OPT_FLOAT\libtorch.a to C:\cygwin\lib , or wherever you store your packages
Copy the header files from core, distributions, gradients, and kernels folders to a new folder - C:\cygwin\usr\include\torch
5. Build sox (by hand; currently there is no sox cygwin package)
Download the source from http://sox.sourceforge.net/ and unpack
Build with
./configure
make -s (-s is specified in the INSTALL doc)
make install
6. Fix up two variable names (technical details: there is a bug in g++ pre 4.5.0 that causes the linker to add an extra _ underscore on the front of variable names. This causes building imms to fail with the error "undefined reference to `__binary____data_svm_similarity_start". For more details see these threads. Note: If you build a newer version of g++ or find another way around this, please email the list.)
Edit model/model.cc
Remove the leading _ from the variables "_binary____data_svm_similarity" and "_binary____data_svm_similarity_end".
7. cd back to the IMMS dir and run this to build immsd
make
./configure
make
8. Done! :D You should now be able to launch immsd.exe from the command line and see it running:
>immsd
>immsd: version 3.1.0-rc10 ready...
Troubleshooting
Q: When trying to build imms, ./configure breaks with
./configure: line 4495: syntax error near unexpected token `pcre,'
./configure: line 4495: `PKG_CHECK_MODULES(pcre, libpcre, , with_pcre=no)'
A: the automake system can't find the definition of the PKG_CHECK_MODULES macro, which is usually in pkg.m4 (in a location like /usr/share/aclocal/pkg.m4). Try running 'autoconf' first by hand to pick up the definition, then re-run ./configure.
Q: IMMS doesn't detect that I have sqlite/pcre/fftw installed, even though I have the packages!
A: Did you have Cygwin previously installed, or did you install some Cygwin packages after running autoconf? Try running autoconf again so the configure system can pick up the paths of the new packages.
Q: When building IMMS under cygwin or fftw with cygport I get the error
"checking for C compiler default output file name...
configure: error: in `/usr/src/fftw3-3.2-1/build/float':
configure: error: C compiler cannot create executables"
A: Check your config.log. Does it say something like
configure:3034: checking for gcc
configure:3061: result: gcc-4
configure:3293: checking for C compiler version
configure:3301: gcc-4 --version >&5
/usr/src/fftw3-3.2-1/src/fftw-3.2/configure: line 3303: gcc-4: command not found
or
configure:2256: checking for C++ compiler version
configure:2265: g++ --version >&5
g++.exe (GCC) 3.4.5 (mingw-vista special r3)
?
If so, you may be seeing this because you only have gcc version 3 installed; not gcc version 4 (which fftw requires??). Check out /usr/bin and see if you have executables like g++-3.exe, gcc-3.exe, and cpp-3.exe rather than the '-4' versions. If this is the case, simply install the 'gcc4-core' Cygwin package.
Q: When building fftw I get an error like
checking for Fortran 77 libraries of gfortran-4...
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... configure: error: in `/usr/src/f
ftw3-3.2.2-1/build/float':
configure: error: cannot compile a simple Fortran program
See `config.log' for more details.
A: You need to install gcc4-fortran.
Q: Even after installing fftw, when I run ./configure for imms it still doesn't think fftw is installed.
A: Check your config.log. Does it say something like
"configure:4753: checking for FFTW
configure:4760: $PKG_CONFIG --exists --print-errors "fftw3 >= 3.0"
Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found
configure:4763: $? = 1
configure:4776: $PKG_CONFIG --exists --print-errors "fftw3 >= 3.0"
Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found
configure:4779: $? = 1
No package 'fftw3' found
configure:4806: result: no
configure:4819: WARNING: ******************************************************
configure:4821: WARNING: "fftw3 >= 3.0 required for analyzer and missing"
configure:4823: WARNING: "Acoustic analyzer will not be built"
configure:4825: WARNING: ******************************************************"
? If so, do you have fftw.pc in the place you build fftw? (e.g. /usr/src/fftw-3.2). You can then probably just export that package directory as configure asks. Do something like:
>PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/src/fftw-3.2
>export PKG_CONFIG_PATH
and then re-run ./configure.
Q: When building I get errors like
model/model.cc:110: undefined reference to `__binary____data_svm_similarity_start'
A: This is a bug in g++ versions prior to 4.5.0 - the linker is adding an extra _ underscore on the front of symbol names. This means the linker is unable to find these sumbols and fails to link. For more details see these threads .
To fix this you can get a copy of g++ version 4.5.0 or later (if you try this and it works please notify the list). You can also edit the variable names to remove the leading _ (but WARNING: don't check that code back into svn :P). To do so edit model/model.cc and remove the leading _ from the variables "_binary____data_svm_similarity" and "_binary____data_svm_similarity_end".
To check that the files are being built properly inspect svm-similarity-data.o and/or libmodel.a (both are created in the 'build' folder). If you run 'nm libmodel.a' you should see output like
$ nm build/svm-similarity-data.o
000000000006d108 R _binary____data_svm_similarity_end
000000000006d108 A _binary____data_svm_similarity_size
0000000000000000 R _binary____data_svm_similarity_start
Q: I have a question that's not answered here
A: Please also check the IMMS FAQ. If all else fails, ask the mailing list.