linkng -mcmodel=medium with mpich1

I am linking objects compiled with -mcmodel=medium with mpif90, from pgi cdk, modified with the -fpic removed from the scrpit , but I get the following error…
I understood it was possible to use mpich1 (from pgi) with -mcmodel=medium, if so what I mistake I made? regards

mpif90 -v -r8 -O3 -mcmodel=medium -o …/…/…/bin/opa model.o
…/…/…/lib/oce/libopa.a …/…/…/lib/libioipsl.a
-L/home/grieco/netcdf/lib/ -lnetcdf
mpif90 for 1.2.7 (release) of : 2005/06/22 16:33:49

/usr/bin/ld /usr/lib64/crt1.o /usr/lib64/crti.o
/opt/cluster/pgi/linux86-64/7.1-3/libso/trace_init.o
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/crtbegin.o
/opt/cluster/pgi/linux86-64/7.1-3/libso/f90main.o -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2
/opt/cluster/pgi/linux86-64/7.1-3/lib/pgi.ld
-L/opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib
-L/home/grieco/netcdf/lib/ -L/opt/cluster/pgi/linux86-64/7.1-3/libso
-L/opt/cluster/pgi/linux86-64/7.1-3/lib -L/usr/lib64
-L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3 model.o
…/…/…/lib/oce/libopa.a …/…/…/lib/libioipsl.a -lnetcdf -lmpichf90nc
-lmpich -lpthread -lrt -rpath /opt/cluster/pgi/linux86-64/7.1-3/libso
-rpath /opt/cluster/pgi/linux86-64/7.1-3/lib -o …/…/…/bin/opa -lpgf90
-lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -lrt -lpthread
-lm -lgcc -lc -lgcc /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/crtend.o
/usr/lib64/crtn.o
/opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x2c):
In function MPIR_Breakpoint': /home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:113: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x48):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:114: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x64):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:115: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x80):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:116: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x9c):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:117: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0xb8):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:118: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0xd4):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:119: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0xf0):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:120: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x10c):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:121: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(debugutil.o)(.text+0x113):/home/sw/cdk/cdk/mpich-1.2.7/mpich-1.2.7/src/env/debugutil.c:122: relocation truncated to fit: R_X86_64_PC32 .bss /opt/cluster/pgi/linux86-64/7.1/mpi/mpich/lib/libmpich.a(initutil.o)(.text+0x53b): In function MPIR_Init’:
: additional relocation overflows omitted from the output
pgf90-Fatal-linker completed with exit code

Hi,

mcmodel=medium cannot be linked statically, please check your link.

I doubt if MPICH 1 supports mcmodel=medium. There might be a workaround online. Yes, sometimes it just works and other times it might not work depending on your application.

Please let us know where we have misinformed. Our MPICH libraries are compiled with -fPIC. Link and compile with -fpic should work just fine. Is there a reason why you would want to use -mcmodel=medium? If you have a large allocated memory, -Mlarge_arrays might just work.


Hongyon

I never said you have misinformed, as a matter of fact you infos are accurate and precise, but that I misunderstood the use of flags
As far as the program that I tried to compiled,I did after proper understanding of the code.
Indeed it was not necessary to use -mcmodel=medium after setting proper (mpi) domain decomposition. Sorry for the mess

Hi,

Thanks for letting us know you have solved the problem.

Hongyon