Difference between revisions of "Changing Homer GUI Code"

From LIBISIS
Jump to navigation Jump to search
m
m
 
(4 intermediate revisions by the same user not shown)
Line 18: Line 18:
  
  
* open matlab. Version 2006b or later is required to use the homer compile script.  
+
* open matlab. Version 2006b or later is required to use the homer compile script. If NOT using 2007b, you may need to locate some Matlab .dll files within the matlab installation folders and replace those in the win32_distref folder (in the libisis root folder), particularly libmx.dll and libmex.dll. Use a dependency analysis on the .exe file that is compiled to discover which .dll files are no longer working. (Dependency analysis: go to start menu -> run and type 'depends'. In the window that pops up, browse for your .exe and .dll dependency is displayed).  
 
* The '''First''' time you compile:  
 
* The '''First''' time you compile:  
 
** type >> mbuild -setup
 
** type >> mbuild -setup
Line 24: Line 24:
 
** Next, select the same compiler from the same group used to build libisis (usually C++ .NET 2003).
 
** Next, select the same compiler from the same group used to build libisis (usually C++ .NET 2003).
 
** Comfirm by pressing return
 
** Comfirm by pressing return
* 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.
+
* 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 >> Homer_compile. This will then take up to 5 minutes to compile,
+
* Type >> homer_compile_win32. This will then take up to 5 minutes to compile,
 
* Two files now exist in the standalone_homer folder (newly created on the same level and the homer_gui folder). 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.
 
* Two files now exist in the standalone_homer folder (newly created on the same level and the homer_gui folder). 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.  
 
* 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.  

Latest revision as of 13:14, 2 September 2008

The homer GUI is designed to be compiled into a standalone application. Therefore, some matlab functions etc. can not be used


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
  • Folder names MUST be stored without a slash at the end, i.e. '..\libisis\matlab' is ok, but '..\libisis\matlab\' is not.
  • 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

  • open matlab. Version 2006b or later is required to use the homer compile script. If NOT using 2007b, you may need to locate some Matlab .dll files within the matlab installation folders and replace those in the win32_distref folder (in the libisis root folder), particularly libmx.dll and libmex.dll. Use a dependency analysis on the .exe file that is compiled to discover which .dll files are no longer working. (Dependency analysis: go to start menu -> run and type 'depends'. In the window that pops up, browse for your .exe and .dll dependency is displayed).
  • The First time you compile:
    • type >> mbuild -setup
    • Matlab will ask "do you want mbuild to locate installed compilers, type "y" and press return
    • Next, select the same compiler from the same group used to build libisis (usually C++ .NET 2003).
    • Comfirm by pressing return
  • 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 >> homer_compile_win32. This will then take up to 5 minutes to compile,
  • Two files now exist in the standalone_homer folder (newly created on the same level and the homer_gui folder). 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


Possible Issues With Compiled Code

Compiled code can throw some errors depending on the compiler and changes made to the code. An error is given in a command window.

Error Resolution
Invalid MEX file: <folder structure>\libisisexc.dll, the specified module could not be found. Occurs when options are selected in the GUI window. Yet libisisexc.dll is in the location described! One of the .dll library files that libisisexc is linked to is missing in the "dll" folder. This is often a free to redistribute file in the compiler used to compile libisis. Simply locate this .dll file and add it to the "dll" folder.