1
votes

i'm trying to compile Datcom More Info Here, i succeeded in doing this on Mac OSX with gfortran. To do the same on W7 i downloaded MinGW and did the same things that i did on Mac but i get

Program received signal SIGSEGV: Segmentation fault - invalid memory reference 
Backtrace for this error:
#0 6f6a5456
#1 6f69321f
#2 004011e9

when i'm starting the program...

$ datcom.exe
Enter the input file name:
EX1.INP
1
Try compiling with the option -fbounds-check - if you are accessing an array incorrectly this will tell you at runtime which array and which index are causing the problem. - robince
Ok. Using the program after the recompiling, i get a new error: At line 11 of NMTEST.F90 Fortran Runtime error: Index '2' of dimension 1 of array 'kol' above upper bound of 1 In MacOSX anyway it works correctly :/ - rdbisme
I believe this is because the code follows old convetion that arr(1) means arr(*) (assumed sized array). so need to find how to treat 1 as * (or rewrite all of such by hand, which is impractical) - yosukesabai
For some versions of gfortran there was a -fugly-assumed which should fix this but I am not sure recent versions support it. What version are you using on Mac and what version with mingw? - robince
You could try playing with -std= option... maybe try -std=legacy first, or -std=f95 - robince

1 Answers

1
votes

Thanks to all of your suggestions i succeeded in building datcom. I succeeded installing Cygwin with gcc4 (that ships with 4.5.3 gfortran version). With this version simply doing

gfortran -o datcom *.F90

compiled correctly the software.

I don't know if it would have worked with Cygwin and new version of gfortran.

Thanks a lot