I remember that gfortran & ifort are different on this. Ifort does not care
if XYZ.o is present twice in the list of files to link, gfortran does. The
Makefile needs editing -- I am a Makefile anti-guru.

---
Professor Laurence Marks
Department of Materials Science and Engineering
Northwestern University
http://www.numis.northwestern.edu
Corrosion in 4D http://MURI4D.numis.northwestern.edu
Co-Editor, Acta Cryst A
"Research is to see what everybody else has seen, and to think what nobody
else has thought"
Albert Szent-Gyorgi
On Sep 11, 2015 05:16, "Elias Assmann" <elias.assm...@gmail.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 09/11/2015 11:53 AM, Lyudmila Dobysheva wrote:
> > #  Routines which can be compiled unmodified OBJS1 = module.o
> > errclr.o ... #  Routines which may require preprocessing before
> > compiling PREOBJS = module.o OBJS = $(PREOBJS) $(OBJS1)
>
> A little experimentation:
>
> > head module.f90 try.f90
> ==> module.f90 <==
> module module
>   integer :: i
> end module module
>
> ==> try.f90 <==
> program test
>   use module
>
>   print*, i
> end program test
>
> > gfortran -c module.f90 try.f90 gfortran try.o module.o
> [success]
> > gfortran try.o module.o module.o
> [error]
> module.o:(.bss+0x0): multiple definition of `__module_MOD_i'
> module.o:(.bss+0x0): first defined here
> collect2: error: ld returned 1 exit status
>
> I do not know if that alone can replace a guru, but the double
> inclusion thing seems clear enough to me.
>
>
>         Elias
>
> PS: Before you wonder, ifort does the same thing.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: Using GnuPG with Icedove - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJV8qncAAoJEE/4gtQZfOqP2+AP/0RWPi2Nw6Zzks8NN/IUOtXM
> N6lixJDEsjYwaEeCzZHr9GFMIt6mLM6V4wmCJJT/f/aMBdU/2On8lwMuvnlcM5tR
> odRC5fdKvsw1dgE/VTEthVzKNWOxBMZnPlUJBLUSVJas8r5JXCsxJjU149Vz+Ztl
> Ao1eF4csx749/K+rSAbJ6dKF5mzKaqPCJGhW+fPFhMFN4WJJtRIWuzFEFU0wrYB2
> Z3qg4o+49VE6Ym2TV3JxjiNXt62kZvO8ndRMf4GKabppVOILo1XuLIlg8uZejMNQ
> 8BSq7lCucdZoOblZ/7UcFGYdQhMTGV+3SH5WgoJ5qgVCL09ju6CndWxa/GoTIlZR
> UI0fzffVrAEbU9AiTX+cJqK8EufP6kXyWlcKxaXXIfGP6OH8oJdflQEkIrFIN0D6
> pCMLGxksLsyVc5qY4EQdzRf4zJsZcSvPu+zAl1RHQWH5BuaA/kDFG67kdAQj1g6o
> tQAqZCSlKRY7dg3yPg+uplQJKUTI7HXS8gQtMJqlD40LyxNpbMOqIYyJXGCCNPQm
> aXfVzekXpjUzxDiDTxP+cL/UK+pYsft/pe4py9rAm9I9tKD2N9kC5JudEUDFWM+5
> bnrMNjJrWY7C6GQgpzrKwyjcipnf5tWu173ElK430d7Lm5JNaYFGYLBEzI7CNz59
> mvS53CJhvGC7E0rbPb1M
> =TMtm
> -----END PGP SIGNATURE-----
> _______________________________________________
> Wien mailing list
> Wien@zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
> SEARCH the MAILING-LIST at:
> http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
>
_______________________________________________
Wien mailing list
Wien@zeus.theochem.tuwien.ac.at
http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
SEARCH the MAILING-LIST at:  
http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html

Reply via email to