Home > Archive > Fortran > November 2007 > Re: Problem when creating a.out and -convert big_endian 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 |
Re: Problem when creating a.out and -convert big_endian compiler
|
|
| Paul van Delst 2007-11-21, 7:11 pm |
| Förster vom Silberwald wrote:
> HI:
>
> I have got a huge program:
>
I'm assuming the "-convert big_endian" is a red herring since you don't say what happens
when you *don't* use the option in a case that segfaults.
You don't elaborate on what you mean by a "second bunch.90". Instead of your
> program foo
>
> bla,bla
>
> CONTAINS
>
> a lot of subroutines
>
> end program foo
what happens if you try,
module bunch
implicit none
contains
...all your subroutines...
end module bunch
and then,
program foo
use bunch
implicit none
...blah blah...
end program foo
??
I harbour doubts this is the cause of your problem since, if your code uses assumed shape
dummy args (or some other usage where an explicit interface is required) and you didn't
stick all your "bunch" routines in a module, the compile should have failed.
But, it's a simple change to make and test.
cheers,
paulv
> ==
>
> Making the a.out with the following command:
>
> ==
> ifort -convert big_endian foo.f90 -I/home/....
> ==
>
> will produce an a.out which works on my data set.
>
> However, when putting all the subroutines (after contains) into a
> second bunch.90 file and doing the following:
>
> ==
> ifort -convert big_endian foo.f90 bunch.f90 -I/home/...
> ==
>
> will produce a.out though, but I get a segmentation fault on my binary
> files (which are being read in) when using a.out on the command line:
>
> ./a.out gives the following error message and it stops at the binary
> file:
>
> ==
> REading /TL2CON.003.bin/2006/year.bin
> forrtl: severe (174): SIGSEGV, segmentation fault occurred
> Image PC Routine Line
> Source
> a.out 0000000000408F6D Unknown Unknown
> Unknown
> a.out 00000000004120FB Unknown Unknown
> Unknown
> a.out 0000000000403062 Unknown Unknown
> Unknown
> libc.so.6 00000037E641D8A4 Unknown Unknown
> Unknown
> a.out 0000000000402FA9 Unknown Unknown
> Unknown
> ==
>
> What should I do next? Do I have to give some specific compiler
> options when linking with the option '-convert big_endian'
>
> Thanks
| |
| Paul van Delst 2007-11-21, 7:11 pm |
| Richard Maine wrote:
> Paul van Delst <Paul.vanDelst@noaa.gov> wrote:
>
>
> Me too.
>
> [suggests putting the subroutines in a module]
>
> That might help, but it still isn't necessarily identical in effect to
> having internal procedures. In particular, it doesn't get host
> association from the main.
>
>
> Why would you expect compilation to fail? I wouldn't. Are you falling
> into the mistake of expecting the compiler to catch everything? I think
> you aren't used to the separate compilation model typical of f77.
You're correct. I assumed, but didn't test. I hardly ever *don't* use explicit interfaces
so my knowledge level at what happens at any stage (compile or run) is very limited.
cheers,
paulv
|
|
|
|
|