-------- Compatibility ----------------------------------

The toolbox should work and compile on all versions of Matlab later than 2009b.

-------- What can be compiled -------------------------------

- Static backend libraries libltfat.a, libltfatf.a
                   OR
  Shared backend libraries ltfat.dll, ltfatf.dll on Windows.

- Fast Mex-interfaces linking to the backend libs.

- Mex-interface PolygonClip using Generic Polygon Clipper

Block processing framework (optional)

- Mex-interface playrec

- Java classes for blockproc GUI

------------------------------------------------------------------------
-------- Compiling backend libs and the MEX interfaces  ----------------
------------------------------------------------------------------------

LTFAT comes with C Mex interfaces to replace (shadow) all computationally
intensitive functions in the toolbox.

To compile the Mex-interfaces, type "ltfatmex" on the Matlab command
prompt. This will compile the backend libraries and all the available
mex-functions and also the PoligonClip mex function.

If you have downloaded a binary release, everything is already
compiled and you should not need to do anything else.

The Mex-files and the backend libs links to certain additional libraries,
which has to be present at your system. The library management varies between
OS see below. 
The depending libraries are:  FFTW3, BLAS, LAPACK

--------- Compiling on MacOS -------------------------------------------

The GCC compiler is needed to compile the LTFAT on Mac OS X. When the Xcode
Command Line Tools are installed the compilation of the LTFAT should work
without any problem. Alternatively, Clang could be used to compile the LTFAT.
The BLAS, LAPACK and FFTW libraries are taken directly from the Matlab
installation and doesn’t have to be installed separately.

--------- Compiling on Microsoft Windows -------------------------------

On Windows, we rely on the MinGW compiler system:

- Install MinGW compiler system. The easiest is to download and install
  TDM-GCC compiler suite from http://tdm-gcc.tdragon.net/download.
  After installation, ensure that the [MinGW]/bin directory is in the
  system PATH, where [MinGW] stands for installation directory.

- Ensure there is not another MinGW/MSYS toolchain in PATH and, expecially,
  that there is no sh.exe in PATH.

- Manually install binaries of FFTW. The easiest way is to download
  them from http://www.fftw.org/install/windows.html. Copy all *.dll files
  to the ltfat/mex directory. This step is necessary since the FFTW lib
  shipped with Matlab does not contain some of the routines we need.

- Run "ltfatmex".

BLAS and LAPACK libraries are taken directly from the Matlab installation.
Both 32bit and 64bit versions of Matlab are supported. Please use appropriate
versions of FFTW and TDM-GCC.

--------- Compiling on Linux ------------------------------------

The dependencies are taken directly from Matlab installation and you should
not need to install anything. Just typing "ltfatmex" should do the trick.

-----------------------------------------------------------------------
--------- Compiling parts for block processing framework --------------
-----------------------------------------------------------------------

Everything should be already compiled if you have downloaded the binary release.

In order to get the block processing framework working from the source, one
has to compile the MEX-interface playrec and the JAVA GUI classes. This can be
done by typing

"ltfatmex playrec" and "ltfatmex java".

Playrec MEX depends on the PORTAUDIO library, which has to be installed on your
system prior running the commands. Compiling JAVA classes requires Java Development
Kit to be installed.
NOTE: Compiled Java classes (packed in blockproc.jar) are platform independent
so compiling it and installing JDK can be avoided by taking the archive from any
binary LTFAT package (from ltfat/blockproc/java).


--------- Compiling on Mac ------------

It is recommended to compile PortAudio v19 to use with the block processing
framework. PortAudio v19 only compiles on OS X version 10.4 or later.
Several versions of the Java Development Kit, which is needed to compile 
the JAVA classes, could be downloaded through the Apple Developer Downloads.


--------- Compiling on Microsoft Windows --------------------------

Unfortunately, portaudio on Windows is not distributed in a binary package.
One can follow instructions on http://www.portaudio.com/ to compile the library
from the source with support for different sound APIs like DirectSound, MME,
WASAPI, ASIO. Build a shared (dynamically linked) library (dll) and copy it to
the ltfat/thirdparty/Playrec directory.

Alternatively, when no such library is found in ltfat/thirdparty/Playrec, 
ltfatmex attempts to link portaudio library shipped with Matlab. Expect much 
worse audio performance in this case.

--------- Compiling on Linux ------------------------------------

- On Redhat / Fedora, TBD

- On Debian / Ubuntu, install the packages 'portaudio19-dev', 'openjdk-7-jdk' 

Recent versions of Matlab already contain the portaudio lib so there is no need
for installing it. To use a custom (or system) portaudio lib, adjust
the symbolic link found here
>>[matlabroot, filesep, 'bin', filesep, computer('arch')]
