
Building microCORLab Matlab Module
==================================
To build module for your environment, you need a MATLAB supported compiler [0].
You can get Windows SDK[1], which is free of charge.


Compiling - MATLAB
------------------
You can set to the default compiler with following command:

    >> mex -setup

You can compile with command on below:

    >> cd <sdk-path>/matlab/src
    >> mex -I"../../include/c" -L"../../lib/<platform>" ...
    >>   -outdir "../../lib/<platform>" -lmicroCORLab mcl.c

Note : Choose a proper platform and replace with <platform> which is located at
lib/ directory.

Note : At *nix, add below line as a parameter to mex while building. This will
       add relative current path to RPATH, which causes to load *.so files at
       the running directory.

    LDFLAGS='$LDFLAGS -Wl,-rpath=\$ORIGIN'

Compiling - Octave
------------------
Octave ile derleyebilmek için Ubuntu'da liboctave-dev paketini kurmalısınız.
Daha sonra komut satırından :

    $ cd <sdk-path>/matlab/src
    $ mkoctfile --mex -I"../../include/c" -L"../../lib/<platform>" -lmicroCORLab mcl.c
    $ cp mcl.mex ../../lib/<platform>
    $ cd ../../lib/<platform>

Troubleshooting
===============
Problem : Windows SDK was installed however MATLAB haven't seen it as compiler

Solution : It may cause a conflict if Windows SDK and Microsoft Visual Studio
C++ 2010 SP1(Express or Professional) was installed. Following steps will solve
the conflict:
-Uninstall the Microsoft Visual C++ 2010 redistributable packages
-Install the Windows SDK 7.1. During installation, under the "Installation
Options" menu, UNCHECK the "Visual C++ Compilers" and "Microsoft Visual C++
2010" components.
-Apply the SDK 7.1 patch[2]
-Reinstall the Microsoft Visual C++ 2010 redistributable packages.
Further information can found at [3]

References
==========
[0] http://www.mathworks.com/support/compilers/R2014b/index.html
[1] http://www.microsoft.com/en-us/download/details.aspx?id=8279
[2] http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=4422
[3] http://www.mathworks.com/matlabcentral/answers/95039-why-does-the-sdk-7-1-installation-fail-with-an-installation-failed-message-on-my-windows-system
