relocation truncated to fit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

relocation truncated to fit

De-Groof, Vincent
Dear all,


I am currently working on moving from Intel to GNU as a fortran compiler. Unfortunately, I am now stopped by the following error when compiling my fortran code:

c:\FIXANA\Fixana\src/pre_t3d.f:239: undefined reference to `test_'
c:\FIXANA\Fixana\src/pre_t3d.f:239:(.text+0x813): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `test_'

After googling, I have found some topics suggesting that this error is due to too much static memory being allocated. One of the suggested solutions would be to add -mcmodel=large to the compile command. However, this does not work in my case.
https://stackoverflow.com/questions/20687170/relocation-truncated-to-fit-error-in-fortran-with-large-arrays
https://stackoverflow.com/questions/31706089/relocation-truncated-to-fit-only-with-static

Interestingly, the code compiles on a Unix machine with the intel compiler. But it does not work on a windows machine (Cygwin) and the GNU compiler. The function I am calling is basically a link to a function in a library written in C. Could it be that the problem is in the compilation of this external library? Are there any special things one should remember when using gfortran and linking to external (C/C++) libraries. Or when compiling these libraries?



Thanks for any help!
Vincent