How to compile MSlice

From Mslice
Jump to navigationJump to search

Dos and Don'ts

There are a few rules when altering code that 'MUST' be obeyed, these are:

  • NO feval or eval statements - these do not compile
  • Use the command filesep to get the folder separator for the current platform instead of using '\'
  • Do not use script mfiles
  • Use text files for any optional settings etc. so that a user may change them once the suite has been compiled
  • Always include the mcrinstaller with any distribution


How To Compile for Windows

Mex Fortran Files

The mex files should already exist, but if required the function mslice_mex exists. Run this script to produce mex files in the correct format for your version of Matlab. See "How to MEX MSlice" for more information.


Compile Standalone Mslice

  • open matlab. Version 2006b or later is required to use the mslice compile script.
  • Make sure that your startup.m file either contains conditional isdeployed statements (so that no code executes if isdeployed is true) OR all text is commented out. The presence of code in startup.m stops any compiled applications from working, but compiling will complete. NOTE however, that the paths still have to set up (i.e. startup.m must have run when you opened Matlab, but not be available at compile-time)
  • Type >> mslice_compile_win32. This will then take up to 5 minutes to compile,
  • Two files now exist in the mslice_standalone folder (newly created on the same level as the mslice_compile file). The zip file and the MCRinstaller.exe file. Distribute both to users, they must run the MCRinstaller.exe file once to setup matlab components on their computer.
  • A further text file complete.txt is created, this file indicates that compilation is successfull and contains a date and time stamp of the last successful build. This is for reference only.


see File Locations for where to upload these for access from the wiki