Difference between revisions of "Changing Homer GUI Code"

From LIBISIS
Jump to navigation Jump to search
m
m
 
(19 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
== dos and don'ts ==
+
== Dos and Don'ts ==
  
 
There are a few rules when altering code that ''''MUST'''' be obeyed, these are:
 
There are a few rules when altering code that ''''MUST'''' be obeyed, these are:
  
  * NO feval or eval statements - these do not compile
+
* 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.  
+
* 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 '\'  
+
* Use the command filesep to get the folder separator for the current platform instead of using '\'  
  * Do not use script mfiles
+
* 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
+
* 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
+
* Always include the mcrinstaller with any distribution
 +
 
  
  
Line 17: Line 18:
  
  
* open matlab
+
* 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).
** navigate to the homer_gui folder
+
* The '''First''' time you compile:
 
** type >> mbuild -setup
 
** type >> mbuild -setup
 
** Matlab will ask "do you want mbuild to locate installed compilers, type "y" and press return
 
** 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).
 
** 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
** Type >> deploytool
+
* 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)
** In the deployment tool toolbar click "open project" icon
+
* Type >> homer_compile_win32. This will then take up to 5 minutes to compile,
** Open homer.prj located in the homer_gui folder.  
+
* 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.
** In the deployment tool toolbar click "Open Project Settings Window" icon
+
* 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.  
** Select the folders you wish the output files to reside (by default c:\homer_gui\distrib. The project name will be the name of the .exe file that the user runs. Click ok and ignore any other options
+
 
** In the deployment tool toolbar click the "build project" icon and wait until the compilation is completed (as indicated at the bottom of the matlab window). This may take several minutes
+
 
** In the deployment tool toolbar, click the "package project" icon and wait until complete (as indicated by the progress bar).
+
see [[File Locations]] for where to upload these for access from the wiki
* Copy the "DLL" directory from the homer_gui director and into the directory that the distribution of Homer is located (e.g. c:\homer\distrib)
 
* Copy the "Instrument_setup" directory from the homer_gui directory and into the directory that the distribution of homer is located
 
* Create a Zip File named Homer containing homer_pkg.exe, the "DLL" folder and the "instrument_setup" folder. No other files are required.  
 
* Give this zip file to users.
 
  
  
Line 45: Line 42:
 
! {{Headcellstyle}} | Resolution
 
! {{Headcellstyle}} | Resolution
 
|-
 
|-
| ''Invalid MEX file: <folder structure>\libisisexc.dll, the specified module could not be found''. Yet libisisexc.dll is in the location described!
+
| ''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.  
 
| 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.  
}
+
|}

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.