TACC Stampede3-skx Compilation Failing [-Wincompatible-function-pointer-type]

Issue #2794 resolved
vik@arizona.edu created an issue

I am failing to compile on the new TACC Stampede3 skx-nodes (Intel Xeon Platinum 8160 ("Skylake"), documentation here). I am running into the following error that terminates the compilation:

/work2/09313/<user>/stampede3/einstein/Cactus/arrangements/CactusNumerical/ReflectionSymmetry/src/register.c:67:22: error: incompatible function pointer types passing 'CCTK_INT4 (const restrict CCTK_POINTER_TO_CONST, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const restrict CCTK_POINTER_TO_CONST *, const CCTK_INT4, const CCTK_INT4 *, const CCTK_INT4, const CCTK_INT4 *, const restrict CCTK_POINTER *, const CCTK_INT4)' (aka 'int (const void *const restrict, const int, const int, const int, const int, const int, const int, const void *const restrict *, const int, const int *, const int, const int *, void *const restrict *, const int)') to parameter of type 'CCTK_INT4 (*)(const CCTK_POINTER_TO_CONST, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_INT4, const CCTK_POINTER_TO_CONST *, const CCTK_INT4, const CCTK_INT4 *, const CCTK_INT4, const CCTK_INT4 *, const CCTK_POINTER *, const CCTK_INT4)' (aka 'int (*)(const void *const, const int, const int, const int, const int, const int, const int, const void *const *, const int, const int *, const int, const int *, void *const *, const int)') [-Wincompatible-function-pointer-types]
   67 |     (cctkGH, handle, ReflectionSymmetry_Interpolate);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/work2/09313/<user>/stampede3/einstein/Cactus/configs/vacuum/bindings/include/ReflectionSymmetry_Prototypes.h:56:19: note: passing argument to parameter 'symmetry_interpolate' here
   56 |  CCTK_INT (*const symmetry_interpolate)(const CCTK_POINTER_TO_CONST cctkGH ,
      |                   ^
1 error generated.

I have attached the machine and option list being used for Stampede3-skx.

Comments (13)

  1. vik@arizona.edu reporter
    • edited description

    Modules being loaded:

    intel/24.0
    impi/21.11
    python/3.9.18
    hdf5/1.14.3
    boost/1.85.0
    papi/7.1.0
    petsc/3.20-complex
    

    Compile instructions used:

    CPP = cpp
    FPP = cpp
    CC  = icx
    CXX = icpx
    F90 = ifx
    

    All details can be found in the attached machine and optionlist files. Let me know if there is anything else I can provide.

  2. Roland Haas

    downgrading to minor from blocker since it does not prevent compilation on all machines and stampede3 is not among the machines in the official list of supported systems

  3. Roland Haas

    these seem to differ only in the restrict keyword used by `ReflectionSymmetry`. The interface specification of the aliased function

    CCTK_INT FUNCTION                                           \
        SymmetryRegisterGridInterpolator                        \
            (CCTK_POINTER IN cctkGH,                            \
             CCTK_INT IN sym_handle,                            \
             CCTK_INT CCTK_FPOINTER IN symmetry_interpolate     \
                 (CCTK_POINTER_TO_CONST IN cctkGH,              \
                  CCTK_INT IN N_dims,                           \
                  CCTK_INT IN local_interp_handle,              \
                  CCTK_INT IN param_table_handle,               \
                  CCTK_INT IN coord_system_handle,              \
                  CCTK_INT IN N_interp_points,                  \
                  CCTK_INT IN interp_coords_type,               \
                  CCTK_POINTER_TO_CONST ARRAY IN interp_coords, \
                  CCTK_INT IN N_input_arrays,                   \
                  CCTK_INT ARRAY IN input_array_indices,        \
                  CCTK_INT IN N_output_arrays,                  \
                  CCTK_INT ARRAY IN output_array_types,         \
                  CCTK_POINTER ARRAY IN output_arrays,          \
                  CCTK_INT IN faces))
    

    has no restrict in it (not sure if this can even be expressed in the CCL file).

    So the function prototypes differ, though if that difference is something that the compiler may care about (since restrict is just a property of the function and does not affect externally visible behaviour) may be a different question.

    Since this is just a warning, it should not actually stop the compilation though.
    It maybe good to include the full compilation output as described on http://einsteintoolkit.org/support.html#general-guidelines-for-questions

    If this warning is indeed what makes the compilation abort I’d add

    -Wno-incompatible-function-pointer-types
    

    to CFLAGS and CXXFLAGS of the option list (cfg file).

  4. Roland Haas

    This was discussed in today’s Einstein Toolkit call. Steve also encountered this issue with g++-14 which also flags this as an error.

    The solution agreed on in the phone call is to remove the restrict keyword from ReflectionSymmetry, at least for this release.
    A future change may add restrict (if supported by the compiler) to all array and pointer arguments. This is b/c the aliased functions may also be implemented in Fortran and Fortran requires the restrict property for all arguments anyway.

  5. vik@arizona.edu reporter

    Thank you for the suggestions. The compiler flag suggestion bypassed the error that was killing the compilation.

    -Wno-incompatible-function-pointer-types
    

  6. Log in to comment