views:

56

answers:

0

Hi, I get on trouble using gfortran on OpenSolaris 2009.06 64bit. I compile mine (gcc-4.4.1) or use the one provided by OpenSolaris package system (gcc-4.3.2).

But I'm in trouble using this simple code (extract from the more complexe one I targeted) :

        PROGRAM TESTPRGM

        REAL test;
        test=-1.14739E+002;
        write (*, 2060) 'maximum 1-velocity              =',
     &  test
2060    format('TSLICE  : ',a33,1pe13.5e3)
        STOP
        END PROGRAM TESTPRGM

When I compile this with the sun compiler (f95 provided by sunstudio package) I get this correct output with -m64 or -m32 :

$ f95 -m64 ./main.f -o main && ./main
TSLICE  : maximum 1-velocity              =-1.14739E+002

When using gfortran-4.3.2 from the system, or my gfortran 4.4.1, I get in trouble by getting :

gfortran-4.3.2 -m64 ./main.f -o main && ./main
TSLICE  : maximum 1-velocity              = 1.14739E+002

I'm really disappointed, where goes my sign ??? I get a valid output by compining -m32 and -fdefault-real-8, but not work using -m64.

I think it come from a real size problem between the program and the libgfortran.so output system, but I really don't know how to solve that issure. I really need to compile with gcc-4.4.1 with -m64, so I can't rely on using the sunstudio gcc.

Thank in advance for your suggests.