Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28995 Discussions

multiple definition error with -g option

prosolin
Beginner
846 Views

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.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
846 Views
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.
0 Kudos
prosolin
Beginner
846 Views
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.
0 Kudos
Steven_L_Intel1
Employee
846 Views
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.
0 Kudos
Reply