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

DM-29563: add compilation flag_LIBCPP_DISABLE_AVAILABILITY=1 to allow use of st… #90

Merged
merged 1 commit into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/lsst/sconsUtils/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ def _initEnvironment():
# We want to be explicit about the OS X version we're targeting
#
env['ENV']['MACOSX_DEPLOYMENT_TARGET'] = env['macosx_deployment_target']
# This flag is required for std::variant and std::filesystem
# on deployment platforms < 10.13 and 10.15
Copy link
Member

Choose a reason for hiding this comment

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

So it's not needed for 10.13 and 10.14? I assume it does no harm for those versions?

I gather this forces linking against a particular libstdc++ (conda vs. xcode?). In either case, it would be good to extend the comment clarifying what this does to make std::variant and std::filesystem work. Or maybe that's a question for @erykoff ?

Copy link
Contributor

Choose a reason for hiding this comment

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

So this is the right flag to set when building against conda libraries on macos. The point is that we don't want to check against availability of features against the system libraries because we don't use them. So the comment should be something like This flag is required to use new features like std::variant and std::filesystem on older macos. We build against conda libraries so we do not need to check if features are supported by system libraries.

Copy link
Member

Choose a reason for hiding this comment

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

So what we are really saying is that the deployment target is irrelevant when running inside conda.

Copy link
Contributor

Choose a reason for hiding this comment

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

Almost. (And our number has to be at least what conda-forge specifies which is 10.9). But when building for osx-arm64 (not the subject of this ticket!) it does actually matter.

for flag in ("-D_LIBCPP_DISABLE_AVAILABILITY=1", ):
env["CFLAGS"].append(flag)
env["CXXFLAGS"].append(flag)
log.info("Setting OS X binary compatibility level: %s" % env['ENV']['MACOSX_DEPLOYMENT_TARGET'])
#
# For XCode 7.3 we need to explicitly add a trailing slash to library
Expand Down