CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Fortran 90 faster than C/C++

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 4, 2006, 01:40
Default Re: Fortran 90 faster than C/C++
  #41
andy++
Guest
 
Posts: n/a
This kind of C code can be written only by a Fortran programmer. If you realy want to try and taste programming in C++ take a good programming course in C++.

Andy

  Reply With Quote

Old   March 4, 2006, 06:53
Default Re: Fortran 90 faster than C/C++
  #42
Renato.
Guest
 
Posts: n/a
Sorry, as I said, C is to much for me... I'll keep programming in Fortran.
  Reply With Quote

Old   March 4, 2006, 14:31
Default Re: Fortran 90 faster than C/C++
  #43
andy++
Guest
 
Posts: n/a
Even though I belong to a Fortran generation I have never written any programme in this language. Simply at the time I started my programming experience the only compiler available to me was Algol 60. Yes, yes I am so old and I think if I was able to learn C++ and become an expert everyone else can. The only problem is if you want to do it. If you are in a group of people programming in Fortran under version control you probably do not have any immediate need to switch to another language. But it is only temporary.

Andy

  Reply With Quote

Old   March 6, 2006, 08:29
Default Re: Fortran 90 faster than C/C++
  #44
pivello
Guest
 
Posts: n/a
Well, we agree in something. I'm santista and I'll never be a flamenguista - even in Tokio!!!!!!!!

By the way, I've been working with fortran (77+90) since january. Do you know how to link c++ and fortran executables? I mean, one fortran executable calls a c++ one, or vice-versa?

  Reply With Quote

Old   March 6, 2006, 09:31
Default Re: Fortran 90 faster than C/C++
  #45
Renato.
Guest
 
Posts: n/a
In order to link mixed-programmed routines you must firstly compile your routines with its respective compilers, after that you can link the compiled files (object files) with the main linker of your program, for example:

I use the Metis library (entirely written in C standard) with my Fortran 90 programs. After compiling Metis I have the libmetis.a file, thus I link this file with my executable program doing:

ifort -o MyProgram *.o libmetis.a

in Compaq Visual Fortran you must insert the libmetis.a file in the link tab, or set the enviroment variables INCLUDE and LIB of the compiler.

It's the easiest way. Some libraries and routines may require to write interfaces between the languages in order to define argument passing rules (but it's not so hard to do).

Cheers

Renato.

  Reply With Quote

Old   March 6, 2006, 09:37
Default Re: Fortran 90 faster than C/C++
  #46
pivello
Guest
 
Posts: n/a
Thanks, that's what I was looking for.
  Reply With Quote

Old   March 6, 2006, 10:21
Default Re: Fortran 90 faster than C/C++
  #47
Steve
Guest
 
Posts: n/a
And if you are porting to multiple platforms, bear in mind that you'll have more success if you use the C++ compiler as a front end to the linker. I.e. compile each file with the appropriate compiler, but link the lot together with a C++ compiler command on the objects.
  Reply With Quote

Old   March 6, 2006, 13:26
Default a few good quotes
  #48
pc
Guest
 
Posts: n/a
This is always a heated debate. Perhaps we can close it off with a few good laughs about the "fun" of programming:

http://www.bellevuelinux.org/q_programming.html

  Reply With Quote

Old   March 6, 2006, 14:49
Default Re: Fortran 90 faster than C/C++
  #49
pivello
Guest
 
Posts: n/a
I guess this will be the case, since we're going to use the solver written in fortran, and a GUI written in C++. So the GUI would call the solver at some moment, and the final user would just click a button for it.
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fortran Compiler-CFX12.1 Araz CFX 12 November 2, 2014 13:46
Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77 hawk Main CFD Forum 1 April 12, 2005 22:13
visual fortran Monica Main CFD Forum 1 August 28, 2004 20:45
Fortran77 or Fortran 90 Swapnil CFX 2 November 26, 2002 16:16
Why Favoring Fortran over C/C++? Zi-Wei Chiou Main CFD Forum 35 September 26, 2001 09:34


All times are GMT -4. The time now is 05:04.