From 0bfbb274cea8487e14d8677bd2fd26b38d4f6901 Mon Sep 17 00:00:00 2001 From: Bartosz Kostrzewa Date: Sun, 3 Mar 2024 12:27:18 +0100 Subject: [PATCH] fix linking with GCC 12.3.0 under certain circumstances --- block.c | 19 ++++++++----------- block.h | 26 +++++++++++++++++++------- little_D.c | 12 ------------ solver/eigenvalues.c | 6 +++--- xchange/little_field_gather.c | 12 ------------ 5 files changed, 30 insertions(+), 45 deletions(-) diff --git a/block.c b/block.c index 80d59d7c3..0106d564a 100644 --- a/block.c +++ b/block.c @@ -44,6 +44,13 @@ #define CALLOC_ERROR_CRASH {printf ("calloc errno : %d\n", errno); errno = 0; return 1;} +int nb_blocks; +int nblks_t; +int nblks_x; +int nblks_y; +int nblks_z; +int nblks_dir[4]; +int blk_gauge_eo; int init_blocks_geometry(); @@ -58,17 +65,7 @@ _Complex float * little_A_eo_32 = NULL; int * block_idx; int * block_evenidx; int * block_oddidx; -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; + static void (*boundary_D[8])(spinor * const r, spinor * const s, su3 *u) = {boundary_D_0, boundary_D_1, boundary_D_2, boundary_D_3, boundary_D_4, boundary_D_5, boundary_D_6, boundary_D_7}; diff --git a/block.h b/block.h index b4ca9d4e6..c57966b9c 100644 --- a/block.h +++ b/block.h @@ -99,13 +99,13 @@ void alt_block_compute_little_D(); extern int dfl_field_iter; extern int dfl_poly_iter; -int nb_blocks; -int nblks_t; -int nblks_x; -int nblks_y; -int nblks_z; -int nblks_dir[4]; -int blk_gauge_eo; +extern int nb_blocks; +extern int nblks_t; +extern int nblks_x; +extern int nblks_y; +extern int nblks_z; +extern int nblks_dir[4]; +extern int blk_gauge_eo; void reconstruct_global_field_GEN(spinor * const rec_field, spinor ** const psi, int nb_blocks); void reconstruct_global_field_GEN_ID(spinor * const rec_field, block * const block_list, const int id, const int nb_blocks); int split_global_field_GEN(spinor ** const psi, spinor * const field, int nb_blocks); @@ -118,4 +118,16 @@ int block_index(int t, int x, int y, int z); extern block * block_list; +typedef enum Direction { + 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; + #endif diff --git a/little_D.c b/little_D.c index 9016b0ba6..5afb252a1 100644 --- a/little_D.c +++ b/little_D.c @@ -58,18 +58,6 @@ static int ONE = 1; static _Complex double CONE, CZERO, CMONE; static _Complex float CONE_32, CZERO_32, CMONE_32; -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; - void init_little_field_exchange(_Complex double * w); void wait_little_field_exchange(const int mu); diff --git a/solver/eigenvalues.c b/solver/eigenvalues.c index 68f83aa45..4f95b1887 100644 --- a/solver/eigenvalues.c +++ b/solver/eigenvalues.c @@ -58,7 +58,7 @@ double * eigenvls = NULL; double max_eigenvalue; double * inv_eigenvls = NULL; int eigenvalues_for_cg_computed = 0; -int no_eigenvalues, evlength; +int nr_eigenvalues, evlength; /* the folowing two are needed for the overlap */ double ev_minev=-1., ev_qnorm=-1.; @@ -102,7 +102,7 @@ double eigenvalues(int * nr_of_eigenvalues, const int max_iterations, char eigenvalue_prefix[512]; - no_eigenvalues = *nr_of_eigenvalues; + nr_eigenvalues = *nr_of_eigenvalues; sprintf(eigenvector_prefix,"eigenvector.%%s.%%.2d.%%.4d"); sprintf(eigenvalue_prefix,"eigenvalues.%%s.%%.4d"); @@ -246,7 +246,7 @@ double eigenvalues(int * nr_of_eigenvalues, const int max_iterations, } (*nr_of_eigenvalues) = converged; - no_eigenvalues = converged; + nr_eigenvalues = converged; ev_minev = eigenvls[(*nr_of_eigenvalues)-1]; eigenvalues_for_cg_computed = converged; diff --git a/xchange/little_field_gather.c b/xchange/little_field_gather.c index 1b2ca089e..cd3439c82 100644 --- a/xchange/little_field_gather.c +++ b/xchange/little_field_gather.c @@ -35,18 +35,6 @@ #include "block.h" #include "little_field_gather.h" -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; - - #ifdef TM_USE_MPI MPI_Request lrequests[16]; MPI_Status lstatus[16];