User:Carloscardenas/GSOC2012

From ASCEND
Jump to: navigation, search

Original Proposal

ASCEND4 Install

Ascend4 install for MAC OS X 10.7. Download here.

Mac ASCEND4 Installer screenshot.

Planning

Ascend4 is an interesting project for simulation. It has a development that has managed to harmonize various development platforms like C, Fortran, cpp, perl and python.


Installation Process

Base System

They use a Mac OS 10.7, the core features are:

osxs-Mac-Pro:gtk osx$ uname -a

Darwin osxs-Mac-Pro.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
Error creating thumbnail: File missing
Mac screenshot

Initial environment variables are:

osxs-Mac-Pro:gtk osx$ env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/f_/zzt1_n9j0mz00f0sph2p30q80000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-7TM5Bm/Render
TERM_PROGRAM_VERSION=303.2
TERM_SESSION_ID=08A79D6D-DE69-4DD9-B68D-E5F11669CBB1
USER=osx
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-dbdtQy/Listeners
Apple_Ubiquity_Message=/tmp/launch-IrfyTY/Apple_Ubiquity_Message
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PWD=/opt/gtk
LANG=en_NZ.UTF-8
HOME=/Users/osx
SHLVL=1
LOGNAME=osx
DISPLAY=/tmp/launch-LIa43C/org.x:0
SECURITYSESSIONID=186a4
_=/usr/bin/env

Configuring Process Installation

Here is how a few extra steps to the explanation given in Porting to Mac.

Update 10.7.x Mac Osx

The default version of the MacBook Air purchased in December 2011 contains a version of the operating system on which you can install Xcode version used for this development. You need to do a system update. Downloading components are about 1.5 Gb

No development has tested the version of MAC OSX 10.8 Lion Mountain.

Installing Xcode

After updating the Mac OSX 10.7.3, install the Xcode that complement the Mac OSX packages like GCC GIT and LLV among others, should not make a binary copy of a system to the other because corrupts files development.

XCODE version is used for development:

Installing GTK and PyGTK

This installation process is similar to GTK Porting to Mac, the crucial difference to enhance direct Ascden4 packaging is that if you follow the same process source files and PYTGTK GTK installation will be in / Users / YOURUSER / gtk / inst and libraries in / Users / YOURUSER / gtk / inst / lib and when generating installer packages would be needed to place the files in those folders option ige-mac -bundler is not the best because the dependencies have many ramifications and are determined by the binary files and that would mean ruining modify.

So the installer was modified in its variables jhbuild 'HOME' to place PWD and installing the binaries and libraries took place in / opt / gtk, similar to the installation directory of PyGTK.

He has trouble pycairo library to install MAC OSX 10.7 and the problem apparently is reported AND FORMAL no solution but a problem of architecture and has to be solved by hand. This is the [bug].

Being in compiling jhbuild must hand to finish as follows:

$sudo ./waf configure --prefix=/opt/gtk --libdir=/opt/gtk/lib

They should try to modify the file _cache.py architecture eliminating standing on the Mac folder ascend the.

$sudo ./waf build
$sudo ./waf install


Failure to correct the problem would have to copy the Mac PyGTK _cairo.so port as a last resort

Installing Numpy, scipy, ipython matplopt and

Inside the folder / opt / gtk

sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
sudo pip install numpy
sudo pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev
sudo pip install -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev
sudo pip install ipython
sudo sh
python setup.py install
import matplotlib

Surely with this installation matploptlib not compile correctly it is best to enter the folder and compile it that way. Previously make.osx must configure the system with version and version of python

$cd /opt/gtk/src/matplopt 
$sudo make -f make.osx PREFIX=/opt/lib PYVERSION=2.7 fetch deps mpl_install_std

For added security to test with a sample code.

Error creating thumbnail: File missing
Matploptlib test

Installing Scons

Was installed Scons version 2.20 can be downloaded from [here].

One problem is that installers note several binary dependencies are stored in / usr / local / bin

But can not be used directly as: $ scons. You need to do the following:


ln -s /usr/local/bin/scons /bin/

Installing PCRE

SWIG has a unit called PCRE or PCRE - Perl Compatible Regular Expressions, can be downloaded from [here] and also in / opt / gtk

The compilation result should look something like this:

./configure
make
sudo make install
...
pcre-8.31 configuration summary:

    Install prefix .................. : /usr/local
    C preprocessor .................. : gcc -E
    C compiler ...................... : gcc
    C++ preprocessor ................ : g++ -E
    C++ compiler .................... : g++
    Linker .......................... : /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
    C preprocessor flags ............ : 
    C compiler flags ................ : -O2
    C++ compiler flags .............. : -O2
    Linker flags .................... : 
    Extra libraries ................. : 

    Build 8 bit pcre library ........ : yes
    Build 16 bit pcre library ....... : no
    Build C++ library ............... : yes
    Enable JIT compiling support .... : no
    Enable UTF-8/16 support ......... : no
    Unicode properties .............. : no
    Newline char/sequence ........... : lf
    \R matches only ANYCRLF ......... : no
    EBCDIC coding ................... : no
    Rebuild char tables ............. : no
    Use stack recursion ............. : yes
    POSIX mem threshold ............. : 10
    Internal link size .............. : 2
    Match limit ..................... : 10000000
    Match limit recursion ........... : MATCH_LIMIT
    Build shared libs ............... : yes
    Build static libs ............... : yes
    Use JIT in pcregrep ............. : no
    Buffer size for pcregrep ........ : 20480
    Link pcregrep with libz ......... : no
    Link pcregrep with libbz2 ....... : no
    Link pcretest with libedit ...... : no
    Link pcretest with libreadline .. : no

Also make symlink to bin:

osxs-Mac-Pro:swig-2.0.8 osx$ sudo ln -s /usr/local/bin/pcre-config /bin/


Installing SWIG

SWIG is used with gtk and python Ascend. You must download [here] if not compiled SWIG does not generate the graphical environment ascend4.

./configure
make
sudo make install

osxs-Mac-Pro:Ascend osx$ sudo ln -s /usr/local/bin/swig /bin/

Installing Sundails

Download and install [sundails] for solutions Solvers.

ASCEND4 Compiling

Download ascend4 of:

osxs-Mac-<Pro:Ascend osx$svn co svn://ascend4.org/code/branches/carlos ascend

Use the following command:

osxs-Mac-Pro:Ascend osx$scons --config=force

Alternatively the configuration files and CONOPT IPOPT

scons --config=force INSTALL_PREFIX=/usr/local/ IPOPT_PREFIX=../lib IPOPT_LIBPATH=../lib IPOPT_CPPPATH=../lib CONOPT_PREFIX=../lib CONOPT_CPPPATH=../Library  CONOPT_LIBPATH=../lib CONOPT_PATH=../lib GRAPHVIZ_CPPPATH=../lib GRAPHVIZ_LIBPATH=../lib GRAPHVIZ_LIBS=../lib

It has some posix outputs due to MAC

osxs-Mac-Pro:Ascend osx$ ./pygtk/ascdev models/johnpye/
CREATED ASCENDLIBRARY=/opt/ascend/models
CREATED ASCENDSOLVERS=/opt/ascend/solvers/cmslv:/opt/ascend/solvers/conopt:/opt/ascend/solvers/dopri5:/opt/ascend/solvers/ida:/opt/ascend/solvers/ipopt:/opt/ascend/solvers/lrslv:/opt/ascend/solvers/lsode:/opt/ascend/solvers/qrslv
CREATED DYLD_LIBRARY_PATH=/opt/ascend:/opt/ascend/pygtk
CREATED PYTHONPATH=/opt/ascend/ascxx

Restarting with...
   export ASCENDLIBRARY=/opt/ascend/models
   export ASCENDSOLVERS=/opt/ascend/solvers/cmslv:/opt/ascend/solvers/conopt:/opt/ascend/solvers/dopri5:/opt/ascend/solvers/ida:/opt/ascend/solvers/ipopt:/opt/ascend/solvers/lrslv:/opt/ascend/solvers/lsode:/opt/ascend/solvers/qrslv
   export DYLD_LIBRARY_PATH=/opt/ascend:/opt/ascend/pygtk
   export PYTHONPATH=/opt/ascend/ascxx
PYTHON...  ./pygtk/ascdev
ascdev: posix_spawn: /opt/ascend/pygtk/ascdev2.7: No such file or directory

The solution is to create a copy of ascdev to the folder ascdev pygtk

osxs-Mac-Pro:Ascend osx$ cp -r pygtk/ascdev pygtk/ascdev2.7
osxs-Mac-Pro:Ascend osx$ ./pygtk/ascdev models/johnpye/

Some screenshot more [here]

ASCEND4.app Installer Creation

Creating ASCEND4.app

To create ASCEND4 compiled files are copied to ascend as follows:


osxs-Mac-Pro:Ascend osx$ mkdir  -r ASCEND4.app/Contents/Resources
osxs-Mac-Pro:Ascend osx$ cp -r ascend ASCEND4.app/Contents/Resources
osxs-Mac-Pro:Ascend osx$ cp -r ascend/mac/Info.plist ASCEND4.app/Contents/
osxs-Mac-Pro:Ascend osx$ cp -r ascend/mac/ascend.icns ASCEND4.app/Contents/Resources
osxs-Mac-Pro:Ascend osx$ cd   ASCEND4.app/Contents
osxs-Mac-Pro:Ascend osx$ ln -s  Resources/ascend/ascdev ascend 
osxs-Mac-Pro:Ascend osx$ ln -s  Resources/ascend/ascdev2.7 ascend2.7

Creating PKG and DMG

For creating PackageMaker installer used both tools and DistUtilities MAC environment.


DMG disk creation

First you create a disk is placed ASCEND name with a space of 500 MB when you have closed within the Resource folder and ASCEND4.app


Creation of PKG

ASCEND.app is used to place inside the PKG. The files within the ASCEND.app can see [here]


List of Files dependencies

This [list] Dependency Resources is part of that anger within ASCEND.dmg file

Installers Compiled and tested for no Official installer

These packages are installed directly in the Downloads folder, which is not correct, it is best to also install in / opt / gtk because files are then linked to in the scons and may suffer breakout pass to the installer, not included in the final installer but if sl [ASCEND-t.dmg].

Official Installer for MAC OS X 10.7.x [ASCEND.dmg]

    • NOTE The installer create folder /opt/gtk and /opt/Ascend

Installing Ipopt

To install the Ipopt was taken as reference in installer ASCEND [# Ipopt Gentoo].

Installing graphviz

For tree diagrams GraphViz is installed, it also in / opt / gtk. Use sources [here].

I need scons to compile these files:

-rwxr-xr-x  1 lucialoyola  staff   31304 Aug 18 15:18 libcdt.5.dylib
-rwxr-xr-x  1 lucialoyola  staff   86216 Aug 18 15:16 libcgraph.6.dylib
-rwxr-xr-x  1 lucialoyola  staff   56100 Aug 18 15:15 libgraph.5.dylib
-rwxr-xr-x  1 lucialoyola  staff  485020 Aug 18 15:15 libgvc.6.dylib

Installing c-unit

Package was installed c-unit.

Lyx installation

There was no test

NOTE ***: It is expected to make a new installer with these packages.


Problems Found

Among the main problems migrate or make an installer for MAC OSX are:

1. - MAC has not GTK. You must use the jhbuild.

2. - Problems with configuring jhbuild PyGTK installed by default.

3. - Sundails dependencies, pcre, etc..

4. - IPOPT dependencies, when compiling graphviz.

5. - Using Virtual Environments for testing installers.

6. - Differences between using correct python syntax.

7. - The use of non-MAC OSX libraries to include in Ascend4.

8. - The time to compile everything you need to make an installer from a Clean MACOS is 26 hours with a 200kb connection.

Unsolved problems

  • Integrating and packaging facility for MACOSX ASCEND4 in Scons.
  • Add events to ASCEND4 MacOSX
  • Integrate IPOPT packages, graphviz.
  • Bug Fix GraphViz you have a problem in converting whole chain.
  • Fix ASCEND IPython console.
  • Do not rely on PackageMaker and DiskUtilities

Gsoc Student

Carlos Mauro Cárdenas Fernández