[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Python for Fortran Programmers

Bil Kleb

2/17/2006 10:32:00 AM

It was neat to see Ruby naturally appear under this
thread recently on news:comp.lang.fortran

http://tinyurl...

--
Bil
http://fun3d.lar...
13 Answers

Stephan Mueller

2/17/2006 2:44:00 PM

0

* Bil Kleb <Bil.Kleb@NASA.gov> [060217 11:32]:
> It was neat to see Ruby naturally appear under this
> thread recently on news:comp.lang.fortran

I think Ruby is getting quite popular in SC now. Btw: Is there something
like f2py for ruby?

I guess one have to use swig instead to get a binding for a fortran lib.
But there seems to be no english tutorial on the web. Any hints?


Cheers,

Steph.

PS: Bil, sorry for the PM.

Ara.T.Howard

2/17/2006 3:23:00 PM

0

pat eyler

2/17/2006 4:10:00 PM

0

On 2/17/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> On Sat, 18 Feb 2006, Stephan Mueller wrote:
>
> > * Bil Kleb <Bil.Kleb@NASA.gov> [060217 11:32]:
> >> It was neat to see Ruby naturally appear under this
> >> thread recently on news:comp.lang.fortran
> >
> > I think Ruby is getting quite popular in SC now. Btw: Is there something
> > like f2py for ruby?
> >
> > I guess one have to use swig instead to get a binding for a fortran lib

Stephan Mueller

2/18/2006 5:53:00 PM

0

* ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> [060217 16:22]:

> better still - ruby/dl can call into fortan libs directory : no binding
> required. i think this only works with f77 code though...

I guess you are right. Tried it with gfortran and all I get is a
segfault. Setting the -f2c compiler flag does not help either.

Maybe C is still the language of choice when it comes to exending ruby?


Cheers,

Steph.

Stephan Mueller

2/18/2006 10:07:00 PM

0

* Stephan Mueller <d454d@web.de> [060218 18:52]:

> I guess you are right. Tried it with gfortran and all I get is a
> segfault.

Ooops, this seems to be a problem with the way I pass over parameters
from ruby to the lib. Will have to double check this. Simple functions
without parameters do work.

Sorry for the noise.


Cheers,

- Steph.

Josef 'Jupp' Schugt

2/18/2006 10:18:00 PM

0

Hi!

At Sat, 18 Feb 2006 00:22:56 +0900, ara.t.howard@noaa.gov wrote:

> better still - ruby/dl can call into fortan libs directory : no
> binding required. i think this only works with f77 code though...

Many people actually do not need Fortran 90+ support. What they need
is support for huge FORTRAN 77 code bases that consist of millions of
code-lines and are the result of man-millenia of coding and debugging.
Even if one would hire *all* people of adequate numerical mathematics
skills that can program it would most probably take years to re-write
and sufficently test all that code in another language. And quite a
number of these people would not give up their research no matter what
you pay them.

Josef 'Jupp' Schugt
--
Let the origin be the middle of the earth, p(x,r) be the probability
density for finding person x at distance r. Make sure that a permanent
solution of int_0^R p(x,r) dr < 1 exists for R being the instantanous
value of the distance between earth and mars.


Dean Wampler

2/18/2006 11:14:00 PM

0

Fortran compilers pass arguments in the opposite order compared to C
and C++. I believe this is a "standard" and if I recall correctly,
it's because C/C++ support variable argument lists ("varargs"), while
Fortran doesn't; C passes the list in reverse order so it's easy to
mark both ends of the lists. ("Layman's" description ;) )

dean

On 2/18/06, Stephan Mueller <d454d@web.de> wrote:
> * Stephan Mueller <d454d@web.de> [060218 18:52]:
>
> > I guess you are right. Tried it with gfortran and all I get is a
> > segfault.
>
> Ooops, this seems to be a problem with the way I pass over parameters
> from ruby to the lib. Will have to double check this. Simple functions
> without parameters do work.
>
> Sorry for the noise.
>
>
> Cheers,
>
> - Steph.
>
>


--
Dean Wampler
http://www.aspectprogr...
http://www.newa...
http://www.cont...


John W Kennedy

2/18/2006 11:49:00 PM

0

Dean Wampler wrote:
> Fortran compilers pass arguments in the opposite order compared to C
> and C++.

Certain Fortran compilers on certain operating systems on certain
architectures do so.

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"

Stephan Mueller

2/19/2006 3:48:00 PM

0

* Stephan Mueller <d454d@web.de> [060218 23:06]:

> > I guess you are right. Tried it with gfortran and all I get is a
> > segfault.

Got it working now with Ruby 1.8.4 and gfortran-4.0. Thumbs up and thanks
for the help!


Steph.

Bil Kleb

2/21/2006 4:48:00 PM

0

Stephan Mueller wrote:
> Got it working now with Ruby 1.8.4 and gfortran-4.0. Thumbs up and thanks
> for the help!

Steph, can you post an example somewhere?

Thanks,
--
Bil Kleb
http://fun3d.lar...