OSX 10.5 and Python Interface

43 views
Skip to first unread message

Ricardo

unread,
Sep 9, 2011, 11:03:53 AM9/9/11
to TANGO Project - ALGENCAN
Hi,
we realized that running ALGENCAN trough the Python interface in an OS X
environment isn't completely straightforward.
We managed to successfully compile and run ALGENCAN-2.3.7 and the
Python interface using OS X 10.5 and would like to share some notes.
Our system is running Mac OS X 10.5.8, Python 2.7.2, GCC and GFortran
4.2.1 (Apple build 5577).
We've downloaded GFortan from here
http://r.research.att.com/gfortran-42-5577.pkg and it works with Leopard
only (and needs XCode 3.1.4 - you can get it from developer.apple.com).

In order to compile and run ALGENCAN we needed to change some of its
files too.
We modified $(ALGENCAN)/Makefile in the following way:

Lines 6 and 7:
FC := gfortran-4.2
CC := gcc-4.2

Line 11:
LDFLAGS := -O4 -shared -undefined dynamic_lookup

Lines 35 and 36:
PYTHONINC :=
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
PYTHONLIB := /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

We also needed to modify dim.par ($(ALGENCAN)/sources/algencan/dim.par)
reducing the sizes of all parameters (larger values may be ok, that
depends on your system memory limits):

parameter ( mmax = 500 )
parameter ( nmax = 500 )
parameter ( nsmax = 100 )
parameter ( nsysmax = 500 )
parameter ( nnzmax = 100 )
parameter ( jcnnzmax = 100 )
parameter ( hnnzmax = 100 )

I would like to note that these changes in dim.par were enough to solve
the problem described by toyprob.py, but you must change you dim.par
considering the problem you really want to solve.


Best wishes,


Ricardo

Volker

unread,
Sep 12, 2011, 8:18:35 AM9/12/11
to TANGO Project - ALGENCAN
Hi,

I could successfully compile (and import pywrapper.so) the python
interface of algencan after applying your mentioned changes.

Thanks
Volker

On Sep 9, 5:03 pm, Ricardo <ricardoluizandr...@gmail.com> wrote:
> Hi,
> we realized that running ALGENCAN trough the Python interface in an OS X
> environment isn't completely straightforward.
> We managed to successfully compile and run  ALGENCAN-2.3.7 and the
> Python interface using OS X 10.5 and would like to share some notes.
> Our system is running Mac OS X 10.5.8, Python 2.7.2, GCC and GFortran
> 4.2.1 (Apple build 5577).
> We've downloaded GFortan from herehttp://r.research.att.com/gfortran-42-5577.pkgand it works with Leopard

Volker

unread,
Sep 12, 2011, 10:01:11 AM9/12/11
to TANGO Project - ALGENCAN
Hi,

I forgot to mentioned my system specs.

- Mac OS X 10.7.1
- python 2.7.2 installed via homebrew (homebrew + pip is (for me) the
best way for installing a fresh and up to date python!!!)
- gcc-4.2 (from Xcode 4.1.1)
- gfortran 4.2 (build 5666) again installed with homebrew

Best regards
Volker

On Sep 12, 2:18 pm, Volker <lorrm...@physik.uni-wuerzburg.de> wrote:
> Hi,
>
> I could successfully compile (and import pywrapper.so) the python
> interface of algencan after applying your mentioned changes.
>
> Thanks
> Volker
>
> On Sep 9, 5:03 pm, Ricardo <ricardoluizandr...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
> > we realized that running ALGENCAN trough the Python interface in an OS X
> > environment isn't completely straightforward.
> > We managed to successfully compile and run  ALGENCAN-2.3.7 and the
> > Python interface using OS X 10.5 and would like to share some notes.
> > Our system is running Mac OS X 10.5.8, Python 2.7.2, GCC and GFortran
> > 4.2.1 (Apple build 5577).
> > We've downloaded GFortan from herehttp://r.research.att.com/gfortran-42-5577.pkgandit works with Leopard
Reply all
Reply to author
Forward
0 new messages