Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29361 Discussions

Same program running successfully on linux but failed on Mac OS 10.6

forcpp
New Contributor I
606 Views
Dear all,

I compiled and run a program successfully on Linux (Red hat 3) with ifort 9.x. This program takes around 4GB RAM. The same program on Mac OS 10.6.2 with ifort 11.1.080 compiled successfully. I've compiled it with options
-m64 -g -debug all -check all -implicitnone -warn unused\
-fp-stack-check -heap-arrays -ftrapuv -check pointers\
-check bounds.
When I run it, it exits automatically unsuccessfully after some time without giving any error.

On Mac OS with gfortran with options-g -fbounds-check -Wuninitialized -O -ftrapv -fimplicit-none\
-fno-automatic
compiling successfully but failed in run with giving segmentation fault error.

Is this stack size problem since linux and mac have different ? I used the tips about stack size of this forum but nothing happened, i.e.,ifort -Wl,-stack_size,0x10000000 foo.f.

In shell by prompting $ size a.out, I'm getting

_TEXT __DATA __OBJC others dec hex

679936 98304 0 4563439616 4564217856 1100c7000.


Any help would be very much appreciated.

0 Kudos
3 Replies
Ron_Green
Moderator
606 Views
Quoting - forcpp
Dear all,

I compiled and run a program successfully on Linux (Red hat 3) with ifort 9.x. This program takes around 4GB RAM. The same program on Mac OS 10.6.2 with ifort 11.1.080 compiled successfully. I've compiled it with options
-m64 -g -debug all -check all -implicitnone -warn unused
-fp-stack-check -heap-arrays -ftrapuv -check pointers
-check bounds.
When I run it, it exits automatically unsuccessfully after some time without giving any error.

On Mac OS with gfortran with options-g -fbounds-check -Wuninitialized -O -ftrapv -fimplicit-none
-fno-automatic
compiling successfully but failed in run with giving segmentation fault error.

Is this stack size problem since linux and mac have different ? I used the tips about stack size of this forum but nothing happened, i.e.,ifort -Wl,-stack_size,0x10000000 foo.f.

In shell by prompting $ size a.out, I'm getting

_TEXT __DATA __OBJC others dec hex

679936 98304 0 4563439616 4564217856 1100c7000.


Any help would be very much appreciated.


To the compiler options you use for Ifort 11.1, add these:

-fp-stack-check -traceback

and run.

As a compile-time check, try these also: -gen-interfaces -warn interfaces
to check if your argument passing is correct.

ron
0 Kudos
forcpp
New Contributor I
606 Views

To the compiler options you use for Ifort 11.1, add these:

-fp-stack-check -traceback

and run.

As a compile-time check, try these also: -gen-interfaces -warn interfaces
to check if your argument passing is correct.

ron

Thanks Ronald.

With option-fp-stack-check -traceback, we have no compilation error but in run I'm getting:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
forrtl: severe (174): SIGSEGV, segmentation fault occurred
forrtl: severe (174): SIGSEGV, segmentation fault occurred
make: *** [test] Error 174 .


And with -gen-interfaces -warn interfaces, as above we are not getting any error at the compilation time but at the run time we have the following error:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
make: *** [test] Error 174.

Yesterday, I again checked on our linux machine and it works perfectly. Our linux machine has 4GB RAM whereas Mac Pro (Snow Leopard) machines have 8GB RAM. I don't know where is the problem. I've a question: what are the essentials and enough compiler options are that should be checked during compilation and run?

Hoping some experts help me out from this problem. Thanks.





0 Kudos
Ron_Green
Moderator
606 Views

OK, try adding

-heap-arrays

to your compilation. And try reading
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/

for more information on heap arrays option.

ron
0 Kudos
Reply