Nek5000 / nekRS

our next generation fast and scalable CFD code
https://nek5000.mcs.anl.gov/
Other
289 stars 76 forks source link

Compile error in #494

Closed joneuhauser closed 1 year ago

joneuhauser commented 1 year ago

Describe the bug

When building NekRS off current master, I get a compile error:

[ 66%] Building CXX object CMakeFiles/nekrs-lib.dir/src/elliptic/registerEllipticPreconditionerKernels.cpp.o
[..]/nekRS/src/elliptic/amgSolver/parAlmond/level.cpp: In member function ‘void parAlmond::multigridLevel::kcycleOp1(double*, double*, double*, double*)’:
[..]/nekRS/src/elliptic/amgSolver/parAlmond/level.cpp:84:91: error: no matching function for call to ‘vectorAddInnerProd(int&, const double&, double*&, double, double*&, occa::memory&, bool&, MPI_Comm&)’
   84 |   *norm_rhstilde = sqrt(vectorAddInnerProd(Nrows, a, vk, 1.0, rhs, o_weight, weighted,comm));
      |                                                                                           ^
In file included from [..]/nekRS/src/elliptic/amgSolver/parAlmond/parAlmond.hpp:39,
                 from [..]/nekRS/src/elliptic/amgSolver/parAlmond/level.cpp:27:
[..]/nekRS/src/elliptic/amgSolver/parAlmond/vector.hpp:79:8: note: candidate: ‘double parAlmond::vectorAddInnerProd(int, double, const double*, double, double*, const double*, bool, MPI_Comm)’
   79 | dfloat vectorAddInnerProd(const dlong n, const dfloat alpha, const dfloat *x,
      |        ^~~~~~~~~~~~~~~~~~
[..]/nekRS/src/elliptic/amgSolver/parAlmond/vector.hpp:81:41: note:   no known conversion for argument 6 from ‘occa::memory’ to ‘const double*’
   81 |                           const dfloat *w, const bool weighted, MPI_Comm comm);
      |                           ~~~~~~~~~~~~~~^
[..]/nekRS/src/elliptic/amgSolver/parAlmond/vector.hpp:127:8: note: candidate: ‘double parAlmond::vectorAddInnerProd(int, double, occa::memory, double, occa::memory, occa::memory, bool, MPI_Comm)’
  127 | dfloat vectorAddInnerProd(const dlong N, const dfloat alpha, occa::memory o_x,
      |        ^~~~~~~~~~~~~~~~~~
[..]/nekRS/src/elliptic/amgSolver/parAlmond/vector.hpp:127:75: note:   no known conversion for argument 3 from ‘double*’ to ‘occa::memory’
  127 | dfloat vectorAddInnerProd(const dlong N, const dfloat alpha, occa::memory o_x,
      |                                                              ~~~~~~~~~~~~~^~~

If I change

https://github.com/Nek5000/nekRS/blob/8ee9c381f86f5f70867d942616e585ee726a8ca1/src/elliptic/amgSolver/parAlmond/level.cpp#L84

to

*norm_rhstilde = sqrt(vectorAddInnerProd(Nrows, a, vk, 1.0, rhs, weight, weighted,comm)); 

compilation finishes without error.

To Reproduce

Clean clone of current master, mvapich2-2.3.7 with CUDA support, Cuda 11.8

Expected behavior

No build error.

stgeke commented 1 year ago

Can you pls try with latest next.

joneuhauser commented 1 year ago

That works fine (no wonder, the file doesn't exist anymore). I need to revert yesterday's change to nrsconfig (/home/ws/rm1705/.local/bin/cmake --build ./build --target install -j8), otherwise it can't find <mpi.h> on build, the configure steps passes without errors:

src/comm.h:65:10: fatal error: mpi.h: No such file or directory
stgeke commented 1 year ago

There should be no need to modify nrsconfig. Please read the RELEASE notes before building the code. We changed a subtle detail (env-var CC/CXX/FC have to be correct).