Документ взят из кэша поисковой машины. Адрес оригинального документа : http://classic.chem.msu.su/gran/gamess/macosx/DEVELOPER-NOTES-FIREFLY-GUI-RUN-APPS-MAC.pdf
Дата изменения: Mon Feb 23 17:33:48 2009
Дата индексирования: Mon Oct 1 20:51:49 2012
Кодировка:
Developer Notes To Build Your Own Custom GUI Job Submission Run Applications for PC-GAMESS / Firefly Input Files Upon Existing Bourne Shell Scripts And Open Source Developer Tools
Obviously the methodology below is not the only way to build graphical job submission run applications on Apple Macintosh computers but I found it fast and easy (and all of the necessary developer tools are open source). If you find that you build some custom versions of these graphical drag and drop run applications that are useful to you and wish to share them back with the main project that would be appreciated. There are very many possible improvements to the existing job submission run applications and I would defer to user feature requests at this point in the development cycle before adding any new features (and there are always bug fixes to deal with that will be released as separates updated versions of JUST the RUN-FIREFLY-JOBS that can be downloaded from the PC-GAMESS/Firefly Mac website page (see link at the end of this documentation). Using the methodology described below, the application built with this procedure will require a Mac Intel computers with an OS of 10.4 or above (Tiger and Leopard at this moment).

What you will need to get started:
Install Platypus. Just download and install in the default location: http://www.sveinbjorn.org/platypus Install CocaDialog. Just download and install in the default location: http://cocoadialog.sourceforge.net/ Now configure your Platypus project using the settings necessary to support drag and drop operation and to integrate calls to CocoaDialog from within the current set of shell scripts (config and settings pictures below):


Please note that you will need to add the CocoaDialog application by clicking on the + sign in the Resources section of the Platypus developer application as this dependency is called for all of the these scripts. In addition, you will need to click on the "Set $1 to path to applicaion" option in the Parameters window to allow the parameters to be properl passed from the embedded CocoaDialog graphical dialog boxes back to the main Platypus script. In addition, you will need to add the "strip-last-extension" compiled binary (or else compile it yourself from source preferably in Tiger to enale both Tiger & Leopard compatibility) to enable the feature that removes the last extension from the input file name (if any). This executable is called from within all of the base Bourne shell scripts (provided) upon which these Platypus developer tool built Mac native applications are based. You will need to add the appropriate ".config" file into the Resources folder so that the configuration variables can be loaded by the script (jus parse the shell script code to see which configuration file is appropriate for each particular script). Lastly you will need to click on the "Is Droppable" checkbox to support operation by drag and drop. I prefer not to restrict the file extensions that can be dragged and dropped (such as only allowing files with the extension .inp to be dropped) although you may wish to do this and it is rather trivial to do so. The Platypus developer tool allows you to convert a wide variety of scripts into native Mac GUI applications. Just select the script that you wish to convert into a Mac application and click on the Create button after configuring all options to you liking and a simple Mac application is created. Although the particular Firefly run applications discussed here were written as Bourne shell scripts (for simplicity and speed) many other more powerful scripting languages are supported as well such as PHP, Perl, Python and Ruby all of which are natively implemented on Apple Macintosh computers. Those that are well versed in these scripting languages may wish to rewrite the shell scripts used into these more advanced languages to facilitate building more robust and complex job submission and run applications for Firefly for Mac. This is probably particularly true if you want to develop a more sophisticated batch run application that includes elements such as a true job queue system and more extensive error routines in general.


The CocaDialog application (Platypus dependency) allow the user to provide parameters such as the number of processing cores to use for a job or the path to the input file (or multiple input files for the batch run application) via a Mac friendly familiar graphical user interface. There are some reasonable examples for using dropdown and fileselect (both single and multiple) CocaDialog calls in the source shell scripts provided. As the total number of possibilities with the script + Platypus + CocoaDialog combination (even though it is very simple development combination) is almost endless I will simply allow you to read the code and come up with your our applications as you wish. I should note that the source shell scripts provided are (very) lightly commented although the variable numbers are rather descriptive and self-explanatory. There STOP-FIREFLY-JOBS.sh bourne shell script included that provides a friendly and simple way for users to review all running Firefly for Mac jobs and the option to terminate or not terminate each job. There are very many limitations for this shelll script tha could be improved such as porting to support loading the necessary variable also from a configuration (just like all of the other job submission run scripts). The parsing script at the core of the stop application is very basic so there are some known limitations such as the fact that input files where there are ANY spaces in the absolute path directory and/or filename will not work correctly. More generally, the current implementation only supports a 100% default installation in which case it works perfectly. Adding support for non-default installation paths and configuration variables in the .config files would be a good step forward. If anyone is motivated enough to rewrite this applications with a more robust parsing code that will remove these limitations I am sure that it can be readily done in a good scripting language such as perl or python. Unfortunately, due to some limitations (truncation) in the ps UNIX utility under Tiger upon which this application relies, the STOP-FIREFLY-JOBS application is only supported for Leopard (unless you can find a workaround that I could not). You can download the most recent version of the source Bourne shell scripts upon which the job submission run applications are based by using the URL download link below: http://classic.chem.msu.su/gran/gamess/macosx/DEVELOPER-CODE-FIREFLY-GUI-MAC.zip These Bourne shell scripts built into set of drag and drop job submission run applications are provided with your install package in the RUN-FIREFLY-JOBS directory. These applications were built with the developer tools, settings and configurations described above. The most recent version can also be downloaded separately by using the URL download link below. This download link may contain a version more recent that the ones provided with your main DMG Firefly for Mac installer package. The revision date of the each application that you are running is echoed out in the text window when the application starts. http://classic.chem.msu.su/gran/gamess/macosx/RUN-FIREFLY-JOBS.zip


Please use the existing scripts as a guideline to write any new application that you are interested to create or document your own improved methodology and code. As always, if you come with some good code that others may benefit from it is appreciated if you contribute it back to the main project for others to use as well and to promote further collaborative development. It is also appreciated if you report back any bugs or feature requests to the main PC-GAMESS / Firefly project using the appropriate links below To view the most current version of PC-GAMESS/Firefly, you will want to visit the official project homepage at: http://classic.chem.msu.su/gran/gamess/index.html There is also a Mac specific page posted at http://classic.chem.msu.su/gran/gamess/macosx.html although you should always also visit the main home page to find out about major project announcements, updated and general points of interest for all PC-GAMESS/Firefly users. Developer notes for PC-GAMESS / Firefly for Mac OS X graphical job submission and run applications Written by Thomas Patko, Dept. of Chemistry & Biochemistry, California State University, Long Beach, USA Edited by Alex Granovsky, Dept. of Chemistry, Moscow State University (MSU), Russia Firefly icon and logo original design by Lyndsey Vernon, Dept. of Chemistry, University of Liverpool The PC GAMESS/Firefly Project Team Last Revised February 8, 2009 PLEASE REFER TO THE COMPLETE INSTALL AND USAGE GUIDE TO ADDRESS ANY QUESTIONS RAIESED IN THIS VERY ABBRECIATED DEVELOPER NOTES! Corrections to this guide are encouraged, as are additions that would be mutually beneficial to future Mac users of the PC-GAMESS/FIREFLY QC program.