Re: Calling Fortran from Python

2007-04-05 Thread Lenard Lindstrom
Mangabasi wrote: > A little bit of googling solved the problem. instead of > sample = cdll.sample_dll.SAMPLE > > I used > > sample = windll.sample_dll.SAMPLE > > and now it seems to be working without error messages. > > Thanks a lot. > > I remember someone on the ctypes mailing

Re: Calling Fortran from Python

2007-04-05 Thread Mangabasi
On Apr 4, 10:10 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mangabasi wrote: > >>> Would Python 2.5 work with Visual Studio 6.6? > >> No. > > >> -- > >> Robert Kern > > >> "I have come to believe that the whol

Re: Calling Fortran from Python

2007-04-05 Thread Mangabasi
On Apr 4, 10:10 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mangabasi wrote: > >>> Would Python 2.5 work with Visual Studio 6.6? > >> No. > > >> -- > >> Robert Kern > > >> "I have come to believe that the whol

Re: Calling Fortran from Python

2007-04-04 Thread Lenard Lindstrom
Mangabasi wrote: > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Mangabasi wrote: >>> Would Python 2.5 work with Visual Studio 6.6? >> No. >> >> -- >> Robert Kern >> >> "I have come to believe that the whole world is an enigma, a harmless enigma >> that is made terrible by our own m

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > Would Python 2.5 work with Visual Studio 6.6? > > No. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret i

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > Would Python 2.5 work with Visual Studio 6.6? No. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://ma

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 4:39 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > I am using Visual Studio 6.0 and Compaq Visual Fortran 6.6. > > Ah. You can't use VS6 with that version of Python. I believe you need the .NET > SDK 2003. > > You could also use gcc, but I'm not sure if that will work

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > I am using Visual Studio 6.0 and Compaq Visual Fortran 6.6. Ah. You can't use VS6 with that version of Python. I believe you need the .NET SDK 2003. You could also use gcc, but I'm not sure if that will work well with Compaq Visual Fortran; you might have to use gfortran. h

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 12:22 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > Robert, > > > Thanks for your prompt response. I think I got a lot closer but no > > cigar yet. > > > This is the output > > > C:\fortrandll>f2py -c -m sample sample.pyf sample.for > > numpy_info: > > FOUND: > >

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > Robert, > > Thanks for your prompt response. I think I got a lot closer but no > cigar yet. > > This is the output > > C:\fortrandll>f2py -c -m sample sample.pyf sample.for > numpy_info: > FOUND: > define_macros = [('NUMERIC_VERSION', '"\\"24.2\\""')] > include_dirs

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
There may be a way to finish this without having to deal with distutils. F2py created three files so far samplemodule.c fortranobject.h fortranobject.c Is there a way to create the sample.pyd from these files? -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
Robert, Thanks for your prompt response. I think I got a lot closer but no cigar yet. This is the output C:\fortrandll>f2py -c -m sample sample.pyf sample.for numpy_info: FOUND: define_macros = [('NUMERIC_VERSION', '"\\"24.2\\""')] include_dirs = ['C:\\Python24\\include'] running bui

Re: Calling Fortran from Python

2007-04-03 Thread Robert Kern
Mangabasi wrote: > Has anyone provide a similar example with Pyfort, F2Py or calldll? With the latest f2py in numpy: $ cat sample.pyf !-*- f90 -*- ! Note: the context of this file is case sensitive. python module sample ! in interface ! in :sample subroutine sample(ierr1,ierr2,

Calling Fortran from Python

2007-04-03 Thread Mangabasi
Howdy, I have been trying to call the following Fortran function from Python (using Windows XP, Compaq Fortran and Python 2.4). I tried F2Py, Pyfort and calldll with no success. I think I came very close with calldll. Here is a short summary Fortran code: SUBROUTINE SAMPLE(IERR1,IERR2,A