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

Fix DetectStdPmr for cross-compiling scenarios. #4995

Merged
merged 1 commit into from
May 22, 2024
Merged

Conversation

teo-tsirpanis
Copy link
Member

SC-47807

We use try_compile instead of try_run to detect whether the headers for std::pmr are available. This fixes errors in cross-compiling scenarios, like when building for osx-arm64 in an osx-x64 machine. Should fix failures in conda-forge/tiledb-feedstock#290, waiting for adding a patch and validating.


TYPE: BUILD
DESC: Fix configuration errors when cross-compiling.

@teo-tsirpanis
Copy link
Member Author

Validated in the Conda PR, this is ready for review.

@teo-tsirpanis teo-tsirpanis marked this pull request as ready for review May 21, 2024 16:25
@teo-tsirpanis teo-tsirpanis requested review from KiterLuc and davisp May 21, 2024 16:25
Copy link
Contributor

@davisp davisp left a comment

Choose a reason for hiding this comment

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

+1

TILEDB_CAN_RUN_STD_PMR
TILEDB_CAN_COMPILE_STD_PMR
SOURCES "${CMAKE_SOURCE_DIR}/cmake/inputs/detect_std_pmr.cc"
try_compile(
Copy link
Member

Choose a reason for hiding this comment

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

nit: indentation (non-blocking)

@KiterLuc KiterLuc merged commit 1d02156 into dev May 22, 2024
61 checks passed
@KiterLuc KiterLuc deleted the teo/detect-pmr-fix branch May 22, 2024 06:17
KiterLuc pushed a commit that referenced this pull request May 30, 2024
…entation. (#5027)

SC-48427

#4995 changed detection of `std::pmr` from trying to _run_ a C++ file
referencing pmr APIs, to trying to _compile_ it, which works in cross
compilation scenarios and fixed Conda failures for reasons I do not
understand.

However in macOS versions prior to 14 the pmr headers exist, but
binaries compiled with it fail ot run. There was already a check to
force using the vendored pmr in such versions but it was defective,
because it checked the `MACOS_DEPLOYMENT_TARGET` environment variable,
which might not exist. Before #4995, the runtime failure on these
versions would be caught by `try_run`. This PR updates the detection
script to use the
[`CMAKE_OSX_DEPLOYMENT_TARGET`](https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html)
variable, which gets automatically filled by CMake either from the
aforementioned environment variable or automatically.

---
TYPE: NO_HISTORY
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.

4 participants