From: rudra on
Dear friends,
while I create a library using a makefile, that looks like

liblm_a.a:MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
$(FC) -c MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
ar -rcs liblm_a.a lm-lib.o $(lmobj) lm-lib-end.o
is it common for gfortran to give a message:
gfortran: TETRA/tfermi.o: linker input file unused because linking not
done

here TETRA/tfermi.o is not important, it prompts same for all the
files.

From: Tobias Burnus on
On 04/15/2010 06:57 PM, rudra wrote:
> Dear friends,
> while I create a library using a makefile, that looks like
>
> liblm_a.a:MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
> $(FC) -c MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
> ar -rcs liblm_a.a lm-lib.o $(lmobj) lm-lib-end.o

> is it common for gfortran to give a message:
> gfortran: TETRA/tfermi.o: linker input file unused because linking not
> done

Yes, but only if use -c (compile) ...

As you do not want to link already compiled files, you should simply
remove the "$(lmobj)" at the end of the $(FC) line. Then the "$(FC) -c"
line generates a few more .o files and in the next line, you combine the
existing .o files ("$(lmobj)") with the just created ones (in the $(FC)
line) into the library "liblm_a.a".

Tobias
From: Richard Maine on
rudra <bnrj.rudra(a)gmail.com> wrote:

> Dear friends,
> while I create a library using a makefile, that looks like
>
> liblm_a.a:MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
> $(FC) -c MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
> ar -rcs liblm_a.a lm-lib.o $(lmobj) lm-lib-end.o
> is it common for gfortran to give a message:
> gfortran: TETRA/tfermi.o: linker input file unused because linking not
> done
>
> here TETRA/tfermi.o is not important, it prompts same for all the
> files.

Allow me to observe that what is pretty much FAQ number 1 applies here.
If you understood what the problem was, then you would not be asking for
help. So odds are high that your guess as to what is important is wrong.
In particular, I would say that TETRA/tfermi.o is exactly the issue -
just like the message says. Your guess that it is not important is
wrong. Fortunately, there is enough data here for me to make a better
guess.

I am having to guess that lmobj is defined to be (at least in part)
TETRA/tfermi.o, although you don't actually show the definition. But in
general, the same comments apply to asking for help with makefiles as
with Fortran code. Context is important; in this case, context includes
the definition of lmobj.

The -c switch (which you appropriately use) tells the compiler to do
compilation only, rather than compilation and linking.

It makes no sense to specify something like TETRA/tfermi.o when doing
compilation only. That is an object file that would have no effect on
compilation. It is already the result of compiling (somethng else). It
could be used in linking, but your -c switch tells the compiler not to
do linking.

So the compiler is telling you exactly what is happening - you have
specified a file that has no relevance to what you asked the compiler to
do. This is presumably not activelt harmful, but it is certainly odd
enough to merit a warning message because it suggests a misunderstanding
somewhere.

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
From: rudra on
lmobj is the collection of all abject files, I was hesitating to
attach the full make file, but here it is.

ATOMOBJ= ATOM/atetot.o ATOM/atompp.o ATOM/atomsc.o \
ATOM/atscet.o ATOM/dfphi.o ATOM/enutpp.o ATOM/fctp.o \
ATOM/fctp0.o ATOM/getq.o ATOM/gintsr.o ATOM/initec.o \
ATOM/mixrho.o ATOM/mkcoef.o ATOM/mkgfac.o ATOM/mkrhot.o \
ATOM/mkrofi.o ATOM/mktauc.o ATOM/newrho.o ATOM/norm1g.o \
ATOM/perdew.o ATOM/phidot.o ATOM/poiss0.o ATOM/polcoe.o \
ATOM/potpar.o ATOM/radgra.o ATOM/rhocor.o ATOM/rmesh.o \
ATOM/rseq.o ATOM/rsq1.o ATOM/rsq2.o ATOM/xcepmu.o \
ATOM/xcloc1.o ATOM/xcloc2.o ATOM/xcnlc1.o ATOM/xcnlc2.o \
ATOM/xcpot.o ATOM/xperdew.o ATOM/optical.o ATOM/atompp1.o \
ATOM/potpar1.o
#
#
BLASOBJ= BLAS/dasum.o BLAS/daxpy.o BLAS/dcopy.o \
BLAS/ddot.o BLAS/dscal.o BLAS/dsum.o BLAS/dswap.o \
BLAS/idamax.o BLAS/isum.o
#
#
BNDASAOBJ= BNDASA/atfold.o BNDASA/bandwt.o BNDASA/bloch.o \
BNDASA/bndasa.o BNDASA/chkafm.o BNDASA/copafm.o BNDASA/diagno.o \
BNDASA/efrang.o BNDASA/hmltnm.o BNDASA/hmltns.o BNDASA/i3cnto.o \
BNDASA/i3cntr.o BNDASA/makbet.o BNDASA/makdia.o BNDASA/makdsd.o \
BNDASA/makidx.o BNDASA/makipt.o BNDASA/makoal.o BNDASA/makovc.o \
BNDASA/makpph.o BNDASA/makrcz.o BNDASA/makvec.o BNDASA/makwts.o \
BNDASA/mkbdot.o BNDASA/mkbnds.o BNDASA/moment.o BNDASA/ortrep.o \
BNDASA/pptrns.o BNDASA/secmat.o BNDASA/shffle.o BNDASA/trs.o \
BNDASA/trsdot.o BNDASA/veloc.o
#
#

LMIOOBJ= LMIO/aiocor.o LMIO/aiogen.o LMIO/aiomom.o \
LMIO/aioovc.o LMIO/aiopar.o LMIO/aiophi.o LMIO/aiopot.o \
LMIO/aiorho.o LMIO/aiotau.o LMIO/ioband.o LMIO/iobnd2.o \
LMIO/iodmat.o LMIO/iodos.o LMIO/iostr.o LMIO/iostr2.o \
LMIO/rdcor.o LMIO/rdctrl.o LMIO/rdferm.o LMIO/rdphi.o \
LMIO/rdpot.o LMIO/rdrho.o LMIO/wrbnds.o LMIO/wrif3d.o \
LMIO/wrlmfs.o LMIO/wrmatc.o LMIO/wrsyml.o LMIO/wrteig.o \
LMIO/writepp.o LMIO/wrmom1.o LMIO/wrmom2.o LMIO/wrmom_atom.o \
LMIO/wrmom_mix.o LMIO/writves1.o LMIO/writves2.o LMIO/wrmom3.o
#

MADOBJ= MAD/kalph1.o MAD/kewald.o MAD/madmat.o \
MAD/madpot.o MAD/maksk.o MAD/mstrx4.o MAD/strx00.o



lmobj=\
$(ATOMOBJ) $(BLASOBJ) $(BNDASAOBJ) $(DENSOBJ)\
$(EISPOBJ) $(EXTENSOBJ) $(FINDESOBJ) $(HARTREEOBJ)\
$(IOLIBOBJ) $(IOCTRLOBJ) $(LATTICEOBJ) $(LINPOBJ)\
$(LMIOOBJ) $(MADOBJ) $(MAINAOBJ) $(RHONSOBJ)\
$(SAMPLEOBJ) $(SYMOBJ) $(TBSTROBJ) $(TETRAOBJ)

#all off the variables are compiled properly, only showing few of them
as example
#
# now define dependencies and activities
#
..f.o:
$(FC) -c $(PREFLAGS) $(FFLAGS) $<
mv $(*F).o $(*D)
#
..c.o:
$(CC) $(CCFLAGS) -c $<
mv $(*F).o $(*D)

..f90.o:
$(FC) -c $(PREFLAGS) $(FFLAGS) $<

liblm_a.a:MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
$(FC) -c MAIN/lm-lib.f90 MAIN/lm-lib-end.f90 $(lmobj)
ar -rcs liblm_a.a lm-lib.o $(lmobj) lm-lib-end.o

clean:
rm -f */*.o *.o *.a

From: rudra on
The problem is solved, Thanks to you, Tobius and Richard