Editing Create a MacOS X App Bundle Using MacPorts
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
==Install MacPorts== | ==Install MacPorts== | ||
Line 19: | Line 9: | ||
* MacPorts has good support for Octave. A list of what MacPorts has available for Octave is [http://www.macports.org/ports.php?by=name&substr=octave here]. To install the most recent version of Octave, type {{Codeline|<nowiki>sudo port install octave-devel</nowiki>}} at the Terminal's command line. Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take a few hours. | * MacPorts has good support for Octave. A list of what MacPorts has available for Octave is [http://www.macports.org/ports.php?by=name&substr=octave here]. To install the most recent version of Octave, type {{Codeline|<nowiki>sudo port install octave-devel</nowiki>}} at the Terminal's command line. Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take a few hours. | ||
MacPorts has historically been rather good a maintaining their Octave portfiles. However, there are times when the | MacPorts has historically been rather good a maintaining their Octave portfiles. However, there are times when the maintainer fall behind. If the current version of the [http://www.macports.org/ports.php?by=name&substr=octave-devel octave-devel] port isn't current, it will be necessary to produce a local portfile. For the remainder of this page, it is assume a local portfile is being used and that the port name is {{Codeline|<nowiki>octave-local</nowiki>}}. | ||
===Install an Octave Port=== | ===Install an Octave Port=== | ||
MacPorts' Octave port includes the non-GPL [http://glaros.dtc.umn.edu/gkhome/views/metis METIS]. To avoid license violations do not bundle Metis with Octave and then distribute to others. | For the purpose of creating an App bundle using MacPorts, an Octave port must be installed. A standard MacPorts port or a local port may be used. For a local portfile it is first required that a [http://guide.macports.org/chunked/development.local-repositories.html local portfile repository be created] and the local portfile placed there. | ||
MacPorts' Octave port includes the non-GPL [http://glaros.dtc.umn.edu/gkhome/views/metis METIS]. To avoid license violations do not bundle Metis with Octave and then distribute to others. A second motivation to use a local portfile is that the portfiles for the 3.4.x and 3.6.x series did not include all dependencies for the {{Codeline|<nowiki>print</nowiki>}} feature. The missing dependencies are [http://www.macports.org/ports.php?by=name&substr=epstool epstool], [http://www.macports.org/ports.php?by=name&substr=pstoedit pstoedit], and [http://www.macports.org/ports.php?by=name&substr=transfig transfig]. A [[Prototype MacPorts PortFile|prototype portfile]] which does not depend upon METIS and does depend upon epstool, pstoedit, and transfig has been prepared. | |||
After [http://guide.macports.org/chunked/development.local-repositories.html creating a local portfile repository] an Octave portfile may be added to the local repository using the commands below. | |||
<nowiki>mkdir -p ~/ports/math/octave-local | <nowiki>mkdir -p ~/ports/math/octave-local | ||
cp ~/Desktop/portfile ~/ports/math/octave-local</nowiki> | cp ~/Desktop/portfile ~/ports/math/octave-local</nowiki> | ||
This assumes the Octave portfile had been placed on the | This assumes the Octave portfile had been placed on the users Desktop, and that the local portfile repository is located in the users home folder and named {{Codeline|<nowiki>ports</nowiki>}}. After adding the portfile, the local repository must be indexed for MacPorts to recognize it. | ||
<nowiki>cd ~/ | <nowiki>cd ~/portfile | ||
portindex -f</nowiki> | portindex -f</nowiki> | ||
Once indexed the local Octave port may be installed. | Once indexed the local Octave port may be installed. | ||
<nowiki>sudo port install octave-local | <nowiki>sudo port install octave-local +accelerate+gcc45</nowiki> | ||
As a precaution against unexpected problems and a bloated App bundle, using consistent variants for Octave and its dependents is suggested. For example, when using | As a precaution against unexpected problems and a bloated App bundle, using consistent variants for Octave and its dependents is suggested. For example, when using {{Codeline|+accelarate}} make sure none of the dependents are using {{Codeline|+atlas}}. Also, make sure no dependents are using the {{Codeline|+universal}} variant. Using the {{Codeline|+gcc45}} variant is also recommended as all of Octave's dependents have a {{Codeline|+gcc45}} variant. At the very least, following these suggestions will reduce the size of the bundle. The name of Octave's dependent ports may be determined by the command below. | ||
<nowiki>port | <nowiki>port deps octave-local</nowiki> | ||
The installed variants for each port may be determined by the command below. Be sure to replace " | The installed variants for each port may be determined by the command below. Be sure to replace "portname" with the name of the port. | ||
<nowiki>port installed | <nowiki>port installed portname</nowiki> | ||
Once an Octave port is installed the command below may be used to determine / verify the version and variants of < | Once an Octave port is installed the command below may be used to determine / verify the version and variants of {{Codeline|<nowiki>octave-local</nowiki>}} which are installed. | ||
<nowiki>port installed octave-local</nowiki> | <nowiki>port installed octave-local</nowiki> | ||
==Create the MacOS X App Bundle== | ==Create the MacOS X App Bundle== | ||
Line 67: | Line 46: | ||
MacPorts provides a feature for [http://guide.macports.org/index.html#using.binaries.binary-packages producing binary packages] with standalone binary installers that are precompiled; they do not require MacPorts on the target system. Binary files created with MacPorts may be either .pkg (Mac OS X Installer Packages), or RPM (RPM Package Manager) format. MacPorts may also process a .pkg package into a Mac OS X .dmg disk image file. The port command shown below will create a DMG type binary installer for the Octave port and all its dependencies. | MacPorts provides a feature for [http://guide.macports.org/index.html#using.binaries.binary-packages producing binary packages] with standalone binary installers that are precompiled; they do not require MacPorts on the target system. Binary files created with MacPorts may be either .pkg (Mac OS X Installer Packages), or RPM (RPM Package Manager) format. MacPorts may also process a .pkg package into a Mac OS X .dmg disk image file. The port command shown below will create a DMG type binary installer for the Octave port and all its dependencies. | ||
<nowiki>sudo port mdmg | <nowiki>sudo port mdmg octave-local</nowiki> | ||
If more than one version of Octave is installed, or if more than one variant of Octave has been installed, the version and variant should be included. | |||
<nowiki>sudo port mdmg octave-local @<version>+variant1+variant2</nowiki> | |||
< | The DMG will be placed in the port's {{Codeline|<nowiki>work</nowiki>}} directory. If a local portfile is used, a symbolic link to the {{Codeline|<nowiki>work</nowiki>}} directory will be placed in the directory containing the portfile. In this instance the DMG can be found in {{Codeline|<nowiki>~/ports/math/octave-local/work</nowiki>}}. | ||
The DMG produced using the [http://www.octave.org/wiki/index.php?title=Prototype_MacPorts_PortFile prototype portfile's] does not include everything needed for Octave. Both {{Codeline|macros.texi}}, {{Codeline|octave.info}}, and the {{Codeline|octave.info-#}} files are missing. Until the cause for these missing files is identified and resolved, they will have to be copied manually to the App bundle. | |||
The DMG produced using the [http://www.octave.org/wiki/index.php?title=Prototype_MacPorts_PortFile prototype portfile's] does not include everything needed for Octave. Both | |||
===Create an Application Template for Octave=== | ===Create an Application Template for Octave=== | ||
[[File:AppleScriptEditor.png|350px|thumb|right|Apple Script Editor Dialog (click to enlarge)]] | [[File:AppleScriptEditor.png|350px|thumb|right|Initial Apple Script Editor Dialog (click to enlarge)]] | ||
The itemized instructions below describe how to create an application template for Ocave using the AppleScript Editor. | The itemized instructions below describe how to create an application template for Ocave using the AppleScript Editor. | ||
Line 108: | Line 76: | ||
The [[launch_octave|launch_octave]] shell script runs the Octave shell script and uses AppleScript to tell the App bundle to quit when Octave exits. | The [[launch_octave|launch_octave]] shell script runs the Octave shell script and uses AppleScript to tell the App bundle to quit when Octave exits. | ||
===Populate the App Bundle=== | ===Populate the App Bundle=== | ||
Line 126: | Line 92: | ||
MACPORTS_PREFIX="/opt/local/" | MACPORTS_PREFIX="/opt/local/" | ||
cp -pRf ${MACPORTS_PREFIX} ${FULLAPP}/Contents/Resources/. | cp -pRf ${MACPORTS_PREFIX} ${FULLAPP}/Contents/Resources/. | ||
rm ${FULLAPP}/Contents/Resources/bin/octave | rm ${FULLAPP}/Contents/Resources/bin/octave | ||
cp launch_octave ${FULLAPP}/Contents/Resources/bin/. | cp launch_octave ${FULLAPP}/Contents/Resources/bin/. | ||
Line 137: | Line 102: | ||
The Octave App bundle for MacOS X is now ready to run. | The Octave App bundle for MacOS X is now ready to run. | ||
==Running Octave from the Terminal's Command Line== | ==Running Octave from the Terminal's Command Line== | ||
Line 168: | Line 120: | ||
* When Octave is running, clicking on Octave's icon in the dock has no effect. This is because the App bundle runs a shell script which launches Terminal.app which runs Octave. To locate the Octave session, click on the Terminal.app. | * When Octave is running, clicking on Octave's icon in the dock has no effect. This is because the App bundle runs a shell script which launches Terminal.app which runs Octave. To locate the Octave session, click on the Terminal.app. | ||
* Only one instance of the App may be run by clicking on the app. Multiple instances may be run from the command line. | * Only one instance of the App may be run by clicking on the app. Multiple instances may be run from the command line. | ||
* | * In some instances, the Octave binary attempts to load an library whose version number is older than the one it intended to link to (at build time). This will produce an error like to one below. | ||
<nowiki>dyld: Library not loaded: /opt/local/libiconv.2.dylib</nowiki> | <nowiki>dyld: Library not loaded: /opt/local/libiconv.2.dylib</nowiki> | ||
Line 259: | Line 211: | ||
<nowiki>dylibs_fix ("bin/octave-3.7.0+", "lib", false)</nowiki> | <nowiki>dylibs_fix ("bin/octave-3.7.0+", "lib", false)</nowiki> | ||
The script will mirror each of the {{Codeline|otool}} commands to the screen. Errors and/or warnings are given if any libraries are found to be missing in the bundle. | The script will mirror each of the {{Codeline|otool}} commands to the screen. Errors and/or warnings are given if any libraries are found to be missing in the bundle. | ||
==Testing== | ==Testing== | ||
Those interested in testing an App bundle can try [https://dl.dropbox.com/u/14845154/Octave-X86_64-3.7.0% | Those interested in testing an App bundle can try [https://dl.dropbox.com/u/14845154/Octave-X86_64-3.7.0%2Bv6.dmg Octave-X86_64-3.7.0+v6.dmg (Dated: Jun 30, 2012 10:55 PM)]. The link will be periodically updated. The DMG is large (480+ MB). I kindly ask those with the patience to download it, to report results to bpabbott at mac dot com. Alternatively, if a bug is found [https://savannah.gnu.org/bugs/?group=octave file a bug report]. When reporting on your experience, please include; | ||
* The version of MacOS X you are running. | * The version of MacOS X you are running. | ||
** Note: This App bundle will ''not'' run on Mac OS 10.5 or earlier. | ** Note: This App bundle will ''not'' run on Mac OS 10.5 or earlier. | ||
Line 274: | Line 222: | ||
* For intricate problems, please provide enough information so that others may duplicate it. | * For intricate problems, please provide enough information so that others may duplicate it. | ||
===Testing Results=== | ===Testing Results=== | ||
Results reported by some volunteers testing an App bundle are below. As some of the reported results are inconsistent, individuals are cautioned not interpret these results as definitive | Results reported by some volunteers testing an App bundle are below. As some of the reported results are inconsistent, individuals are cautioned to not interpret these results as definitive. | ||
* An App bundle built for arch=X86_64 on an Intel Core i7 MacBook Pro running MacOS 10.7 was found to run on the following; | * An App bundle built for arch=X86_64 on an Intel Core i7 MacBook Pro running MacOS 10.7 was found to run on the following; | ||
:* MacBook Pro (Intel Core i7) running MacOS 10.7 with MacPorts installed. | :* MacBook Pro (Intel Core i7) running MacOS 10.7 with MacPorts installed. | ||
:* MacBook Pro (Intel Core i7) running MacOS 10.7 with no MacPorts, and no Fink, installed. | :* MacBook Pro (Intel Core i7) running MacOS 10.7 with no MacPorts, and no Fink, installed. | ||
* | :* Macbook Pro (Intel Core-2 Duo 2.5 GHz) MacOS 10.6.8 with 64 bit support enabled, and with MacPorts installed. | ||
::* To enable 64bit see Apple's support page ⇒ [http://support.apple.com/kb/HT3773 OS X: Starting up with the 32-bit or 64-bit kernel]. | |||
* The App bundle did not run on; | |||
:* MacBook (Intel Core Duo) running MacOS 10.6 with no MacPorts, and no Fink, installed. The error encountered is below. | :* MacBook (Intel Core Duo) running MacOS 10.6 with no MacPorts, and no Fink, installed. The error encountered is below. | ||
<nowiki>$ cd /Applications/Octave-3.7.0+.app/Contents/Resources/bin/ | <nowiki>$ cd /Applications/Octave-3.7.0+.app/Contents/Resources/bin/ | ||
Line 293: | Line 242: | ||
* If anyone has advice on how to resolve any of the above errors, please send an email to bpabbott at mac dot com. | * If anyone has advice on how to resolve any of the above errors, please send an email to bpabbott at mac dot com. | ||
== | ==Plans== | ||
List of what can be done to improve the MacOS X App bundle. | List of what can be done to improve the MacOS X App bundle. | ||
* | * Determine which static libraries can be removed from the bundle without impacting Octave, mkoctfile, etc. Removing the static libraries would reduce the size of the bundled App by about 150 MB. | ||
* Resolved the {{Codeline|__gnu_cxx::__concurrence_lock_error}} error. | |||
** What is the source/cause of the {{Codeline|__gnu_cxx::__concurrence_lock_error}} error? | |||
* | |||
** | |||
* Should the contents of the la-files, in {{Codeline|Octave-3.7.0+.app/Resources/lib}}, be changed to reflect to use the {{Codeline|@executable_path}} token. | * Should the contents of the la-files, in {{Codeline|Octave-3.7.0+.app/Resources/lib}}, be changed to reflect to use the {{Codeline|@executable_path}} token. | ||
[[Category:Mac]] | |||
[[Category: |