AMReX-Astro / Nyx

An adaptive mesh, N-body hydro cosmological simulation code
https://amrex-astro.github.io/Nyx/
Other
90 stars 36 forks source link

Compile with Reeber fails: "no matching function for call to FabComponentBlock" #96

Open n8xm opened 1 month ago

n8xm commented 1 month ago

When I attempt to compile the LyA project with Reeber enabled on the Nyx development branch, GCC gives me the following error:

../../Util/reeber/src/reeber.cpp:433:98: error: no matching function for call to 
‘FabComponentBlock<double, 3>::FabComponentBlock(diy::GridRef<double, 3>&, 
std::vector<std::__cxx11::basic_string<char> >&, std::vector<diy::GridRef<double, 3>, 
std::allocator<diy::GridRef<double, 3> > >&, int&, int&, const diy::DiscreteBounds&, 
diy::AMRLink::Bounds&, diy::AMRLink::Bounds&, int, AMRLink*&, const Real&, 
const bool&, bool, const Real&)’
  433 |                                 new_link, absolute_rho, negate, /*absolute = */ true, cell_volume),
      |                                                                                                  ^

If I use clangd to lint the code, I get the following on line 430:

No matching constructor for initialization of 'Block' (aka 'FabComponentBlock<double, 3>')

n8xm commented 1 month ago

For reference, lines 430-433 of reeber.cpp can be found here.

n8xm commented 1 month ago

For reference, I have attached the makefile I am using: GNUmakefile.txt.

I compiled in the Exec/LyA directory with make -f GNUmakefile.txt -jN, where N is the number of compile threads.

EDIT: Also, in subprojects/amrex/Tools/GNUMake/Make.local, I set the compiler to GCC 13 and the include path to MPICH:

ifneq ($(USE_CUDA),TRUE)
CXX := g++-13
CC := gcc-13
endif

CXXFLAGS := -I /usr/lib64/mpi/gcc/mpich/include