Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip ci] internal umfpack workarounds #584

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

juhanikataja
Copy link
Contributor

This will solve the issue treated in #578

@mmuetzel
Copy link
Contributor

Are we sure this doesn't cause issues on other platforms or with other compilers?
To limit the impact of potential side effects, should this be specific to the compiler with which the issue occurs? E.g., test if CMAKE_C_COMPILER_ID matches "Cray" (or "CrayClang"?) and only modify the pre-processed sources in that case?

(Maybe, also don't skip the CI to evaluate the impact at least for a few different platforms/compilers.)

@juhanikataja juhanikataja self-assigned this Sep 27, 2024
@juhanikataja
Copy link
Contributor Author

I'm pretty certain.

The issue is that the internal umfpack gets c-preprocessed with -E flag for some reason and that causes the source files to include nearly everything in libc standard headers and that will conflict with cray cc compiler when openmp offloading compilation is enabled. Apparently, the offloading pass in cray cc will cause the compiler to include some header files to source which causes the typedef conflict with __fsid_t.

Another workaround would be to disable openmp in umfpack.

Probably the best workaround, however, would be not to use -E flag in compiling umfpack and achieve the wanted effect with some other, possibly cleaner, fashion.

The [skip ci] was there because originally I didn't think this needed to be merged. And now I'm not so sure again anymore, since having a version that compiles on cray compiler without extra complications would be nice, but having a weird workaround for a somewhat weird compiler behaviour would not be nice.

@mmuetzel
Copy link
Contributor

mmuetzel commented Sep 27, 2024

Afaict, -E tells the compiler to output the preprocessed sources.
When calling the compiler without -E, it still preprocesses the sources but proceeds to compile them after that.

I'm not entirely sure why the source files are preprocessed in a separate step in the CMake build rules. Maybe, that was before object libraries existed?

In any case, preprocessing without -fopenmp and compiling with that flag (or vice versa) could very likely cause issues. Sorting that out would probably be better than this work-around.

I'd like to attempt building the -DDINT and -DDLONG (and -DZINT and -DZLONG) versions of the source files in separate object libraries and link them to the final AMD or UMFPACK libraries.
If that doesn't work, the "next best thing" might be to add the OpenMP C flags to the preprocessor flags if necessary.

If you don't mind, I'll try to test that some time this weekend and let you know if I come up with something testable.

@mmuetzel
Copy link
Contributor

I opened #587 with alternative changes (a complete overhaul of the build rules of UMFPACK and AMD) that shouldn't require compiler-specific changes.

Does that also avoid the build issue with the Cray compiler for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants