Skip to content

Use C++ compiler to check for symbols#1985

Open
smithsg84 wants to merge 1 commit intodevelopfrom
bugfix/smith84/std_aligned_alloc_cmake_check
Open

Use C++ compiler to check for symbols#1985
smithsg84 wants to merge 1 commit intodevelopfrom
bugfix/smith84/std_aligned_alloc_cmake_check

Conversation

@smithsg84
Copy link
Member

Symbol existence checks changed to use C++ compiler rather than the C compiler

check_symbol_exists use the C compiler for the symbol check, check_cxx_symbol_exists is the C++ variant. The C check was being used to check for a C++ symbol name (std::aligned_alloc) which was failing. Other checks were refactored to use C++ checks since use is in C++ code.

  • This PR is a bugfix

@smithsg84 smithsg84 self-assigned this Feb 4, 2026
@davidbeckingsale
Copy link
Member

Very nice - I think we've had similar issues in Umpire.

@smithsg84
Copy link
Member Author

The first choice for aligned allocation is currently posix_memalign. Since RAJA now requires C++ 17 should the first selection be std::aligned_alloc which is in C++17? Remove RAJA wrapper entirely and use standard directly since we have bumped to C++17? Or perhaps there are other reasons for the selection?

#if defined(RAJA_HAVE_POSIX_MEMALIGN)

@rhornung67
Copy link
Member

@MrBurmark @artv3 will you please comment on @smithsg84 question above about removing the RAJA wrapper and going with C++ std library directly?

Copy link
Member

@rhornung67 rhornung67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @smithsg84 As you can see we've accumulated vestigial code over the years as we've evolved through C++ standard versions.

@adayton1
Copy link
Member

adayton1 commented Feb 4, 2026

I would be inclined to use std::aligned_alloc and drop the others.

@MrBurmark
Copy link
Member

I don't know of a performance reason to prefer one aligned allocation function over another. I'm in favor of using the std version.

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.

5 participants