I apologize in advance if there's any ambiguity or wrong assertions in the question; I am relatively new to coding on this level. I am trying to generate an executable file using gfortran compiler that simulates a process in a 3D box but upon increasing the lattice size above a certain number (260*260*260) I get the following error:
"ld: 32-bit RIP relative reference out of range (2815218195 max is +/-2GB): from energy (0x100010630) to _rho.3920 (0x1A7CDDC00) in 'energy' from energy_global.o for architecture x86_64 collect2: error: ld returned 1 exit status "
The make file that I'm using looks like this:
FC=gfortran
FSTRICT=-Wextra -Wno-unused -Wsurprising -Wall #-Wimplicit #- pedantic
FVECTORIZE=-ftree-vectorizer-verbose=2 -ftree-vectorize -ftree-vect-loop-version
FOPTIMIZE=-fvariable-expansion-in-unroller -funroll-loops $(FVECTORIZE)
OPTS = -O3 -g $(FOPTIMIZE) #-fopenmp -mcmodel=large
FFLAGS = $(OPTS) $(PROF)
LDFLAGS = $(FFLAGS)
#
OBJ = crankNicolsonMain_global.o \
stringsplint_global.o \
initfunc_global.o \
u1.icconfiguration_global.o \
averageforhalfstep_global.o \
crankNicholsonChangename_global.o \
energy_global.o\
extrapolate_global.o\
evolveeulerPBC_global.o \
derivatives6thOrderPBC_global.o \
derivatives6thOrder_global.o \
ffluxesNumRelPBC_global.o \
ffluxesNumRel_global.o \
fdfluxesNumRelPBC_global.o \
fdfluxesNumRel_global.o \
crankNicholsonLeapforwardPBC_global.o \
all: csym.out
.f.o:
$(FC) $(FFLAGS) -c $*.f
csym.out: $(OBJ)
$(FC) -o $@ $(LDFLAGS) $(OBJ)
cleanf:
rm -f *.o *.dvi *.aux *.log core.* *~
This combine all the different parts named in the makefile and put out a executive file named csym.out. As you can see, I have specified mcmodel=large in the makefile but this still happens. I'd appreciate any comment.