awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
224 stars 50 forks source link

BUTTERFLYPACK build fails on Mac M1 #202

Closed hughcars closed 4 months ago

hughcars commented 4 months ago

Building main with cmake -DPALACE_WITH_STRUMPACK=ON -DPALACE_WITH_STRUMPACK_BUTTERFLYPACK=ON .. results in a build failure, apparently due to a mismatch in integer types across a strumpack interface:

/Users/hughcars/AWS/palace/debug_build/extern/STRUMPACK/src/HODLR/HODLRWrapper.cpp:258:9: error: no matching function for call to 's_c_bpack_construct_init_gram'
  258 |         s_c_bpack_construct_init_gram
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hughcars/AWS/palace/debug_build/include/sC_BPACK_wrapper.h:42:6: note: candidate function not viable: no known conversion from 'void (*)(int *, int *, int *, int *, int *, int *, float *, int *, int *, int *, int *, int *, C2Fptr)' (aka 'void (*)(int *, int *, int *, int *, int *, int *, float *, int *, int *, int *, int *, int *, void *)') to 'void (*)(int *, int *, int *, int64_t *, int *, int *, float *, int *, int *, int *, int *, int *, C2Fptr)' (aka 'void (*)(int *, int *, int *, long long *, int *, int *, float *, int *, int *, int *, int *, int *, void *)') for 16th argument
   42 | void s_c_bpack_construct_init_gram(int* Npo, int* Ndim, double* Locations, int* nns, int* nlevel, int* tree, int* perms, int* Npo_loc, F2Cptr* ho_bf_for, F2Cptr* option,F2Cptr* stats,F2Cptr* msh,F2Cptr* ker,F2Cptr* ptree, void (*C_FuncZmn)(int*, int*, float*,C2Fptr),void (*C_FuncZmnBlock)(int*, int*, int*, int64_t*, int*, int*, float*, int*, int*, int*, int*, int*, C2Fptr),  C2Fptr C_QuantApp);
      |      ^                                                                                                                                                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hughcars/AWS/palace/debug_build/extern/STRUMPACK/src/HODLR/HODLRWrapper.cpp:272:7: error: no matching function for call to 'd_c_bpack_construct_init_gram'
  272 |       d_c_bpack_construct_init_gram
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hughcars/AWS/palace/debug_build/include/dC_BPACK_wrapper.h:42:6: note: candidate function not viable: no known conversion from 'void (*)(int *, int *, int *, int *, int *, int *, double *, int *, int *, int *, int *, int *, C2Fptr)' (aka 'void (*)(int *, int *, int *, int *, int *, int *, double *, int *, int *, int *, int *, int *, void *)') to 'void (*)(int *, int *, int *, int64_t *, int *, int *, double *, int *, int *, int *, int *, int *, C2Fptr)' (aka 'void (*)(int *, int *, int *, long long *, int *, int *, double *, int *, int *, int *, int *, int *, void *)') for 16th argument
   42 | void d_c_bpack_construct_init_gram(int* Npo, int* Ndim, double* Locations, int* nns, int* nlevel, int* tree, int* perms, int* Npo_loc, F2Cptr* ho_bf_for, F2Cptr* option,F2Cptr* stats,F2Cptr* msh,F2Cptr* ker,F2Cptr* ptree, void (*C_FuncZmn)(int*, int*, double*,C2Fptr),void (*C_FuncZmnBlock)(int*, int*, int*, int64_t*, int*, int*, double*, int*, int*, int*, int*, int*, C2Fptr),  C2Fptr C_QuantApp);

This occurs with and without 64 bit Int set with -DPALACE_WITH_64BIT_INT=ON.

sebastiangrimberg commented 4 months ago

This is not an issue with Palace but looks to be a compatibility issue or STRUMPACK due to https://github.com/liuyangzhuan/ButterflyPACK/commit/125cb7f0c56899a9f35ad1acba253a42bc89d2de in ButterflyPACK. Since the ButterflyPACK interface is largely experimental, I'll close this issue and open one in STRUMPACK to fix compatibility.