Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

fortran with Java?
Hello all:

I need to use some Fortran package(source code) in Java. I am not familiar
with Fortran.
I am wondering what is the best way to do it. I tried f2c and planned to use
the Java native interface. Unfortunately I couldn't get the c lib and the
f2c lib to link successfully with the c wrapper in Microsoft studio. Anybody
can give me some suggestions?

thanks,
-Kay



Report this thread to moderator Post Follow-up to this message
Old Post
Kay
10-13-04 08:56 AM


Re: fortran with Java?
Kay wrote:
>
> Hello all:
>
> I need to use some Fortran package(source code) in Java. I am not familiar
> with Fortran.
> I am wondering what is the best way to do it. I tried f2c and planned to u
se
> the Java native interface. Unfortunately I couldn't get the c lib and the
> f2c lib to link successfully with the c wrapper in Microsoft studio. Anybo
dy
> can give me some suggestions?
>
> thanks,
> -Kay

Well, the easiest way is to define a C wrapper that calls the Fortran
routines
directly, rather than translate the Fortran code into C as f2c does.

There are plenty of resources available on how to do that.

Regards,

Arjen

Report this thread to moderator Post Follow-up to this message
Old Post
Arjen Markus
10-13-04 08:56 AM


Re: fortran with Java?
"Kay" <kangkang@interchange.ubc.ca> wrote:
>Hello all:
>
>I need to use some Fortran package(source code) in Java. I am not familiar

>with Fortran.
>I am wondering what is the best way to do it. I tried f2c and planned to
use
>the Java native interface. Unfortunately I couldn't get the c lib and the
>f2c lib to link successfully with the c wrapper in Microsoft studio. Anybod
y
>can give me some suggestions?

Can you use f2j, a Fortran 77 to Java translator, at http://icl.cs.utk.edu/f2j/[/u...ww.newsfeed.com The #1 Newsgroup Service in the World! >100,000 News
groups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =
---

Report this thread to moderator Post Follow-up to this message
Old Post
beliavsky@aol.com
10-13-04 02:09 PM


Re: fortran with Java?
On Tue, 12 Oct 2004 22:29:13 -0700, Kay wrote:

> I need to use some Fortran package(source code) in Java. I am not familiar
> with Fortran.

> I am wondering what is the best way to do it. I tried f2c and planned to u
se
> the Java native interface. Unfortunately I couldn't get the c lib and the
> f2c lib to link successfully with the c wrapper in Microsoft studio. Anybo
dy
> can give me some suggestions?

I do this kind of work, as a contractor, so I've had some experience.

My first suggestion: Write a C "wrapper" for the Fortran code,
exposing the underlying Fortran methods through calls to JNI C routines.
This eliminates the need to write any Fortran, but does require you to
write C.

You could use a Fortran-to-Java translator like F2J (see
http://icl.cs.utk.edu/f2j/) That program only translates a subset of
Fortran 77, but it might be sufficient for your needs.

One advantage of Fortran libraries is their stability and reliability; any
translation might introduce new bugs. How large is the Fortran library?

Another technique is to communicate between a Java
wrapper and the Fortran via some mechanism such as pipes or SOAP. That,
however, requires writing some Fortran, which may not be an option in your
case.


--
Scott Robert Ladd
site: http://www.coyotegulch.com
blog: http://chaoticcoyote.blogspot.com



Report this thread to moderator Post Follow-up to this message
Old Post
Scott Robert Ladd
10-13-04 02:09 PM


Re: fortran with Java?
thanks, I actually got the f2c stuff to work later...However, option one
sounds good too. I'll try it if the f2c stuff is not satisfactory.

-Kay




Report this thread to moderator Post Follow-up to this message
Old Post
Kay
10-14-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:00 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.