Home > Archive > Fortran > June 2004 > Mixed C and Fortran with the Intel IA-32 compiler
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Mixed C and Fortran with the Intel IA-32 compiler
|
|
| Neil Forsythe 2004-06-25, 7:43 pm |
| Dear all
Has anyone hade any experence with compiling code that is mixed c and
fortran (c routines calling fortran routines only, fortran routines do
not call c routines) using the intel IA-32 compiler and gcc?
I have obtained a program which I can compile and run without any
problems using f77 as the fortran compiler and gcc. However when I
use the intel compiler, although the program compiles successfully, it
shows "segmantation fault" errors when running.
Is there any reason why the program should run without problems when
the f77 compiler is used, and not when the intel compiler is used?
Kind Regards
Neil
| |
| David Ham 2004-06-25, 7:43 pm |
| On 18 Jun 2004 00:59:17 -0700
n.forsythe@qub.ac.uk (Neil Forsythe) wrote:
> Dear all
>
> Has anyone hade any experence with compiling code that is mixed c and
> fortran (c routines calling fortran routines only, fortran routines do
> not call c routines) using the intel IA-32 compiler and gcc?
>
> I have obtained a program which I can compile and run without any
> problems using f77 as the fortran compiler and gcc. However when I
> use the intel compiler, although the program compiles successfully, it
> shows "segmantation fault" errors when running.
>
> Is there any reason why the program should run without problems when
> the f77 compiler is used, and not when the intel compiler is used?
Yes, because the hacks required to make argument lists mutually
intelligible between c anf fortran are compiler specific. The relevant
documentation is the chapter "Programming with Mixed Languages" in
"Intel Fortran Compiler for Linux Systems User's Guide, Volume I:
Building Applications" which should be in the doc directory of your
compiler tree. (If you were referring to the Windows version of the
compilers, change the above in the obvious way).
David
| |
| Tim Prince 2004-06-25, 7:43 pm |
|
"Neil Forsythe" <n.forsythe@qub.ac.uk> wrote in message
news:deae8c94.0406172359.1a480728@posting.google.com...
> Dear all
>
> Has anyone hade any experence with compiling code that is mixed c and
> fortran (c routines calling fortran routines only, fortran routines do
> not call c routines) using the intel IA-32 compiler and gcc?
>
> I have obtained a program which I can compile and run without any
> problems using f77 as the fortran compiler and gcc. However when I
> use the intel compiler, although the program compiles successfully, it
> shows "segmantation fault" errors when running.
>
> Is there any reason why the program should run without problems when
> the f77 compiler is used, and not when the intel compiler is used?
>
If you mean f77, as in a wrapper for f2c (not seen in linux for several
years), the main pitfall is in the different treatment of functions supplied
by Fortran library, particularly if called from C. Of course, if you mean
f77 as used under some other OS, it could be almost anything. If you mean
g77, the default for that compiler appends an additional underscore to
linkage symbols normally seen in C.
If you want to make the Intel Windows Fortran treat linkage the same as the
linux compiler, options /Qlowercase /us should work.
|
|
|
|
|