superlu icon indicating copy to clipboard operation
superlu copied to clipboard

Recommended way to override `superlu_abort_and_exit()` with `USER_ABORT`?

Open alexchandel opened this issue 3 years ago • 3 comments

What is the supported way to override superlu_abort_and_exit() using USER_ABORT? While one can define the macro to one's own function (e.g. -DUSER_ABORT=MySUError), SuperLU provides no way to inject the declaration, and the signature of void superlu_abort_and_exit(char *) is not the signature of an implicit function.

alexchandel avatar Feb 15 '23 05:02 alexchandel

Have you tried?

-DUSER_ABORT(msg)=MySUError(msg)

Or, you can modify the source file SRC/slu_util.h, with your new definitions.

xiaoyeli avatar Feb 19 '23 17:02 xiaoyeli

-DUSER_ABORT(msg)=MySUError(msg)

That's equivalent to -DUSER_ABORT=MySUError, although less portable between compilers.

The problem is that regardless of what you define USER_ABORT to be, it will be implicitly defined (short of modding SuperLU's own headers as you suggest, which is not maintainable), and it will likely have an invalid signature.

alexchandel avatar Feb 23 '23 03:02 alexchandel