Skip to content. | Skip to navigation

Personal tools
    di Bernardo Lab - Systems and Synthetic Biology Lab
    You are here: Home Internal Site DRY LAB MATLAB STUFF How to use Matlab compiler under Linux by Luisa

    How to use Matlab compiler under Linux by Luisa

    COMPILATION STEPS

    • 1)Make your script as a function funname.m
    • 2)use: mcc -mv -I ./ -d ./compiled funname.m to compile your script(where compiled is a directory you create to save the executable file that will be built up).
    • 3)you then need to get the MCR file specific for you platfor (linux in this case) so you can go to the matlab installation root in c0-18: /state/partition1/sw/matlab-client/toolbox/compiler/deploy/glnx86 and run MCRInstaller.bin This way you'll get a MCR dir containing a lib dir. Remember: once you have imported the MCR installer dir you do not need it to to any more! It only depends on the matlab realise and not on the specific software you are building!
    • 4)The last thing you need to deploy on a machine that doesn't have matlab is the "extractCTF" file in c0-18: /state/partition1/sw/matlab-client/toolbox/compiler/deploy/glnx86.
    • 5)Everything's ready to deploy now! I suggest to deploy on another linux machine the whole directory "compiled" that you created in 2), the whole directory "lib" you jusyt created and the "extractCTF" file.


    DEPLOYMENT STEPS

    • 1) Copy all the files you created on the linux machine you want to run your executable matlab program, as sayed in previous section 5)
    • 2) Set the environment variable LD_LIBRARY_PATH as following:

    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/runtime/glnx86 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/sys/os/glnx86LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/sys/java/jre/glnx86/jre1.6.0/lib/i386/server LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/sys/java/jre/glnx86/jre1.6.0/lib/i386/native_threadsLD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/sys/java/jre/glnx86/jre1.6.0/lib/i386 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/sys/opengl/lib/glnx86 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/bin/glnx86 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/lib/v77/toolbox/compiler/deploy export LD_LIBRARY_PATH Or permanently set it in the .bash profile file;

    • 3)./extractCTF bats.ctf
    • 4)./funname it should run now! Let me know!