For the last a few days I was developing a project on my local machine with PGI 16.1 installed, and my compiling process was as follows:
mpifort -Mpreprocess -DTIME -fast -c emodule.cuf
mpifort -Mpreprocess -DTIME -fast -c earthr1.cuf
mpifort -Mpreprocess -DTIME -fast -mcmodel=medium earthr1.o emodule.o -o earthr1
Everything was just fine until I finally need to test my program on a cluster with PGI 15.9 installed. When I tried to compile the source on the cluster with the same command, the compiler gave me an error:
pgf90-Error-Switches -fPIC and -mcmodel=medium are not supported together
I’m not sure what is the wrong, I mean I didn’t put no -fPIC option in my compile command so why would the compiler give me such an error message?
The thing is I have to add this mcmodel=medium option in my compiling command because the total memory size exceeds 2GB, if I remove that option, I will get the following errors:
/home/XXX/earthr1.cuf:84:(.text+0xd8): relocation truncated to fit: R_X86_64_PC32 against symbol
_zoner_0_' defined in COMMON section in emodule.o /home/XXX/./earthr1.cuf:87:(.text+0xe9): relocation truncated to fit: R_X86_64_PC32 against symbol zoner_0’ defined in COMMON section in emodule.o
Please tell me what I am supposed to do to solve this problem.