etmc / tmLQCD

tmLQCD is a freely available software suite providing a set of tools to be used in lattice QCD simulations. This is mainly a HMC implementation (including PHMC and RHMC) for Wilson, Wilson Clover and Wilson twisted mass fermions and inverter for different versions of the Dirac operator. The code is fully parallelised and ships with optimisations for various modern architectures, such as commodity PC clusters and the Blue Gene family.
http://www.itkp.uni-bonn.de/~urbach/software.html
GNU General Public License v3.0
32 stars 47 forks source link

Additional Direction not needed #487

Closed sunpho84 closed 3 years ago

sunpho84 commented 3 years ago

Solving this additional error, similar to #485

/usr/bin/ld: ./lib/libxchange.a(little_field_gather.o):/home/francesco/QCD/SORGENTI/tmLQCD/build_quda/xchange/../../xchange/little_field_gather.c:47: multiple definition of `Direction'; ./lib/libhmc.a(block.o):/home/francesco/QCD/SORGENTI/tmLQCD/build_quda/../block.c:78: first defined here
kostrzewa commented 3 years ago

In the current quda_work branch, there's only a single definition of this enum in block.c. Have you perhaps changed things locally?

kostrzewa commented 3 years ago

Ah, no, I see, there's another one in little_field_gather.c, but with a different numbering!

kostrzewa commented 3 years ago

block.c:

enum{
  NONE = 0, 
  T_UP = 1, 
  T_DN = 2, 
  X_UP = 3, 
  X_DN = 4, 
  Y_UP = 5, 
  Y_DN = 6, 
  Z_UP = 7, 
  Z_DN = 8
} Direction;                                                                                                                               

xchange/little_field_gather.c:

enum{
  T_UP = 0,
  T_DN = 1,
  X_UP = 2,
  X_DN = 3,
  Y_UP = 4,
  Y_DN = 5,
  Z_UP = 6,
  Z_DN = 7 
} Direction;                                                                                                                               
kostrzewa commented 3 years ago

NONE is never used apparently, but I honestly can't tell if this won't break things. It's not like we need a Lüscher-style deflated solver given the availability of DDalphaAMG. I thus don't much care if this breaks, but @urbach should decide since he spent so much time fixing this stuff...

sunpho84 commented 3 years ago

It looks to me like the Direction structure in block.c is simply dead code, as it is not referred anywhere in the TU, so I would be tempted to say that removing it should have no impact.

Indeed both are contained in a .c file, and block.c compiles no matter the presence of the structure. Am I too naive...?

kostrzewa commented 3 years ago

I will just merge this in now. If it breaks things, somebody else will have to fix it...

sunpho84 commented 3 years ago

I'll keep my fingers crossed...