JeffersonLab / chroma

The Chroma Software System for Lattice QCD
http://jeffersonlab.github.io/chroma
Other
58 stars 50 forks source link

Build for Multigrid failed #55

Closed byujiang closed 2 years ago

byujiang commented 5 years ago

Branch: devel commit: 2d52a12cdd1e24c0d352c0ae7415530a0ad46025 System: CentOS 7.5 GCC: 7.3.1

Problem 1: ../chroma/lib/actions/ferm/invert/quda_solvers/quda_mg_utils.h:401:28: error: incompatible types in assignment of ‘char’ to ‘char [256]’ mg_param.vec_infile[0] = '\0'; ../chroma/lib/actions/ferm/invert/quda_solvers/quda_mg_utils.h:402:29: error: incompatible types in assignment of ‘char’ to ‘char [256]’ mg_param.vec_outfile[0] = '\0';

../chroma/lib/actions/ferm/invert/quda_solvers/syssolver_linop_wilson_quda_multigrid_w.h:560:28: error: incompatible types in assignment of ‘char’ to ‘char [256]’ mg_param.vec_infile[0] = '\0'; ^~~~ ../chroma/lib/actions/ferm/invert/quda_solvers/syssolver_linop_wilson_quda_multigrid_w.h:561:29: error: incompatible types in assignment of ‘char’ to ‘char [256]’ mg_param.vec_outfile[0] = '\0';

../chroma/lib/actions/ferm/invert/quda_solvers/syssolver_mdagm_clover_quda_multigrid_w.cc:330:93: error: incompatible types in assignment of ‘char’ to ‘char [256]’ if( subspace_prefix.size() > 255 ) { (subspace_pointers->mg_param).vec_outfile[255] = '\0'; } ^~~~ ../chroma/lib/actions/ferm/invert/quda_solvers/syssolver_mdagm_clover_quda_multigrid_w.cc:335:52: error: incompatible types in assignment of ‘char’ to ‘char [256]’ (subspace_pointers->mg_param).vec_outfile[0] ='\0';

Problem 2: cannot convert char ()[256] to char for vec_outfile at function std::strncpy((subspace_pointers->mg_param).vec_outfile, subspace_prefix.c_str(), 256);

For the first problem, I replaced with the strcpy() function, which shows mg_param.vec_outfile and mg_param.vec_infile is 2d strings.

For the second, I replaced (subspace_pointers-mg_param).vec_outfile with (subspace_pointers-mg_param).vec_outfile[0].

So, is this how it is designed to work?

ghost commented 5 years ago

I am very new to this project and don't have a very good understanding of what this is doing but I thought I would mention I had the same first problem when making either the master branch or the devel branch with Ubuntu 16.04, gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0. I changed

mg-param.vec_infile[0] ='\0' ------> mg-param.vec_infile[0][0] ='\0'

I figured it was typo since I could not find a simple way to set a whole array to null as simply as the original tries to do. Again, I'm not sure what I am doing and this may change how it is meant to work. I am just looking for insight on the same problem and thought I'd share where I am at.