-
Notifications
You must be signed in to change notification settings - Fork 69
libstdcxx version-bounds #243
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
481eb30
add libstdcxx version-bounds option
samtkaplan 2ef0571
Update src/cpython/context.jl
samtkaplan bf9cc5b
adapt to @staticfloat's changes
samtkaplan daf0ff0
fixup
samtkaplan 97b7cfa
JULIA_CONDAPKG_LIBSTDCXX_VERSION_BOUND -> JULIA_PYTHONCALL_LIBSTDCXX_…
samtkaplan dc55bd5
tweak look-up table for version mapping
samtkaplan e7c8dac
handle the case where Julia is unable to discover the version of libs…
samtkaplan 0cd0a32
fixup code comment
samtkaplan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,31 @@ function _atpyexit() | |
return | ||
end | ||
|
||
# By default, ensure libstdc++ in the Conda environment is compatible with | ||
# the one linked in Julia. This is platform/version dependent, so needs to | ||
# occur at runtime. | ||
# | ||
# Allow the user to override the default. This is useful when the version | ||
# of libstdcxx linked in Julia is customized in the local installation of | ||
# Julia. | ||
# | ||
# To figure out cxx_version for a given Julia version, run | ||
# strings /path/to/julia/lib/julia/libstdc++.so.6 | grep GLIBCXX | ||
# then look at | ||
# https://gcc.gnu.org/onlinedocs/gcc-12.1.0/libstdc++/manual/manual/abi.html | ||
# for the highest GCC version compatible with the highest GLIBCXX version. | ||
function get_libstdcxx_version_bound() | ||
if Base.VERSION <= v"1.6.2" | ||
# GLIBCXX_3.4.26 | ||
cxx_version = ">=3.4,<9.2" | ||
else | ||
# GLIBCXX_3.4.29 | ||
# checked up to v1.8.0 | ||
cxx_version = ">=3.4,<11.4" | ||
end | ||
get(ENV, "JULIA_CONDAPKG_LIBSTDCXX_VERSION_BOUND", cxx_version) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is an option to PythonCall, please rename the env var to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed. thanks. |
||
end | ||
|
||
function init_context() | ||
|
||
CTX.is_embedded = haskey(ENV, "JULIA_PYTHONCALL_LIBPTR") | ||
|
@@ -60,23 +85,7 @@ function init_context() | |
exe_path::String | ||
else | ||
if Sys.islinux() | ||
# Ensure libstdc++ in the Conda environment is compatible with the one | ||
# linked in Julia. This is platform/version dependent, so needs to occur at | ||
# runtime. | ||
# | ||
# To figure out cxx_version for a given Julia version, run | ||
# strings /path/to/julia/lib/julia/libstdc++.so.6 | grep GLIBCXX | ||
# then look at | ||
# https://gcc.gnu.org/onlinedocs/gcc-12.1.0/libstdc++/manual/manual/abi.html | ||
# for the highest GCC version compatible with the highest GLIBCXX version. | ||
if Base.VERSION <= v"1.6.2" | ||
# GLIBCXX_3.4.26 | ||
cxx_version = ">=3.4,<9.2" | ||
else | ||
# GLIBCXX_3.4.29 | ||
# checked up to v1.8.0 | ||
cxx_version = ">=3.4,<11.4" | ||
end | ||
cxx_version = get_libstdcxx_version_bound() | ||
CondaPkg.add("libstdcxx-ng", version=cxx_version, channel="conda-forge", temp=true, file=joinpath(@__DIR__, "..", "..", "CondaPkg.toml"), resolve=false) | ||
end | ||
# By default, we use Python installed by CondaPkg. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@testitem "libstdc++ version" begin | ||
cxxversion = PythonCall.get_libstdcxx_version_bound() | ||
|
||
if VERSION <= v"1.6.2" | ||
@test cxxversion == ">=3.4,<9.2" | ||
else | ||
@test cxxversion == ">=3.4,<11.4" | ||
end | ||
|
||
ENV["JULIA_CONDAPKG_LIBSTDCXX_VERSION_BOUND"] = ">=3.4,<=12" | ||
|
||
cxxversion = PythonCall.get_libstdcxx_version_bound() | ||
@test cxxversion == ">3.4,<=12" | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.