Problem with GCC 4.2 and above

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,
I have a strange problem with gcc-4.2 and above on Linux (I
compile the same code on OS X 10.4 with gcc-4.3 and it does
not create e any problems.


 I I use a simple code like this one, in the file camel.f90:

 ---------------------------------
 subroutine camel

 write(8,"(I2, ' camel')") 1

 end subroutine camel
 ----------------------------------

 and I build it as a dynamically linked library with the
 command (as is usually done, as far as I know):

 gcc -shared -fPIC -o libcamel.so cammel.f90

 I obtain the library libcamel.so.
 If I load the library in "R" [>dyn.load("libcamel.so")]and
try to call it as .C("camel_" it will crash  in misery. As far
as I know note that gcc makes functions as if they were c
functions, but I can call it as .Fortran("camel"), it will
crash just the same.

 However, if I change the function to (that is I do not use
 formatted output in fortran 90).

---------------------------------
 subroutine camel

  write(8, *) ' cammello', 1

 end subroutine camel
 ----------------------------------

 All works fine...

What am I doing wrong?

The same code compiles fine with gcc-4.1.1 on all systems
(sort of and so far). 4.2 breaks down on every non-OSX system
I have tried and in exactly the same way. It doesn't seem to
matter exactly which version they all break from 4.2 to 4.4.
Also the optimization seems to be dysfunctional (on some
architectures, like the AMD 64).

Thanks!

Lorenzo

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux