multiple definition error with -g option

multiple definition error with -g option

Hi all.

I have problems compiling my code with -g option (without -g works ok). During linking I get a bunch of errors like this:

src/modules/metrics.o:/usr/work/vip/model_x/src/modules/metrics.f90:2: multiple definition of `var$14'

src/modules/coordinates_mod.o:/usr/work/vip/model_x/src/modules/coordinates_mod.f90:2: first defined here

src/modules/metrics.o: In function `METRICS1':

/usr/work/vip/model_x/src/modules/metrics.f90:10: multiple definition of `var$16'

src/modules/coordinates_mod.o:(.bss+0x8): first defined here

src/modules/var_mod.o:(.bss+0x7f8): multiple definition of `var$14'

src/modules/coordinates_mod.o:/usr/work/vip/model_x/src/modules/coordinates_mod.f90:2: first defined here

src/modules/var_mod.o:(.bss+0x800): multiple definition of `var$16'

src/modules/coordinates_mod.o:(.bss+0x8): first defined here

These var$n's don't make any sense to me, so I can't relate them to the actuall variables.

The source is quite big, so I can't show it here. I have multiple modules referenced in different places, but I "use" modules with the "only" option everywhere, so I very much doubt I have actual multiple definitions.

I have some variables' names like dx and dx_, so I thought I might be a problem with underscoring, but playing with -us and -nus options didn't help. Any ideas?

Victor Prosolin.

P.S. Compiling the code with g95 and -g works fine.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

This looks like a compiler bug. Please report it to Intel Premier Support and be sure to include a buildable example and the exact command line(s) you used to build.

Retired 12/31/2016

My code is quite big - about 10k lines, so sending all of it would be useless and I couldn't make up a test case, so I can't submit a bug report.

This problem appears in seemingly random places. On another computer, which has different linux and libraries, but the same compiler I get a lot more error messages in completely different places - nothing similar to what I get on my workstation.

10K lines? No problem, Just create a .tar.gz of it and attach it to your Premier Support issue. I've seen much bigger apps than that in support.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today