I could compile and run a code on linux clusters without a problem. Now I want to run the same code on a brand new iMac, but I receive segmentation error when I run the same code. On linux I had to use the following flag:
FFLAGS= -mcmodel medium -shared-intel
but because -mcmodel is not supported, I have to comment it out. Can this be the reason of this problem?Is there any alternative for MACs?
I have tried the following flags and non of them works:
FFLAGS= -heap-arrays 10
FFLAGS= -Wl,-stack_size -Wl,10000000
PS: I just bought the iMac and I've installed the last version of intel fortran parallel studio.
You may have to make your large static arrays allocatable.
Also, at one point in time, local arrays declared in PROGRAM did not pay attention to the -heap-arrays (subroutines and functions did). I do not know if this still holds true or not. A quick test (for -heap-arrays)
... content of former program
END SUBROUTINE wasPROGRAM
Thank you for your response. The code is written in Fortran 77 in so many subroutines and the arrays are shared using COMMON. I am not sure if allocation works for fortran 77. As I mentioned -heap-array did not work for me. I am looking for a quick remedy for this situation.
I would first suggest adding -traceback to your build so that when the segfault happens you have an idea of where in the program the problem occurs. There are many, many possible reasons for segfaults and just throwing switches on the compile is not likely to be useful. You don't even know that it's the COMMON that's the problem.
Whether or not something worked in Fortran 77 is not relevant as you are using a Fortran 2008 (almost) compiler.
I suggest running the program under gdb and seeing exactly where the error occurs. When you know that, if you can't figure out the solution write back here and include as much detail as you can regarding the statement that fails, show the declaration of ALL variables mentioned in that statement, and if it is a call to a subroutine or function, the declaration of that subroutine or function and all its dummy arguments.