- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
I am trying to compile a program that uses big arrays. When I compile it, I get the following error message:
read_write_andres.f:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0xce): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0xe6): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x105): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x674): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x6a5): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x6ac): additional relocation overflows omitted from the output
Then I compile it using the flag: -mcmodel=medium -shared_intel, and I get the following one:
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `NC_check_id':
nc.c:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_format':
nc.c:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_set_fill':
nc.c:(.text+0x278): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_sync':
nc.c:(.text+0x42c): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_unlimdim':
nc.c:(.text+0x5b5): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_natts':
nc.c:(.text+0x5f3): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_nvars':
nc.c:(.text+0x629): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_ndims':
nc.c:(.text+0x661): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq':
nc.c:(.text+0x69e): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_redef':
nc.c:(.text+0x70e): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_close':
nc.c:(.text+0xcb4): additional relocation overflows omitted from the output
How can I do to avoid this one? Any ideas?
Thank you very much in advance,
Andrs.
I am trying to compile a program that uses big arrays. When I compile it, I get the following error message:
read_write_andres.f:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0xce): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0xe6): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x105): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x674): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x6a5): relocation truncated to fit: R_X86_64_PC32 against `.bss'
read_write_andres.f:(.text+0x6ac): additional relocation overflows omitted from the output
Then I compile it using the flag: -mcmodel=medium -shared_intel, and I get the following one:
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `NC_check_id':
nc.c:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_format':
nc.c:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_set_fill':
nc.c:(.text+0x278): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_sync':
nc.c:(.text+0x42c): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_unlimdim':
nc.c:(.text+0x5b5): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_natts':
nc.c:(.text+0x5f3): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_nvars':
nc.c:(.text+0x629): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq_ndims':
nc.c:(.text+0x661): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_inq':
nc.c:(.text+0x69e): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_redef':
nc.c:(.text+0x70e): relocation truncated to fit: R_X86_64_PC32 against `NClist.0'
/soft/netcdf-4.0.1-intel/lib/libnetcdf.a(nc.o): In function `nc_close':
nc.c:(.text+0xcb4): additional relocation overflows omitted from the output
How can I do to avoid this one? Any ideas?
Thank you very much in advance,
Andrs.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hard to say, but I have 2 things to try:
1) did you build netcdf with -mcmodel=medium? And I believe you can build netcdf as a shared library, a .so library. Can you link against the shared library version of netcdf instead of the static .a version?
2) several linux distros, along with Windows x64, still limit static space to 2GB. This static section of your executable image/process includes all code plus Fortran static data. Static includes COMMON blocks. Allocatable data does not go into static, it is dynamically allocated on the heap section of your image/process. With mcmodel=medium this heap array is effectively limited only by the physical memory + swap on your server (64bit pointers used). So, if you can, move large arrays into a module and make them allocatable (get rid of the old COMMON blocks).
The message from the linker is telling you it's trying to shove too much code + static data into that small 2GB limited process static space. You'll have to shuffle things around to move more out of there.
Oh, I forgot to mention, you can also just reduce the size of your COMMON or static arrays to make it fit and run smaller models. USUALLY not what people want to do.
ron
1) did you build netcdf with -mcmodel=medium? And I believe you can build netcdf as a shared library, a .so library. Can you link against the shared library version of netcdf instead of the static .a version?
2) several linux distros, along with Windows x64, still limit static space to 2GB. This static section of your executable image/process includes all code plus Fortran static data. Static includes COMMON blocks. Allocatable data does not go into static, it is dynamically allocated on the heap section of your image/process. With mcmodel=medium this heap array is effectively limited only by the physical memory + swap on your server (64bit pointers used). So, if you can, move large arrays into a module and make them allocatable (get rid of the old COMMON blocks).
The message from the linker is telling you it's trying to shove too much code + static data into that small 2GB limited process static space. You'll have to shuffle things around to move more out of there.
Oh, I forgot to mention, you can also just reduce the size of your COMMON or static arrays to make it fit and run smaller models. USUALLY not what people want to do.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ron,
Thank you very much for your fast answer, I'm going to try what you say, but I think I'm going to reduce my program.
As it is a program to extract data, I don't mind making more steps...
Thank you!
Cheers,
Andrs.
Thank you very much for your fast answer, I'm going to try what you say, but I think I'm going to reduce my program.
As it is a program to extract data, I don't mind making more steps...
Thank you!
Cheers,
Andrs.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page