This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[newbie] "linker input file unused because linking not done"?
- From: Tom Roche <Tom_Roche at pobox dot com>
- To: fortran at gcc dot gnu dot org,
- Date: Fri, 25 Nov 2011 16:56:25 -0500
- Subject: [newbie] "linker input file unused because linking not done"?
- Reply-to: fortran at gcc dot gnu dot org, Tom Roche <Tom_Roche at pobox dot com>
I'm guessing that either I'm making an embarrassingly simple mistake
(my background is nearly all with VMs and interpreters), or that the
problem below is somehow related to my converting a build process
accustomed to using icc/ifc to gcc/gfortran. In any case, I'm stumped:
I have a Makefile with
> FC = gfortran
> FFLAGS = -ffixed-line-length-132 -w -c -m64 -march=native -funroll-loops --param max-unroll-times=4 -ftree-vectorize -ftree-vectorizer-verbose=0 -O2 -I$(NETCDF)/include -I$(IOAPI_ROOT)/src -I.
> LIBS = -L$(IOAPI_ROOT)/lib -lioapi \
> -L$(NETCDF)/lib -lnetcdff -lnetcdf
followed by lists of MODULES and OBJS, then
> all:
> @$(MAKE) $(MODULES)
> @$(MAKE) $(MODEL)
> $(MODEL): $(OBJS)
> $(FC) -o $(MODEL) $(FFLAGS) $(OBJS) $(MODULES) $(LIBS)
> $(OBJS): $(MODULES)
`make` compiles 96 fortran sources to object files without complaint,
then runs
> gfortran -o runme <$FFLAGS expanded here/> runme.o <95 more *.o here/> <$LIBS expanded here/>
which produces 96 lines like
> gfortran: warning: <object filename here/>: linker input file unused because linking not done
What must I utter to cause the *.o (listed in the linkage command in
the Makefile) in the current directory to be linked?
FWIW I also tried FFLAGS ending with '-L.' instead of 'I.': no change.
I suspect I need to Read Some Fine Manual: feel free to point me to one.
TIA, Tom Roche <Tom_Roche@pobox.com>