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

Compiling libsc with openMPI using CMake fails to find MPI_COMM_TYPE_SHARED #195

Closed
maelk3 opened this issue Jul 15, 2024 · 4 comments
Closed

Comments

@maelk3
Copy link
Contributor

maelk3 commented Jul 15, 2024

Description
Compiling libsc with openMPI using the CMake build system does not find MPI_COMM_TYPE_SHARED. Down the line, on t8code, this causes issues DLR-AMR/t8code#1109 with shared memory usage.

To Reproduce

cmake ..  -Dmpi=ON

Additional information
The issue stems from the fact that MPI_COMM_TYPE_SHARED is defined as part of an anonymous enum on openMPI's mpi.h header file (instead of a macro definition), and the CMake function check_symbol_exists only checks for macro definition. A easy solution would be to use check_c_source_compiles instead. I would be glad to provide a pull request if this issue is considered.

@cburstedde
Copy link
Owner

Thanks for the report!

We had this type of error before on a different matter. @tim-griesbach, do you see a solution to this issue?

@tim-griesbach
Copy link
Collaborator

We had this type of error before on a different matter. @tim-griesbach, do you see a solution to this issue?

I think that @maelk3's proposal of creating a PR to use check_c_source_compiles instead of check_symbol_exists is a good solution. It is also aligned with the recommendation of the CMake documentation for checking enums.

@cburstedde
Copy link
Owner

Please go for it @maelk3. This will be good to fix! Compile-link-checking is sensible for all MPI functionalities that presently use symbol_exists, as well as for qsort_r: The latter has two different conventions flying around, one from BSD and one GNU. Please see the autoconf code in config/sc_qsort.m4 in case you like to address the latter as well.

@cburstedde
Copy link
Owner

This has been addressed quickly thanks to @maelk3. :)

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

No branches or pull requests

3 participants