sturlamolden, 04.07.2010 21:44:
On 4 Jul, 19:51, Stefan Behnel wrote:
Ok, so, which of those do you care about?
I have already said I don't care about unladen swallow.
What I meant, was: which of these benchmarks would have to be better to
make you care? Because your decision not to care
On Jul 4, 4:51 pm, Luis M. González luis...@gmail.com wrote:
On Jul 4, 12:30 am, sturlamolden sturlamol...@yahoo.no wrote:
I was just looking at Debian's benchmarks. It seems LuaJIT is now (on
median) beating Intel Fortran!
C (gcc) is running the benchmarks faster by less than
On 7/4/2010 12:51 PM, Luis M. González wrote:
Looking at median runtimes, here is what I got:
gcc 1.10
LuaJIT1.96
Java 6 -server2.13
Intel Fortran 2.18
OCaml 3.41
SBCL 3.66
JavaScript V8 7.57
PyPy
On 7/4/10 9:21 AM, sturlamolden wrote:
On 4 Jul, 14:29, David Cournapeau courn...@gmail.com wrote:
Actually, I think the main reason why Lua is much faster than other
dynamic languages is its size. The language is small. You don't list,
dict, tuples, etc...
They have managed to combine
I was just looking at Debian's benchmarks. It seems LuaJIT is now (on
median) beating Intel Fortran!
C (gcc) is running the benchmarks faster by less than a factor of two.
Consider that Lua is a dynamically typed scripting language very
similar to Python.
LuaJIT also runs the benchmarks faster
On Sat, 03 Jul 2010 20:30:30 -0700, sturlamolden wrote:
I know it's just a benchmark but this has to count as insanely
impressive. Beating Intel Fortran with a dynamic scripting language, how
is that even possible?
By being clever, using Just In Time compilation as much as possible
milliseconds either. But I do care about libraries like
Python's standard library, wxPython, NumPy, and matplotlib. And when I
need C, C++ or Fortran I know where to fint it. Nobody in the
scientific community would be sad if Python was so fast that no C or
Fortran would have to be written. And I am sure
W. eWatson wrote:
Mensanator wrote:
On Dec 14, 8:14�pm, W. eWatson wolftra...@invalid.com wrote:
I think Python is capable of executing a compiled C or FORTRAN program,
Sure, if it was compiled to an .exe file.
and maybe even getting some parameters passed back.
Sure, if the program
sturlamolden wrote:
On 17 Des, 03:41, W. eWatson wolftra...@invalid.com wrote:
His program was originally written in Python, but a new
hardware device (capture card) had no good interface with Python, so he
wrote it in C++, which does. From my knowledge of the Python program
before the entry
Mensanator wrote:
On Dec 14, 8:14�pm, W. eWatson wolftra...@invalid.com wrote:
I think Python is capable of executing a compiled C or FORTRAN program,
Sure, if it was compiled to an .exe file.
and maybe even getting some parameters passed back.
Sure, if the program prints to stdout
On 17 Des, 03:41, W. eWatson wolftra...@invalid.com wrote:
His program was originally written in Python, but a new
hardware device (capture card) had no good interface with Python, so he
wrote it in C++, which does. From my knowledge of the Python program
before the entry of c++, it seems he
On Dec 16, 8:41 pm, W. eWatson wolftra...@invalid.com wrote:
Mensanator wrote:
On Dec 14, 8:14 pm, W. eWatson wolftra...@invalid.com wrote:
I think Python is capable of executing a compiled C or FORTRAN program,
Sure, if it was compiled to an .exe file.
and maybe even getting some
On Mon, Dec 14, 2009 at 6:14 PM, W. eWatson wolftra...@invalid.com wrote:
I think Python is capable of executing a compiled C or FORTRAN program, and
maybe even getting some parameters passed back. Does anyone have a example
of how this might be done? I'm running under Win XP Pro.
import
On Dec 14, 8:14�pm, W. eWatson wolftra...@invalid.com wrote:
I think Python is capable of executing a compiled C or FORTRAN program,
Sure, if it was compiled to an .exe file.
and maybe even getting some parameters passed back.
Sure, if the program prints to stdout.
Does anyone have
Rob Briggs rdbriggs at mun.ca writes:
Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:
print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7],
tmp[i][8], tmp[i][9
Glenn Hutchings wrote:
Rob Briggs rdbriggs at mun.ca writes:
Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:
print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7],
tmp[i][8
like in Fortran? Rather
that doing this:
print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7],
tmp[i][8], tmp[i][9])
There certainly is. You can use python's string concatenation
and repeat
Hello,
Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:
print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7],
tmp[i][8], tmp[i][9])
Something like this:
print %s 7%-5.3f
On Nov 8, 8:56�am, Rob Briggs rdbri...@mun.ca wrote:
Hello,
Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:
print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], �tmp[i][6], �tmp[i][7],
tmp[i][8
How about:
print ('%s ' + '%-5.4f ' * 7) % ('text',1,2,3,4,5,6,7)
--
http://mail.python.org/mailman/listinfo/python-list
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able to do
more conveniently, especially with regard to types not supported for C
interoperability by the current Fortran standard. Any suggestions as to
other ways
In article 1032c78d-d4dd-41c0-a877-b85ca000d...@g31g2000yqc.googlegroups.com,
sturlamolden sturlamol...@yahoo.no wrote:
On 23 Aug, 12:35, n...@cam.ac.uk wrote:
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able
)
in its model. Nor most of what else Python would expect.
I am note sure what you mean. ...
You thus can pass derived types between C and Fortran.
You missed the word OOP, which seemed like the whole point. Not that
the particular word is used in the Fortran standard, but it isn't hard
to guess
of length 1, and you have
to kludge them up as arrays. That doesn't work very well, especially
for things like function results.
This obviosuly proves you wrong:
Er, no, it doesn't. I suggest that you read what I said more
carefully - and the Fortran standard. As I said, you can kludge
them up
In article 5134d9f1-0e23-4e05-a817-bf0cc9e85...@w6g2000yqw.googlegroups.com,
sturlamolden sturlamol...@yahoo.no wrote:
On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote:
You missed the word OOP, which seemed like the whole point. Not that
the particular word is used in the Fortran
. Not that
the particular word is used in the Fortran standard, but it isn't hard
to guess that he means a derived type that uses some of the OOP
features. Inheritance, polymorphism, and type-bound procedure (aka
methods in some other languages) come to mind.
But C is not OOP. The ISO C bindings
sturlamolden wrote:
On 24 Aug, 02:57, nos...@see.signature (Richard Maine) wrote:
Does anyone use OOP in Fortran anyway?
I do - currently for learning (and eventually training) purposes so I don't
distribute any
of the code. But, the fact that...
Fortran 2003 compilers are not ubiquitous
On Sun, Aug 23, 2009 at 9:21 AM, Stefan Behnelstefan...@behnel.de wrote:
n...@cam.ac.uk wrote:
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able to do
more conveniently, especially with regard to types
On 24 Aug, 18:20, n...@cam.ac.uk wrote:
This obviosuly proves you wrong:
Er, no, it doesn't. I suggest that you read what I said more
carefully - and the Fortran standard. As I said, you can kludge
them up, and that is precisely one such kludge -
You said we have to kludge them up as arrays
sturlamolden sturlamol...@yahoo.no wrote:
You also said we can only interop with
length-1 character strings. My kludge was valid Fortran and works with
strings of any length up to some sane limit that you can specify.
There might be a confusion here (and I'm not even sure on whose part
In article 1j4y84p.v5docbtueccmn%nos...@see.signature,
Richard Maine nos...@see.signature wrote:
Only character strings of length 1 are interoperable, as the term
interoperable is defined in the Fortran standard. However, that does
not mean that only character strings of length 1 will work with C
Obviously that is not allowed, because C does not know anything about
Fortran strings. How should a C compiler pass the correct data
structure to Fred?
The C bindings in Fortran 2003 has functions to convert C pointers to
Fortran pointers (c_f_pointer, c_f_procpointer), because C does not
know
to me the
usual question for Fortran assumed size arrays. Assuming that
FRED can tell from the passed string, it seems fine to me.
If not, it is a problem.
Null terminated strings are a C convention, supported by
the library and compiler (string constants). Others are legal C,
though you have
below.
Consider, for example:
=A0 =A0 SUBROUTINE Fred (X) BIND(C)
=A0 =A0 CHARACTER*(*) :: X
=A0 =A0 END SUBROUTINE Fred
Obviously that is not allowed, because C does not know anything about
Fortran strings. How should a C compiler pass the correct data
structure to Fred?
Precisely. The reason
))
This is not currently allowed and raises all sorts of 'interesting'
implementation and portability questions. For example, I defy anyone
to write Fred portably in C :-)
You mean, how does FRED know the length? It seems to me the
usual question for Fortran assumed size arrays. Assuming that
FRED can
On 24 Aug, 21:24, n...@cam.ac.uk wrote:
You might also like to consider the converse problem: how to write
a Fortran function that takes a C string of arbitrary length and
uses it.
That's what the code I showed you does.
--
http://mail.python.org/mailman/listinfo/python-list
potential confusion was
forseen, which is why there are notes specifically about it in the
Fortran standard (see below). Those notes do tend to get overlooked
though.
Only character strings of length 1 are interoperable, as the term
interoperable is defined in the Fortran standard. However
James Van Buskirk not_va...@comcast.net wrote:
Richard Maine nos...@see.signature wrote in message
news:1j4y84p.v5docbtueccmn%nos...@see.signature...
One might plausibly regard this as a kludge, but it is a kludge that is
part of the Fortran standard and is guaranteed to work with all
On Aug 23, 6:35 am, n...@cam.ac.uk wrote:
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able to do
more conveniently, especially with regard to types not supported for C
interoperability by the current Fortran
n...@cam.ac.uk wrote:
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able to do
more conveniently, especially with regard to types not supported for C
interoperability by the current Fortran standard. Any
On 23 Aug, 12:35, n...@cam.ac.uk wrote:
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able to do
more conveniently, especially with regard to types not supported for C
interoperability by the current Fortran
[Followup-To: header set to comp.lang.fortran.]
On 2009-08-23, n...@cam.ac.uk n...@cam.ac.uk wrote:
I am interested in surveying people who want to interoperate between
Fortran and Python to find out what they would like to be able to do
more conveniently, especially with regard to types
of arbitrary length?
As in, a signed C int (that most Fortran implementations use to keep
track of string lengths) may not be sufficient? No, I'm not
particularly interested in that.
No, I mean things like 'Kilroy was here'. Currently, Fortran's C
interoperability supports only strings of length 1
expect.
I am note sure what you mean. This has the same ABI:
typedef struct {
int m, n;
float r;
} myctype;
use iso_c_binding
type, bind(c) :: myftype
integer(c_int) :: m, n
real(c_float) :: s
end type
You thus can pass derived types between C and Fortran.
--
http
On 24 Aug, 00:02, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
That's a C language problem -- since a string in C is just an array
of character. The last FORTRAN dialect (and implementation) I used
passed strings
On 24 Aug, 00:02, Dennis Lee Bieber wlfr...@ix.netcom.com wrote
On 24 Aug, 01:59, sturlamolden sturlamol...@yahoo.no wrote:
subroutine foobar(cstr) bind(c, name='foobar')
use, intrinsic :: iso_c_binding
type(c_ptr) :: cstr
character(*), pointer :: fstr
call c_f_pointer(cptr, fptr)
Which means that you can write a wrapper in Fortran
On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote:
You missed the word OOP, which seemed like the whole point. Not that
the particular word is used in the Fortran standard, but it isn't hard
to guess that he means a derived type that uses some of the OOP
features. Inheritance
sturlamolden sturlamol...@yahoo.no wrote:
On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote:
You missed the word OOP, which seemed like the whole point. Not that
the particular word is used in the Fortran standard, but it isn't hard
to guess that he means a derived type
a pointer to
a character(*). However, we can create a pointer to a huge string (say
2 GB or whatever maximum the system allows), and slice that down to a
substring using strlen to obtain the length. So here is how to pass a
variable-length string from C to Fortran, tested with gcc and gfortran
4.1.1
be interesting in teh future to say inherit a Python class
from a Fortran 2003 derived type. I have no idea how to do this (I
don't know Fortran 2003 that well). But possibly one could do some
magic with the ISO C bindings, exposing the Fortran 2003 derived type
as a C etxtension class to Python.
Does anyone
sturlamolden sturlamol...@yahoo.no wrote:
Does anyone use OOP in Fortran anyway?
Presumably not many people yet because...
And Fortran 2003 compilers are not ubiquitous.
I'd not only agree, I'd say that was quite a bit understated. Last time
I checked, the number of Fortran 2003 compilers
On Mar 9, 9:55 am, John Machin sjmac...@lexicon.net wrote:
On Mar 9, 12:09 pm, Larry larry.cebu...@gmail.com wrote:
Friends,
I need to read a binary file using a Fortran 77 code to integrate with
a legacy code It looked very much complicated to me for I have no
knowledge
Friends,
I need to read a binary file using a Fortran 77 code to integrate with
a legacy code It looked very much complicated to me for I have no
knowledge in Fortran.
I could read the file with ease using Python, as shown in the
following.
###
from numpy import
On Mar 9, 12:09 pm, Larry larry.cebu...@gmail.com wrote:
Friends,
I need to read a binary file using a Fortran 77 code to integrate with
a legacy code It looked very much complicated to me for I have no
knowledge in Fortran.
I could read the file with ease using Python, as shown
OK. It sounds like it would be easiest for me, then, to dump the
arrays to a binary file (much faster than dumping it to a text) from
the fortran program. Then use f2py to load a fortran module to read
it.?.
How well does python handle binary files? Maybe I could skit the f2py
all together
On Sat, Feb 14, 2009 at 2:06 PM, tripp trippl...@gmail.com wrote:
OK. It sounds like it would be easiest for me, then, to dump the
arrays to a binary file (much faster than dumping it to a text) from
the fortran program. Then use f2py to load a fortran module to read
it.?.
I've done
tripp wrote:
... dump the arrays to a binary file (much faster than dumping it to a text)
from the fortran program
How well does python handle binary files? Maybe I could skit the f2py
all together if I can get python to read the fortran binary file...
Likely your best plan. Look
Hello Folks,
I have a fortran program I use to process several satellite images. I
currently output the results to a text file (~750 mb) which is then
read by a perl program that outputs a GIS-ready image using GDAL
(www.gdal.org). There are python libraries for GDAL too.
I'd like to pipe
tripp wrote:
Hello Folks,
I have a fortran program I use to process several satellite images. I
currently output the results to a text file (~750 mb) which is then
read by a perl program that outputs a GIS-ready image using GDAL
(www.gdal.org). There are python libraries for GDAL too.
I'd
On Feb 13, 1:27 pm, MRAB goo...@mrabarnett.plus.com wrote:
tripp wrote:
Hello Folks,
I have a fortran program I use to process several satellite images. I
currently output the results to a text file (~750 mb) which is then
read by a perl program that outputs a GIS-ready image using GDAL
On 2009-02-13 11:59, tripp wrote:
Hello Folks,
I have a fortran program I use to process several satellite images. I
currently output the results to a text file (~750 mb) which is then
read by a perl program that outputs a GIS-ready image using GDAL
(www.gdal.org). There are python libraries
alex ale...@bluewin.ch wrote:
Jon
Thank you for your answer. I tried it with no success.
However I tried with
tst=cdll.LoadLibrary(f:\\scratch\\test2\\footst.dll) instead of
tst=windll.LoadLibrary(f:\\scratch\\test2\\footst.dll)
and it runs now with no error message, I can't figure for
Duncan
Thank you for your explanation of the relationship between calling
convention and stack management.
I will try to understand better this topic in the CVF and ctypes
documentation (not so easy).
Regards Alex
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Jan 29, 2009 at 1:08 PM, alex ale...@bluewin.ch wrote:
Duncan
Thank you for your explanation of the relationship between calling
convention and stack management.
I will try to understand better this topic in the CVF and ctypes
documentation (not so easy).
Regards Alex
--
Jon
Thank you for your answer. I tried it with no success.
However I tried with
tst=cdll.LoadLibrary(f:\\scratch\\test2\\footst.dll) instead of
tst=windll.LoadLibrary(f:\\scratch\\test2\\footst.dll)
and it runs now with no error message, I can't figure for now why, but
it's great! This is
Hello everybody
I am mainly a Fortran programmer and beginning to learn Python(2.5)
and OOP programming.
I hope in the end to put a GUI on my existing Fortran code.
Therefore I am also trying to learn Python's ctypes library.
Unfortunately the ctypes tutorial does not show simple examples so I
On Jan 27, 9:41 pm, alex ale...@bluewin.ch wrote:
Hello everybody
I am mainly a Fortran programmer and beginning to learn Python(2.5)
and OOP programming.
I hope in the end to put a GUI on my existing Fortran code.
Therefore I am also trying to learn Python's ctypes library.
Unfortunately
En Wed, 19 Nov 2008 20:06:37 -0200, Yann Vonder
[EMAIL PROTECTED] escribió:
Here is a description of what I am trying to implement using F2PY:
I have created two python extension modules using F2PY. The first
extension
module (say fsubr1.so) contains a Fortran module (say tmod
Hi all,
Here is a description of what I am trying to implement using F2PY:
I have created two python extension modules using F2PY. The first extension
module (say fsubr1.so) contains a Fortran module (say tmod) and a
subroutine (say subr1) that modifies the data contained in tmod. The
second
I wrapped some fortran code using F2PY and need to be able to catch
fortran runtime errors to run the following:
# grid is a wrapped fortran module
# no runtime errors incurred when run with the correct inputs for
filetype
#---
def readGrid( self, coord='xyz
En Thu, 11 Sep 2008 10:43:08 -0300, john [EMAIL PROTECTED] escribió:
I wrapped some fortran code using F2PY and need to be able to catch
fortran runtime errors to run the following:
[reindented]
# grid is a wrapped fortran module
# no runtime errors incurred when run with the correct inputs
Gabriel,
works perfect - even in complex nested structures!
Thank you very much!
(If both Fortran and VB say char*9, why did you choose a pointer here?)
I do not know this possibility. Could you please drop me a few lines?
--
Michael
--
http://mail.python.org/mailman/listinfo/python-list
En Tue, 08 Apr 2008 06:02:17 -0300, Michael Schäfer [EMAIL PROTECTED]
escribió:
Gabriel,
works perfect - even in complex nested structures!
Thank you very much!
(If both Fortran and VB say char*9, why did you choose a pointer
here?)
I do not know this possibility. Could you please
Hi all,
I deal with the old problem passing characters from python to a
fortran dll build with CFV6.6c.
I reduced our complex structure to a simple one. Here is the Fortran
code:
SUBROUTINE DEMO2L(s)
C sample for calling CVF6.6c-DLLs from
C vb/vba/python with simple structure
En Mon, 07 Apr 2008 09:19:03 -0300, Michael Schäfer [EMAIL PROTECTED]
escribió:
Hi all,
I deal with the old problem passing characters from python to a
fortran dll build with CFV6.6c.
I reduced our complex structure to a simple one. Here is the Fortran
code:
SUBROUTINE DEMO2L(s
Jeroen Ruigrok van der Werven wrote:
I got someone who asked me to make changes in an old Fortran program she is
using for some calculations.
Why convert? Modern Fortran is an object oriented, structured language
with the singular advantage that it can run old Fortran programs.
--
http
-On [20080105 11:21], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
Why convert? Modern Fortran is an object oriented, structured language
with the singular advantage that it can run old Fortran programs.
With all due respect to Fortran but I find the syntax to be utterly
horrendous
-On [20080104 19:21], Dennis Lee Bieber ([EMAIL PROTECTED]) wrote:
If the FORTRAN is using single precision reals, I'd expect a
slow-down in Python just on that alone, as Python uses doubles as the
only float type. There is also the overhead of object access for each.
In this case it uses
Jeroen Ruigrok van der Werven wrote:
-On [20080104 19:21], Dennis Lee Bieber ([EMAIL PROTECTED]) wrote:
If the FORTRAN is using single precision reals, I'd expect a
slow-down in Python just on that alone, as Python uses doubles as the
only float type. There is also the overhead of object
On Jan 4, 2:21 pm, Jeroen Ruigrok van der Werven [EMAIL PROTECTED]
nomine.org wrote:
I got someone who asked me to make changes in an old Fortran program she is
using for some calculations.
The calculations are pretty standard aside from 2 calls to DLINCG (an IMSL
numerical_libraries function
I got someone who asked me to make changes in an old Fortran program she is
using for some calculations.
The calculations are pretty standard aside from 2 calls to DLINCG (an IMSL
numerical_libraries function to calculate an inverse matrix).
What I wonder about, does anybody have a Fortran
-On [20080104 14:22], Jeroen Ruigrok van der Werven ([EMAIL PROTECTED]) wrote:
What I wonder about, does anybody have a Fortran to Python conversion page
somewhere to map some of the basic types to Python equivalents?
Just to share my own ideas:
Seems
COMPLEX*16/complex*16 ~= complex
REAL*8
-On [20080104 15:56], Robin Becker ([EMAIL PROTECTED]) wrote:
you probably want to look at numpy an extension that handles lots of matrix
things with great ease. I think it now lives at http://scipy.org/
Yeah, I am aware of SciPy/NumPy, but aside from these two calls to do this
inverse matrix
Jeroen Ruigrok van der Werven wrote:
-On [20080104 14:22], Jeroen Ruigrok van der Werven ([EMAIL PROTECTED]) wrote:
What I wonder about, does anybody have a Fortran to Python conversion page
somewhere to map some of the basic types to Python equivalents?
Just to share my own ideas:
Seems
Jeroen Ruigrok van der Werven wrote:
I got someone who asked me to make changes in an old Fortran program she is
using for some calculations.
The calculations are pretty standard aside from 2 calls to DLINCG (an IMSL
numerical_libraries function to calculate an inverse matrix).
What I
Federico Ceccatto [EMAIL PROTECTED] wrote:
This is the kind of 'bugs' i've run into, perhaps someone could shed
some light onto them?
- Sometimes execution of child process (in this case, NTVDM.exe and
its children) stops and the object is destroyed for no reason
whatsoever. Very
Hello,
For the past year I've been building an XP Python/wxPython shell of
sorts for several dozen command line FORTRAN tools developed for
various material science problems. Given how the methods and how-to's
have been lost to everyone but the original creators for these 80's to
90's pieces
with their padded
length. YourFortranmay (but probably won't) have extensions
that allow you to pass an array of character pointers.
Charles
The solution proposed by Jugoslav Dujic, from comp lang fortran is
#Python script calling fortran subroutine
from ctypes import *
ap = windll.LoadLibrary
I'm using ctypes to call a fortran dll from python. I have no problems
passing integer and double arryas, but I have an error with str arrys.
For example:
StringVector = c_char_p * len(id) # id is a list of strings
Id_dat=StringVector()
for i in range(len(Id)):
...Id_dat[i]=id[i]
n=c_int
luis wrote:
I'm using ctypes to call a fortran dll from python. I have no problems
passing integer and double arryas, but I have an error with str arrys.
For example:
[snip]
I do not know about Microsoft Fortran compilers (your mention
of dll indicates you are probably using MS), nor much
didn't like them. And
SAMPLE became sample_ in the dll. Also note that argument passing to
Fortran subroutines is strictly pass-by-reference. Thus the ain pointer.
Lenard Lindstrom- Hide quoted text -
- Show quoted text -
Lenard,
Now I tried it as you suggested. I did not install G77 yet. I
didn't like them. And
SAMPLE became sample_ in the dll. Also note that argument passing to
Fortran subroutines is strictly pass-by-reference. Thus the ain pointer.
Lenard Lindstrom- Hide quoted text -
- Show quoted text -
A little bit of googling solved the problem. instead of
sample
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 list mentioning
running config_fc
running build_src
building extension sample sources
creating c:\docume~1\fb\locals~1\temp\tmpcosvgv
creating c:\docume~1\fb\locals~1\temp\tmpcosvgv\src
f2py: sample.pyf
Reading fortran codes...
Reading file 'sample.pyf'
Post-processing...
Block: sample
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
:\\Python24\\include']
running build
running config_fc
running build_src
building extension sample sources
creating c:\docume~1\fb\locals~1\temp\tmpcosvgv
creating c:\docume~1\fb\locals~1\temp\tmpcosvgv\src
f2py: sample.pyf
Reading fortran codes...
Reading file 'sample.pyf'
Post-processing
Reading fortran codes...
Reading file 'sample.pyf'
Post-processing...
Block: sample
Block: sample
Post-processing (stage 2)...
Building modules...
Building module sample...
Constructing wrapper function sample
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
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 well
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
--
201 - 300 of 385 matches
Mail list logo