<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ascend4.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arne</id>
	<title>ASCEND - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ascend4.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arne"/>
	<link rel="alternate" type="text/html" href="https://ascend4.org/Special:Contributions/Arne"/>
	<updated>2026-05-01T01:11:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://ascend4.org/index.php?title=Install_ASCEND_in_Virtual_Machine&amp;diff=934</id>
		<title>Install ASCEND in Virtual Machine</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Install_ASCEND_in_Virtual_Machine&amp;diff=934"/>
		<updated>2010-07-12T22:00:33Z</updated>

		<summary type="html">&lt;p&gt;Arne: /* Get Virtual Box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;THIS PAGE IS UNDER DEVELOPEMENT.&lt;br /&gt;
Right now, I am just listing what I did so far step by step...&lt;br /&gt;
&lt;br /&gt;
==Why?==&lt;br /&gt;
&lt;br /&gt;
On many operating systems, installing ASCEND is not exactly hassle free...&lt;br /&gt;
Even the way to install it on ubuntu linux is different from version to version.&lt;br /&gt;
&lt;br /&gt;
This is the way to get ASCEND runnning on ANY operating system quick and (hopefully) without any problems.&lt;br /&gt;
&lt;br /&gt;
== Get Virtual Box ==&lt;br /&gt;
Virtual Box is a program the simulates to be an actual computer on which you can install any operating system you like.&lt;br /&gt;
This is also interesting if you are for example usually using linux but need some program that is only availible for windows - or the other way round.  &lt;br /&gt;
&lt;br /&gt;
* If you don&#039;t have it yet, &#039;&#039;&#039;Download VitualBox here&#039;&#039;&#039;: [http://www.virtualbox.org/wiki/Downloads/]&lt;br /&gt;
* Install it. The way you do it dpends on your operating system. Porblems? &#039;&#039;&#039;VitualBox User Manual&#039;&#039;&#039;: [http://download.virtualbox.org/virtualbox/3.2.6/UserManual.pdf]&lt;br /&gt;
&lt;br /&gt;
==Get the prepared Virtual Machine ==&lt;br /&gt;
A complete running ubuntu system with ascend installed is availible, so you don&#039;t need to install it yourself.&lt;br /&gt;
* Download it at [LINK WILL BE COMING SOON]&lt;br /&gt;
&lt;br /&gt;
== Set the shared folder ==&lt;br /&gt;
To be able to transfer files into you virtual machine you will need a folder that is availible to your operating and the virtual machine at the same time. This folder will actually be some folder in your &amp;quot;normal&amp;quot; operating system but also availible to your virtual Machine. This will be important to put import (model) files and hand them oer to ascend.&lt;br /&gt;
&lt;br /&gt;
* Select the Window of Virtual Box in which the virtual machine is running&lt;br /&gt;
* Click on &amp;quot;Devices&amp;quot; -&amp;gt; &amp;quot;Shared Folders&amp;quot;&lt;br /&gt;
* There will be a little button for adding a shared folder - some symbol with a green plus on it - click it!&lt;br /&gt;
* Set the &#039;&#039;&#039;Folder Path&#039;&#039;&#039;. This is a folder on your main operating system - just select any you like. It will maybe something like &amp;quot;C:\Users\Harry\Desktop\ascendshare&amp;quot; (Windows) or &amp;quot;/home/harry/Desktop/ascendshare&amp;quot; (Unix)&lt;br /&gt;
* Set the &#039;&#039;&#039;folder name&#039;&#039;&#039;. It MUST BE &#039;&#039;&#039;&amp;quot;hostfolder&amp;quot;&#039;&#039;&#039;. This name only appears here and in the configuration file /etc/fstab in the virtual amchine as a reference.&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=Install_ASCEND_in_Virtual_Machine&amp;diff=896</id>
		<title>Install ASCEND in Virtual Machine</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Install_ASCEND_in_Virtual_Machine&amp;diff=896"/>
		<updated>2010-07-07T13:05:35Z</updated>

		<summary type="html">&lt;p&gt;Arne: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;THIS PAGE IS UNDER DEVELOPEMENT.&lt;br /&gt;
Right now, I am just listing what I did so far step by step...&lt;br /&gt;
&lt;br /&gt;
==Why?==&lt;br /&gt;
&lt;br /&gt;
On many operating systems, installing ASCEND is not exactly hassle free...&lt;br /&gt;
Even the way to install it on ubuntu linux is different from version to version.&lt;br /&gt;
&lt;br /&gt;
This is the way to get ASCEND runnning on ANY operating system quick and (hopefully) without any problems.&lt;br /&gt;
&lt;br /&gt;
== Get Virtual Box ==&lt;br /&gt;
&lt;br /&gt;
* If you don&#039;t have it yet, &#039;&#039;&#039;Download VitualBox here&#039;&#039;&#039;: [http://www.virtualbox.org/wiki/Downloads/]&lt;br /&gt;
* Install it. The way you do it dpends on your operating system. Porblems? &#039;&#039;&#039;VitualBox User Manual&#039;&#039;&#039;: [http://download.virtualbox.org/virtualbox/3.2.6/UserManual.pdf]&lt;br /&gt;
* Set the &#039;&#039;&#039;shared folder&#039;&#039;&#039; in the program &amp;quot;Virtual Box VM&amp;quot; - this folder will actually be some folder in your &amp;quot;normal&amp;quot; operating system but also availible to your virtual Machine. This will be important to put import (model) files and hand them oer to ascend.&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=Install_ASCEND_in_Virtual_Machine&amp;diff=895</id>
		<title>Install ASCEND in Virtual Machine</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Install_ASCEND_in_Virtual_Machine&amp;diff=895"/>
		<updated>2010-07-06T13:46:29Z</updated>

		<summary type="html">&lt;p&gt;Arne: Created page with &amp;#039;THIS PAGE IS UNDER DEVELOPEMENT. Right now, I am just listing what I did so far step by step...  ==Why?==  On many operating systems, installing ASCEND is not exactly hassle free…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;THIS PAGE IS UNDER DEVELOPEMENT.&lt;br /&gt;
Right now, I am just listing what I did so far step by step...&lt;br /&gt;
&lt;br /&gt;
==Why?==&lt;br /&gt;
&lt;br /&gt;
On many operating systems, installing ASCEND is not exactly hassle free...&lt;br /&gt;
Even the way to install it on ubuntu linux is different from version to version.&lt;br /&gt;
&lt;br /&gt;
This is the way to get ASCEND runnning on ANY operating system quick and (hopefully) without any problems.&lt;br /&gt;
&lt;br /&gt;
== Download Virtual Box ==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have it yet, &#039;&#039;&#039;Download Vitual Box here&#039;&#039;&#039;: [http://www.virtualbox.org/wiki/Downloads/]&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=Porting_to_Mac&amp;diff=729</id>
		<title>Porting to Mac</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Porting_to_Mac&amp;diff=729"/>
		<updated>2010-05-31T09:57:42Z</updated>

		<summary type="html">&lt;p&gt;Arne: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ASCEND now &#039;&#039;&#039;runs successfully on Mac&#039;&#039;&#039; without problems. The remaining work is to package ASCEND as an installer or as an &#039;app&#039;, and to fix it so that it connects with Apple Events for opening files from the Finder, etc -- see below for details.&lt;br /&gt;
{{task}}&lt;br /&gt;
&lt;br /&gt;
== Installing the necessary tools ==&lt;br /&gt;
&lt;br /&gt;
You should install the following tools in order to be able to build ASCEND on Mac:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XCode&#039;&#039;&#039; from your OS X CD.&lt;br /&gt;
* &#039;&#039;&#039;gfortran&#039;&#039;&#039;. Use gfortran-macosx-x86.dmg from [http://gcc.gnu.org/wiki/GFortranBinaries]&lt;br /&gt;
* &#039;&#039;&#039;scons&#039;&#039;&#039; by typing &#039;easy_install scons&#039;&lt;br /&gt;
* &#039;&#039;&#039;swig&#039;&#039;&#039;. We have version 1.3.31, not sure if it came with XCode or elsewhere (???). Version 1.3.39 and 1.3.40 are known to cause problems on other platforms.&lt;br /&gt;
* &#039;&#039;&#039;subversion&#039;&#039;&#039; (see [[VersionManagement|here]] or try the [http://www.open.collab.net/downloads/community/OpenCollabNet version])&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
When the above tools are installed and you have obtained the source code either from a file release or from our [[VersionManagement|code repository]], now you should be able to build ASCEND. Try just running &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;scons&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There should be some output to tell you if you&#039;re missing any important components. Otherwise, you should then be able to run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;./test.py TestSolver.testlog10&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you should see a message saying &#039;OK&#039;. At this stage you have a complete working copy of ASCEND, possibly minus some of the userful [[solvers]] like [[IPOPT]], [[IDA]], [[CONOPT]]. The other import thing that you&#039;re missing is the GTK+ GUI library that allows ASCEND to present its user interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Native GTK+ ==&lt;br /&gt;
&lt;br /&gt;
ASCEND uses GTK+ for its GUI. This is a cross-platform GUI library that works primarily on Linux but is also supported on Windows and Mac OS X. For Mac, it is currently necessary to build it from source, following the [http://sourceforge.net/apps/trac/gtk-osx/wiki/Build instructions from the GTK-OSX project].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps are something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Make sure you have Xcode, subversion and git installed, as outlined at [http://sourceforge.net/apps/trac/gtk-osx/wiki/Build]&lt;br /&gt;
* Download the script [http://downloads.sourceforge.net/sourceforge/gtk-osx/gtk-osx-build-setup.sh] and run it using &#039;&amp;lt;tt&amp;gt;sh gtk-osx-build-setup.sh&amp;lt;/tt&amp;gt;&#039; (no quotes).&lt;br /&gt;
* Edit the resulting &amp;lt;tt&amp;gt;~/.jhbuildrc-custom&amp;lt;/tt&amp;gt; file, adding &#039;&amp;lt;tt&amp;gt;build_policy = &amp;quot;updated-deps&amp;quot;&amp;lt;/tt&amp;gt;&#039; as a line at the end of the file (no single quotes).&lt;br /&gt;
* Set up an alias that will run &amp;lt;tt&amp;gt;jhbuild&amp;lt;/tt&amp;gt; in a stripped down environment that does not contain any reference to the Fink (/sw/...) or MacPorts (?) directories (if you have them): A good option is to set&lt;br /&gt;
:&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;pre&amp;gt;alias jhbuild=&amp;amp;quot;PATH=/opt/subversion/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:~/gtk/inst ~/.local/bin/jhbuild&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;alias jhbuild=&amp;amp;quot;PATH=/opt/subversion/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:~/gtk/inst ~/.local/bin/jhbuild&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
According to the [http://sourceforge.net/apps/trac/gtk-osx/wiki/Build description on Sourceforge], build PyGTK as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild bootstrap&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild build meta-gtk-osx-bootstrap&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild build meta-gtk-osx-core&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild pygtk&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now test that PyGTK is working by running &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt; and checking that &amp;lt;tt&amp;gt;import gtk&amp;lt;/tt&amp;gt; doesn&#039;t cause errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If that&#039;s working, you should be able to use your working copy of ASCEND (as above) to run &amp;lt;tt&amp;gt;pygtk/ascdev&amp;lt;/tt&amp;gt;. This should open ASCEND, but you may have to command-tab to the correct window, as it won&#039;t pop to the front automatically.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a screenshot of ASCEND on Native GTK-Quartz on OS X!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;thumb tnone&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;thumbinner&amp;quot; style=&amp;quot;width:302px;&amp;quot;&amp;gt;[[Image:ASCENDnativeOSX.png]] &amp;lt;div class=&amp;quot;thumbcaption&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;magnify&amp;quot;&amp;gt;[[File:ASCENDnativeOSX.png|&amp;lt;img src=&amp;quot;/skins/common/images/magnify-clip.png&amp;quot; width=&amp;quot;15&amp;quot; height=&amp;quot;11&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;]]&amp;lt;/div&amp;gt;Screenshot of the PyGTK GUI running on Mac OSX with GTK-OSX (Quartz/Native GTK)&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: currently, the ASCEND GUI on Mac still behaves much the same as it would on Windows or Linux; we haven&#039;t yet &#039;mackified&#039; the keyboard shortcuts and menu layout. This will be using the &#039;ige-mac-integration&#039; library that&#039;s also provided by the GTK-OSX project.&lt;br /&gt;
&lt;br /&gt;
Note that allegedly it is also possible to build native GTK using macports, but we haven&#039;t yet tried that.&lt;br /&gt;
&lt;br /&gt;
== Building the Tcl/Tk GUI ==&lt;br /&gt;
&lt;br /&gt;
No work yet to determine what will be required to the Tcl/Tk GUI running on Mac. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It may be fairly straightforward to get this GUI running, possibly using these binaries for Tcl/Tk:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [http://www.categorifiedcoder.info/tcltk/]&lt;br /&gt;
&lt;br /&gt;
== Preparing for distribution ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following part is still under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once GTK is build using jhbuild above, we need to re-package ASCEND in the form of a &#039;normal&#039; Mac OS X application. To do this,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;cd ~/ascend&lt;br /&gt;
python scons/installgtk.py&lt;br /&gt;
scons install INSTALL_PREFIX=~/ascinst&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those steps will first copy GTK and associated files into &amp;lt;tt&amp;gt;dist/PyGTK.bundle&amp;lt;/tt&amp;gt;. Next, they will copy all the ASCEND files as well as PyGTK.bundle into ~/ascinst/ASCEND.app. Other files will be added to the ~/ascint folder, in preparation for making a .dmg disk image that will be suitable for distribution.&lt;br /&gt;
&lt;br /&gt;
Currently, we are still working out some final bugs with the creation of the PyGTK.bundle, so this final step doesn&#039;t entirely work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Development notes ==&lt;br /&gt;
&lt;br /&gt;
=== Packaging and distribution ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s recommended for most Mac applications that everything be distributed as an Application Bundle that just be dragged by the user into their Applications folder. This is certainly possible with ASCEND, but a problem is that the ASCEND Model Library is something that we would like users to see and interact with. We would like users to be able to see these folders and their contents easily using the Finder. Nesting the files within an Application bundle makes this rather difficult.&lt;br /&gt;
&lt;br /&gt;
One option would be for the ASCEND application to unpack its model library to ~/Library/Application Support/ASCEND when the program is first run. This would require Python scripting, and would not be compatible with a shared installation of the Tcl/Tk GUI on the same system.&lt;br /&gt;
&lt;br /&gt;
Another option would be to install the model library in /Library/Application Support/ASCEND/Models. This seems to be the right way forward, but it means that ASCEND can no longer just be dragged to the Applications folder to be installed. Instead, it would need an Installer to place the necessary files on the user&#039;s system. That&#039;s quite desirable, though, because such an installer could also check that the user has the correct versions of Python, GTK and PyGTK already installed on the system, and could even possibly download and install them first if required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth noting that Mac editors like TextEdit can&#039;t peer into Application Bundles, but non-Mac editors like gedit can do so... they don&#039;t impose the same restriction on entering inside such bundles.&lt;br /&gt;
&lt;br /&gt;
As a first attempt for getting everything running, it seems wise to take the simple application bundle approach.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not currently proposing to provide the Tcl/Tk GUI for Mac. This is a whole separate packaging problem.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not currently proposing to package libascend as a Framework for Mac, although that is an option, and would be appropriate if attempting to provide both Tcl/Tk and PyGTK GUIs on the same machine, and to make it easier for users to develop their own solvers, etc, on that platform.&lt;br /&gt;
&lt;br /&gt;
The general opinion on GTK is that we should include it within out Application Bundle. From the linux point of view, this is terribly inefficient, but such things are standard practise on Mac, and we should respect that in the first instance.&lt;br /&gt;
&lt;br /&gt;
The alternative of providing ASCEND to the Mac community as a Fink package was considered, however, according to Fink developers, the current &#039;stable&#039; repository for Fink is very stagnant, so we are unlikely to be able to use that as a means for distribution. &lt;br /&gt;
&lt;br /&gt;
If we want to distribute ASCEND as a multi-component thing (libascend framework, Tcl/Tk GUI, PyGTK, model library all separate) then we would need to use the Apple tool, &#039;&#039;PackageMaker&#039;&#039;, which allows developers to produce their own .pkg installers, apparently. [http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html]. It is preferable to distribute a simple Application Bundle within a .dmg Disk Image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Creating ASCEND.app ===&lt;br /&gt;
&lt;br /&gt;
To create the ASCEND application bundle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* scons -j2 install INSTALL_PREFIX=~/ascinst&lt;br /&gt;
* The bundle will appear as ~/ascinst/ASCEND.app&lt;br /&gt;
* TODO: add necessary GTK files to the .app!&lt;br /&gt;
* follow instructions below to turn it into a redistributable disk image&lt;br /&gt;
&lt;br /&gt;
The file {{src|mac/Info.plist}} contains all the key-value stuff describing the application. We had to make changes to {{src|pygtk/ascend.in}} to accommodate the particularities of the Mac platform, too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Creating a Disk Image (ASCEND-0.9.X.dmg) ===&lt;br /&gt;
&lt;br /&gt;
Some instructions are here:&lt;br /&gt;
[http://www.wikihow.com/Make-a-DMG-File-on-a-Mac]&lt;br /&gt;
&lt;br /&gt;
In summary:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* use the Applications/Utilities/Disk Utility application&lt;br /&gt;
* create a new image large enough for your needs&lt;br /&gt;
* mount and open the image&lt;br /&gt;
* from the Terminal, run scons -j2 install INSTALL_PREFIX=(location of your disk image folder)&lt;br /&gt;
* set the folder background image to ~/ascend/mac/folder-background.png&lt;br /&gt;
* arrange the files so that they look OK, the folder-background arrow should point from the ASCEND.app to the Applications folder alias.&lt;br /&gt;
* return to the disk image program&lt;br /&gt;
* click &#039;convert&#039; and convert to a compressed image (OK to overwrite)&lt;br /&gt;
* all done, you can double-click the image file now, and it should mount and appear as you wanted it.&lt;br /&gt;
&lt;br /&gt;
=== Finding all the GTK files ===&lt;br /&gt;
&lt;br /&gt;
To create a safely porting ASCEND.app, we need to embed all of GTK into the application bundle. The above application won&#039;t be complete until we achieve that.&lt;br /&gt;
&lt;br /&gt;
Looks like some Python packages called [http://docs.python.org/library/modulefinder.html modulefinder] (built-in to Python) or [http://pypi.python.org/pypi/modulegraph/ modulegraph] (external) may be able to help with locating all the necessary files for satisfying Python &#039;import&#039; dependencies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, [http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/otool.1.html otool] (&#039;otool -L&#039;) can be used to find shared library dependencies.&lt;br /&gt;
&lt;br /&gt;
There are also some other files such as bitmaps, &#039;locale&#039; files, and maybe others that will be required for correct running of GTK; these also need to be bundled.&lt;br /&gt;
&lt;br /&gt;
The tool [http://sourceforge.net/apps/trac/gtk-osx/wiki/Bundle ige-mac-bundler] seems to provide some degree of automation for this process, although it seems to be more oriented for C application than Python. We have some [[Porting_to_Mac/ige-mac-bundler|notes on how it works]].&lt;br /&gt;
&lt;br /&gt;
The shell-script gimpguts.sh, available from GIMPskel.zip on [http://gimp-app.sourceforge.net/ this page] also contains some code for pulling in the necessary bits of GTK for packaging.&lt;br /&gt;
&lt;br /&gt;
Our solution is a Python script that makes calls to &#039;otool&#039; and &#039;modulefinder&#039;. We hope to be able to incorporate this script into our SCons build scripts as a &#039;tool&#039;, but at the moment, {{src|scons/installgtk.py}} is standalone. This is still under development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most Mac libraries by default are hard-wired with absolute dependency paths as [http://blogs.sun.com/dipol/entry/dynamic_libraries_rpath_and_mac described by Joe Di Pol]. The solution seems to be to post-process the shared libraries after they have been copied, using &#039;install_name_tool&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Problems with non-english Systems ===&lt;br /&gt;
&lt;br /&gt;
You need to set your System to english - it&#039;s not about your system user interface language and not about your keyboard, it about the Formats.&lt;br /&gt;
&lt;br /&gt;
Go to&lt;br /&gt;
System Preferences -&amp;gt; Interantional -&amp;gt; Formats&lt;br /&gt;
&lt;br /&gt;
select english US and reboot your system.&lt;br /&gt;
&lt;br /&gt;
If you do not take this step, ascend will ignore all decimal places.&lt;br /&gt;
PI will be 3.0000 instead of 3.1415, numbers like 0.12345 will be 0.00000 possibly causing &amp;quot;Division by Zero&amp;quot; Errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems With Matplotlib ===&lt;br /&gt;
&lt;br /&gt;
[http://matplotlib.sourceforge.net/ Matplotlib] is used for all plotting by the PyGTK GUI, and Matplotlib in turn depends on [http://numpy.scipy.org/ NumPy]. NumPy doesn&#039;t work correctly with Apple&#039;s System Python, so you have to install MacPython to use the standard binary releases of Matplotlib and NumPy. Alternatively, it&#039;s possible to go back and download older versions of NumPy that &#039;&#039;do&#039;&#039; run on Apple&#039;s Python, but you&#039;ll presumably be losing some functionaly as a result.&lt;br /&gt;
&lt;br /&gt;
The conclusion from all this is that it might be advisable for ASCEND on the Mac to be linked against MacPython, and for a runtime check to be made to ensure that the correct version is in place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Connecting to Apple Events ===&lt;br /&gt;
&lt;br /&gt;
Currently, GTK on Mac has no support for receiving or sending Apple Events. This is a problem, because Mac OS X attempts to communicate using Apple Events when a file is to be opened. If the app is not listening for events, then nothing will happen.&lt;br /&gt;
&lt;br /&gt;
However, there seems to be a workaround for the case of Python scripts: [http://appscript.sourceforge.net appscript], which contains a module called [http://appscript.sourceforge.net/py-appscript/doc/aem-manual/05_targettingapplications.html py-aem]. It may be possible to incorporate this into ASCEND as a way for processing such events. There may be other similar modules, possible. Also, PyObjC may provide another way of creating event listeners. These modules are included by default with [http://www.python.org/download/mac/ MacPython].&lt;br /&gt;
&lt;br /&gt;
According to GTK-OSX, there has not yet been any attempt to incorporate this stuff into ige-mac-integration, although it was agreed that it would be desirable to integrate it there (to benefit also C-based GTK applications ported to Mac).&lt;br /&gt;
&lt;br /&gt;
An alternative approach might be to write a very small Carbon/Cocoa application that could do the event listening, and pass the events on to the main application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposed]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Mac_OS_X]]&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=Porting_to_Mac&amp;diff=727</id>
		<title>Porting to Mac</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Porting_to_Mac&amp;diff=727"/>
		<updated>2010-05-31T09:46:00Z</updated>

		<summary type="html">&lt;p&gt;Arne: /* Building Native GTK+ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ASCEND now &#039;&#039;&#039;runs successfully on Mac&#039;&#039;&#039; without problems. The remaining work is to package ASCEND as an installer or as an &#039;app&#039;, and to fix it so that it connects with Apple Events for opening files from the Finder, etc -- see below for details.&lt;br /&gt;
{{task}}&lt;br /&gt;
&lt;br /&gt;
== Installing the necessary tools ==&lt;br /&gt;
&lt;br /&gt;
You should install the following tools in order to be able to build ASCEND on Mac:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XCode&#039;&#039;&#039; from your OS X CD.&lt;br /&gt;
* &#039;&#039;&#039;gfortran&#039;&#039;&#039;. Use gfortran-macosx-x86.dmg from [http://gcc.gnu.org/wiki/GFortranBinaries]&lt;br /&gt;
* &#039;&#039;&#039;scons&#039;&#039;&#039; by typing &#039;easy_install scons&#039;&lt;br /&gt;
* &#039;&#039;&#039;swig&#039;&#039;&#039;. We have version 1.3.31, not sure if it came with XCode or elsewhere (???). Version 1.3.39 and 1.3.40 are known to cause problems on other platforms.&lt;br /&gt;
* &#039;&#039;&#039;subversion&#039;&#039;&#039; (see [[VersionManagement|here]] or try the [http://www.open.collab.net/downloads/community/OpenCollabNet version])&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
When the above tools are installed and you have obtained the source code either from a file release or from our [[VersionManagement|code repository]], now you should be able to build ASCEND. Try just running &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;scons&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There should be some output to tell you if you&#039;re missing any important components. Otherwise, you should then be able to run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;./test.py TestSolver.testlog10&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you should see a message saying &#039;OK&#039;. At this stage you have a complete working copy of ASCEND, possibly minus some of the userful [[solvers]] like [[IPOPT]], [[IDA]], [[CONOPT]]. The other import thing that you&#039;re missing is the GTK+ GUI library that allows ASCEND to present its user interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Native GTK+ ==&lt;br /&gt;
&lt;br /&gt;
ASCEND uses GTK+ for its GUI. This is a cross-platform GUI library that works primarily on Linux but is also supported on Windows and Mac OS X. For Mac, it is currently necessary to build it from source, following the [http://sourceforge.net/apps/trac/gtk-osx/wiki/Build instructions from the GTK-OSX project].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps are something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Make sure you have Xcode, subversion and git installed, as outlined at [http://sourceforge.net/apps/trac/gtk-osx/wiki/Build]&lt;br /&gt;
* Download the script [http://downloads.sourceforge.net/sourceforge/gtk-osx/gtk-osx-build-setup.sh] and run it using &#039;&amp;lt;tt&amp;gt;sh gtk-osx-build-setup.sh&amp;lt;/tt&amp;gt;&#039; (no quotes).&lt;br /&gt;
* Edit the resulting &amp;lt;tt&amp;gt;~/.jhbuildrc-custom&amp;lt;/tt&amp;gt; file, adding &#039;&amp;lt;tt&amp;gt;build_policy = &amp;quot;updated-deps&amp;quot;&amp;lt;/tt&amp;gt;&#039; as a line at the end of the file (no single quotes).&lt;br /&gt;
* Set up an alias that will run &amp;lt;tt&amp;gt;jhbuild&amp;lt;/tt&amp;gt; in a stripped down environment that does not contain any reference to the Fink (/sw/...) or MacPorts (?) directories (if you have them): A good option is to set&lt;br /&gt;
:&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;pre&amp;gt;alias jhbuild=&amp;amp;quot;PATH=/opt/subversion/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:~/gtk/inst ~/.local/bin/jhbuild&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;alias jhbuild=&amp;amp;quot;PATH=/opt/subversion/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:~/gtk/inst ~/.local/bin/jhbuild&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
According to the [http://sourceforge.net/apps/trac/gtk-osx/wiki/Build description on Sourceforge], build PyGTK as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild bootstrap&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild build meta-gtk-osx-bootstrap&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild build meta-gtk-osx-core&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;jhbuild pygtk&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now test that PyGTK is working by running &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt; and checking that &amp;lt;tt&amp;gt;import gtk&amp;lt;/tt&amp;gt; doesn&#039;t cause errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If that&#039;s working, you should be able to use your working copy of ASCEND (as above) to run &amp;lt;tt&amp;gt;pygtk/ascdev&amp;lt;/tt&amp;gt;. This should open ASCEND, but you may have to command-tab to the correct window, as it won&#039;t pop to the front automatically.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a screenshot of ASCEND on Native GTK-Quartz on OS X!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;thumb tnone&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;thumbinner&amp;quot; style=&amp;quot;width:302px;&amp;quot;&amp;gt;[[Image:ASCENDnativeOSX.png]] &amp;lt;div class=&amp;quot;thumbcaption&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;magnify&amp;quot;&amp;gt;[[File:ASCENDnativeOSX.png|&amp;lt;img src=&amp;quot;/skins/common/images/magnify-clip.png&amp;quot; width=&amp;quot;15&amp;quot; height=&amp;quot;11&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;]]&amp;lt;/div&amp;gt;Screenshot of the PyGTK GUI running on Mac OSX with GTK-OSX (Quartz/Native GTK)&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: currently, the ASCEND GUI on Mac still behaves much the same as it would on Windows or Linux; we haven&#039;t yet &#039;mackified&#039; the keyboard shortcuts and menu layout. This will be using the &#039;ige-mac-integration&#039; library that&#039;s also provided by the GTK-OSX project.&lt;br /&gt;
&lt;br /&gt;
Note that allegedly it is also possible to build native GTK using macports, but we haven&#039;t yet tried that.&lt;br /&gt;
&lt;br /&gt;
== Building the Tcl/Tk GUI ==&lt;br /&gt;
&lt;br /&gt;
No work yet to determine what will be required to the Tcl/Tk GUI running on Mac. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It may be fairly straightforward to get this GUI running, possibly using these binaries for Tcl/Tk:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [http://www.categorifiedcoder.info/tcltk/]&lt;br /&gt;
&lt;br /&gt;
== Preparing for distribution ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following part is still under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once GTK is build using jhbuild above, we need to re-package ASCEND in the form of a &#039;normal&#039; Mac OS X application. To do this,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;cd ~/ascend&lt;br /&gt;
python scons/installgtk.py&lt;br /&gt;
scons install INSTALL_PREFIX=~/ascinst&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those steps will first copy GTK and associated files into &amp;lt;tt&amp;gt;dist/PyGTK.bundle&amp;lt;/tt&amp;gt;. Next, they will copy all the ASCEND files as well as PyGTK.bundle into ~/ascinst/ASCEND.app. Other files will be added to the ~/ascint folder, in preparation for making a .dmg disk image that will be suitable for distribution.&lt;br /&gt;
&lt;br /&gt;
Currently, we are still working out some final bugs with the creation of the PyGTK.bundle, so this final step doesn&#039;t entirely work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Development notes ==&lt;br /&gt;
&lt;br /&gt;
=== Packaging and distribution ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s recommended for most Mac applications that everything be distributed as an Application Bundle that just be dragged by the user into their Applications folder. This is certainly possible with ASCEND, but a problem is that the ASCEND Model Library is something that we would like users to see and interact with. We would like users to be able to see these folders and their contents easily using the Finder. Nesting the files within an Application bundle makes this rather difficult.&lt;br /&gt;
&lt;br /&gt;
One option would be for the ASCEND application to unpack its model library to ~/Library/Application Support/ASCEND when the program is first run. This would require Python scripting, and would not be compatible with a shared installation of the Tcl/Tk GUI on the same system.&lt;br /&gt;
&lt;br /&gt;
Another option would be to install the model library in /Library/Application Support/ASCEND/Models. This seems to be the right way forward, but it means that ASCEND can no longer just be dragged to the Applications folder to be installed. Instead, it would need an Installer to place the necessary files on the user&#039;s system. That&#039;s quite desirable, though, because such an installer could also check that the user has the correct versions of Python, GTK and PyGTK already installed on the system, and could even possibly download and install them first if required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth noting that Mac editors like TextEdit can&#039;t peer into Application Bundles, but non-Mac editors like gedit can do so... they don&#039;t impose the same restriction on entering inside such bundles.&lt;br /&gt;
&lt;br /&gt;
As a first attempt for getting everything running, it seems wise to take the simple application bundle approach.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not currently proposing to provide the Tcl/Tk GUI for Mac. This is a whole separate packaging problem.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not currently proposing to package libascend as a Framework for Mac, although that is an option, and would be appropriate if attempting to provide both Tcl/Tk and PyGTK GUIs on the same machine, and to make it easier for users to develop their own solvers, etc, on that platform.&lt;br /&gt;
&lt;br /&gt;
The general opinion on GTK is that we should include it within out Application Bundle. From the linux point of view, this is terribly inefficient, but such things are standard practise on Mac, and we should respect that in the first instance.&lt;br /&gt;
&lt;br /&gt;
The alternative of providing ASCEND to the Mac community as a Fink package was considered, however, according to Fink developers, the current &#039;stable&#039; repository for Fink is very stagnant, so we are unlikely to be able to use that as a means for distribution. &lt;br /&gt;
&lt;br /&gt;
If we want to distribute ASCEND as a multi-component thing (libascend framework, Tcl/Tk GUI, PyGTK, model library all separate) then we would need to use the Apple tool, &#039;&#039;PackageMaker&#039;&#039;, which allows developers to produce their own .pkg installers, apparently. [http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html]. It is preferable to distribute a simple Application Bundle within a .dmg Disk Image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Creating ASCEND.app ===&lt;br /&gt;
&lt;br /&gt;
To create the ASCEND application bundle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* scons -j2 install INSTALL_PREFIX=~/ascinst&lt;br /&gt;
* The bundle will appear as ~/ascinst/ASCEND.app&lt;br /&gt;
* TODO: add necessary GTK files to the .app!&lt;br /&gt;
* follow instructions below to turn it into a redistributable disk image&lt;br /&gt;
&lt;br /&gt;
The file {{src|mac/Info.plist}} contains all the key-value stuff describing the application. We had to make changes to {{src|pygtk/ascend.in}} to accommodate the particularities of the Mac platform, too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Creating a Disk Image (ASCEND-0.9.X.dmg) ===&lt;br /&gt;
&lt;br /&gt;
Some instructions are here:&lt;br /&gt;
[http://www.wikihow.com/Make-a-DMG-File-on-a-Mac]&lt;br /&gt;
&lt;br /&gt;
In summary:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* use the Applications/Utilities/Disk Utility application&lt;br /&gt;
* create a new image large enough for your needs&lt;br /&gt;
* mount and open the image&lt;br /&gt;
* from the Terminal, run scons -j2 install INSTALL_PREFIX=(location of your disk image folder)&lt;br /&gt;
* set the folder background image to ~/ascend/mac/folder-background.png&lt;br /&gt;
* arrange the files so that they look OK, the folder-background arrow should point from the ASCEND.app to the Applications folder alias.&lt;br /&gt;
* return to the disk image program&lt;br /&gt;
* click &#039;convert&#039; and convert to a compressed image (OK to overwrite)&lt;br /&gt;
* all done, you can double-click the image file now, and it should mount and appear as you wanted it.&lt;br /&gt;
&lt;br /&gt;
=== Finding all the GTK files ===&lt;br /&gt;
&lt;br /&gt;
To create a safely porting ASCEND.app, we need to embed all of GTK into the application bundle. The above application won&#039;t be complete until we achieve that.&lt;br /&gt;
&lt;br /&gt;
Looks like some Python packages called [http://docs.python.org/library/modulefinder.html modulefinder] (built-in to Python) or [http://pypi.python.org/pypi/modulegraph/ modulegraph] (external) may be able to help with locating all the necessary files for satisfying Python &#039;import&#039; dependencies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, [http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/otool.1.html otool] (&#039;otool -L&#039;) can be used to find shared library dependencies.&lt;br /&gt;
&lt;br /&gt;
There are also some other files such as bitmaps, &#039;locale&#039; files, and maybe others that will be required for correct running of GTK; these also need to be bundled.&lt;br /&gt;
&lt;br /&gt;
The tool [http://sourceforge.net/apps/trac/gtk-osx/wiki/Bundle ige-mac-bundler] seems to provide some degree of automation for this process, although it seems to be more oriented for C application than Python. We have some [[Porting_to_Mac/ige-mac-bundler|notes on how it works]].&lt;br /&gt;
&lt;br /&gt;
The shell-script gimpguts.sh, available from GIMPskel.zip on [http://gimp-app.sourceforge.net/ this page] also contains some code for pulling in the necessary bits of GTK for packaging.&lt;br /&gt;
&lt;br /&gt;
Our solution is a Python script that makes calls to &#039;otool&#039; and &#039;modulefinder&#039;. We hope to be able to incorporate this script into our SCons build scripts as a &#039;tool&#039;, but at the moment, {{src|scons/installgtk.py}} is standalone. This is still under development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most Mac libraries by default are hard-wired with absolute dependency paths as [http://blogs.sun.com/dipol/entry/dynamic_libraries_rpath_and_mac described by Joe Di Pol]. The solution seems to be to post-process the shared libraries after they have been copied, using &#039;install_name_tool&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems With Matplotlib ===&lt;br /&gt;
&lt;br /&gt;
[http://matplotlib.sourceforge.net/ Matplotlib] is used for all plotting by the PyGTK GUI, and Matplotlib in turn depends on [http://numpy.scipy.org/ NumPy]. NumPy doesn&#039;t work correctly with Apple&#039;s System Python, so you have to install MacPython to use the standard binary releases of Matplotlib and NumPy. Alternatively, it&#039;s possible to go back and download older versions of NumPy that &#039;&#039;do&#039;&#039; run on Apple&#039;s Python, but you&#039;ll presumably be losing some functionaly as a result.&lt;br /&gt;
&lt;br /&gt;
The conclusion from all this is that it might be advisable for ASCEND on the Mac to be linked against MacPython, and for a runtime check to be made to ensure that the correct version is in place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Connecting to Apple Events ===&lt;br /&gt;
&lt;br /&gt;
Currently, GTK on Mac has no support for receiving or sending Apple Events. This is a problem, because Mac OS X attempts to communicate using Apple Events when a file is to be opened. If the app is not listening for events, then nothing will happen.&lt;br /&gt;
&lt;br /&gt;
However, there seems to be a workaround for the case of Python scripts: [http://appscript.sourceforge.net appscript], which contains a module called [http://appscript.sourceforge.net/py-appscript/doc/aem-manual/05_targettingapplications.html py-aem]. It may be possible to incorporate this into ASCEND as a way for processing such events. There may be other similar modules, possible. Also, PyObjC may provide another way of creating event listeners. These modules are included by default with [http://www.python.org/download/mac/ MacPython].&lt;br /&gt;
&lt;br /&gt;
According to GTK-OSX, there has not yet been any attempt to incorporate this stuff into ige-mac-integration, although it was agreed that it would be desirable to integrate it there (to benefit also C-based GTK applications ported to Mac).&lt;br /&gt;
&lt;br /&gt;
An alternative approach might be to write a very small Carbon/Cocoa application that could do the event listening, and pass the events on to the main application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[Category:Proposed]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Mac_OS_X]]&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=IPOPT&amp;diff=724</id>
		<title>IPOPT</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=IPOPT&amp;diff=724"/>
		<updated>2010-05-31T07:42:53Z</updated>

		<summary type="html">&lt;p&gt;Arne: /* Building IPOPT */ removed some html code that does not belong in a wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{solvers}}{{experimental}}&lt;br /&gt;
[https://projects.coin-or.org/Ipopt IPOPT] (also, [http://www.coin-or.org/Ipopt/documentation/ documentation]) is the &#039;Interior Point Optimizer&#039;, part of the the [http://www.coin-or.org/ COIN-OR] open-source effort for the development of solvers for problems in the field of operations research.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have now completed integration of the IPOPT solver into ASCEND, as part of a GSOC 2009 project by [[User:Mnm87|Mahesh Narayanamurthi]]. This implementation includes efficient methods for calculating hessian matrices directly using automatic differentiation code developed specifically for our core engine. We&#039;re looking for people to try it out and [[Support|report any problems]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sample problems ==&lt;br /&gt;
&lt;br /&gt;
A selection of sample problems that solve using IPOPT can be viewed at {{srcdir|models/test/ipopt}}. Mostly the samples are problems taken from the Hock-Schittkowsky [http://www.math.uni-bayreuth.de/~kschittkowski/tp_coll1.htm Test Examples for Nonlinear Programming Codes] test suite.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing IPOPT ==&lt;br /&gt;
&lt;br /&gt;
To test the state of the IPOPT solver, you must first install the base IPOPT software on your machine. The following instructions complement the IPOPT installation guide&amp;lt;sup id=&amp;quot;_ref-0&amp;quot; class=&amp;quot;reference&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;#_note-0&amp;quot; title=&amp;quot;&amp;quot;&amp;gt;[1]&amp;lt;/a&amp;gt;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Binaries for IPOPT (&amp;lt;tt&amp;gt;ipopt&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ipopt-devel&amp;lt;/tt&amp;gt; RPMs) are available for Fedora and openSUSE via [http://download.opensuse.org/repositories/home:/jdpipe/ OpenSUSE build service repository]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;As of Ubuntu 9.10, MUMPS is now available in the standard package repositories. However the Ubuntu version of MUMPS is not compatible with IPOPT, so the following approach downloads its own copy of MUMPS source code  during the build process.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We&#039;ve built our own Debian packages for IPOPT 3.8.1 using [[dtar]]. To build these packages for yourself on Ubuntu 9.10 Karmic, just download the Ipopt tarball, then download &amp;lt;a href=&amp;quot;/images/a/a0/Ipopt-debian.tar.bz2&amp;quot; class=&amp;quot;internal&amp;quot; title=&amp;quot;Ipopt-debian.tar.bz2&amp;quot;&amp;gt;ipopt-debian.tar.bz2&amp;lt;/a&amp;gt;, rename it to debian.tar.bz2, then type &amp;lt;tt&amp;gt;dtar Ipopt-3.8.1.tgz debian.tar.bz2&amp;lt;/tt&amp;gt;. As of Jan 2010, the resulting debian package is now available from our download page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On other systems you will need to install your own copy of IPOPT from source. Instructions are at the IPOPT website and documented below for quick setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building IPOPT==&lt;br /&gt;
&lt;br /&gt;
To use IPOPT with ASCEND, a source tar-ball of IPOPT can be downloaded from here [http://www.coin-or.org/download/source/Ipopt/ IPOPT Sources] (Version 3.6 is the latest stable distribution as on date of writing this install guide). This tarball is a &#039;partial&#039; tarball, in that it expected certain extra third-party code to be downloaded before you start the process of building the code. For a minimal free open-source installation of IPOPT, you should first use your Linux package manage to install BLAS and LAPACK developer&#039;s packages (libblas-dev and liblapack-dev on Ubuntu).&lt;br /&gt;
&lt;br /&gt;
Unpack the source into a directory (we will refer to this directory as $IPOPTTOPDIR here on).&lt;br /&gt;
&lt;br /&gt;
Next, enter the corresponding ThirdParty subdirectories of $IPOPTTOPDIR and run the &amp;lt;tt&amp;gt;./get.PackageName&amp;lt;/tt&amp;gt; scripts for &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* MUMPS&lt;br /&gt;
* METIS&lt;br /&gt;
&lt;br /&gt;
Optionally, you can also follow the IPOPT instructions for downloading the code for&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* HSL (optionally, just MA27 and MC19. Note that this is not free-&#039;&#039;libre&#039;&#039; code though)&lt;br /&gt;
&lt;br /&gt;
Note that ASL is not required, because we are not building an AMPL interface for IPOPT here. BLAS can be installed on Linux from your package repositories (see Atlas, GSL C-BLAS, and others). HSL routines are also not essential, you will need to register on the corresponding websites and you would get an e-mail confirmation giving you instructions on how to obtain them and install them. So give sufficient time for this and plan your installation accordingly (we are interested in using open source code here). LAPACK can be installed on Linux from your package repositories (on Ubuntu, the package is liblapack-dev).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If your wget is properly configured, you should be able to use these &amp;lt;tt&amp;gt;get.PackageName&amp;lt;/tt&amp;gt; shell scripts in each of the third-party folders under &#039;&#039;$IPOPTTOPDIR/ThirdParty&#039;&#039; to download and extract the corresponding package, without any problems.&lt;br /&gt;
&lt;br /&gt;
Note that the download scripts &#039;get.PackageName&#039; contain some hand-written version numbers, which you may wish to update if you want to use a newer third-party package versions.&lt;br /&gt;
&lt;br /&gt;
Once all the third-party packages have been obtained, you are ready to build and install IPOPT. It is recommended that you install IPOPT to /usr/local if possible.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;$IPOPTTOPDIR&#039;&#039;, note platform-specific issues &amp;lt;a href=&amp;quot;https://projects.coin-or.org/BuildTools/wiki/current-issues&amp;quot; class=&amp;quot;external text&amp;quot; title=&amp;quot;https://projects.coin-or.org/BuildTools/wiki/current-issues&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, then enter &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;./configure --prefix=/usr/local&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If configuration is successful, a message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;configure: Main configuration of Ipopt successful&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will be observed on the command line. You should also check the output during configuration of each package: if package configuration was successful, you should see a message, for each package, like: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;configure: Configuration of ThirdPartyMumps successful&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, proceed by issuing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;make&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
followed by:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;sudo make install&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that IPOPT is still experimental and development is ongoing. Implementation of support for this solver is not yet completed (see [[Development activities]]).&lt;br /&gt;
&lt;br /&gt;
== Building against IPOPT ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;notice metadata&amp;quot; id=&amp;quot;outdated&amp;quot; style=&amp;quot;border:solid 2pt #FDB; width:70ex; background-color:#FFF8F4;padding:4px;margin-bottom:6px&amp;quot;&amp;gt;&#039;&#039;This section is &#039;&#039;&#039;outdated&#039;&#039;&#039;. You can help out by &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://ascendwiki.cheme.cmu.edu/index.php?title=IPOPT&amp;amp;action=edit updating it]&amp;lt;/span&amp;gt;. &#039;&#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to download a working copy [[VersionManagement|from our subversion repository]], from &amp;lt;tt&amp;gt;branches/mahesh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Next you can build ASCEND with IPOPT by running &amp;lt;tt&amp;gt;scons WITH_SOLVERS=IPOPT,...&amp;lt;/tt&amp;gt; (add IPOPT to the list you were already building, or edit your &amp;lt;tt&amp;gt;options.cache&amp;lt;/tt&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
There are a number of SCons configuration options for specifying the location of your IPOPT files, as well. See &amp;lt;tt&amp;gt;scons -Qh&amp;lt;/tt&amp;gt; output for details.&lt;br /&gt;
&lt;br /&gt;
In particular, if you have not installed IPOPT to /usr/local, then you will probably need to specify the &amp;lt;tt&amp;gt;IPOPT_PREFIX&amp;lt;/tt&amp;gt; flag to SCons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will build &amp;lt;tt&amp;gt;solvers/ipopt/libipopt_ascend.so&amp;lt;/tt&amp;gt; which you may then test using &amp;lt;tt&amp;gt;./test.py TestIPOPT&amp;lt;/tt&amp;gt; or use via the GUI.&lt;br /&gt;
&lt;br /&gt;
Another simple test program is available in the &amp;lt;tt&amp;gt;pygtk&amp;lt;/tt&amp;gt; subdirectory, it can be built and run using &amp;lt;tt&amp;gt;scons -u testipopt &amp;amp;amp;&amp;amp;amp; ./testipopt&amp;lt;/tt&amp;gt;. This is useful for quicker testing because it doesn&#039;t require loading of the Python layer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HSL ==&lt;br /&gt;
&lt;br /&gt;
To use IPOPT with the HSL linear solver routines (MA27, MA57, MC19), you can compile a shared library libhsl.so using the IPOPT ThirdParty/HSL/configure script. In that case, use the LD_LIBRARY_PATH environment variable if necessary to tell IPOPT where that shared library will be found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Non-proprietary Optimization]]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[Category:Solvers]]&lt;br /&gt;
[[Category:Experimental]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=Debugging_ASCEND&amp;diff=723</id>
		<title>Debugging ASCEND</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Debugging_ASCEND&amp;diff=723"/>
		<updated>2010-05-31T04:16:59Z</updated>

		<summary type="html">&lt;p&gt;Arne: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{missing}}&lt;br /&gt;
{{outdated}}&lt;br /&gt;
===Reporting a bug===&lt;br /&gt;
&lt;br /&gt;
There is a &#039;&#039;&#039;[http://ascendbugs.cheme.cmu.edu Bug tracker]&#039;&#039;&#039; for ascend outside of this wiki.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Arne</name></author>
	</entry>
</feed>