@@ -64,11 +64,18 @@ function get_libstdcxx_version_bound()
6464 )
6565 # Get the libstdcxx version that is currently loaded in this Julia process
6666 loaded_libstdcxx_version = Base. BinaryPlatforms. detect_libstdcxx_version ()
67- # Map it through to get a GCC version; if the version is unknown, we simply return
68- # the highest GCC version we know about, which should be a fairly safe choice.
69- max_version = get (vers_mapping, loaded_libstdcxx_version. patch, vers_mapping[maximum (keys (vers_mapping))])
70- cxx_version = " >=3.4,<=$(max_version. major) .$(max_version. minor) "
71- get (ENV , " JULIA_PYTHONCALL_LIBSTDCXX_VERSION_BOUND" , cxx_version)
67+
68+ if loaded_libstdcxx_version != = nothing
69+ # Map it through to get a GCC version; if the version is unknown, we simply return
70+ # the highest GCC version we know about, which should be a fairly safe choice.
71+ max_version = get (vers_mapping, loaded_libstdcxx_version. patch, vers_mapping[maximum (keys (vers_mapping))])
72+ return get (ENV , " JULIA_PYTHONCALL_LIBSTDCXX_VERSION_BOUND" , " >=3.4,<=$(max_version. major) .$(max_version. minor) " )
73+ elseif haskey (ENV , " JULIA_PYTHONCALL_LIBSTDCXX_VERSION_BOUND" )
74+ return ENV [" JULIA_PYTHONCALL_LIBSTDCXX_VERSION_BOUND" ]
75+ else
76+ # Julia does not link against any version of libstdc++ known to Julia (e.g. using clang instead, or something not in the 3.4.x series)
77+ return nothing
78+ end
7279end
7380
7481function init_context ()
@@ -102,7 +109,11 @@ function init_context()
102109 else
103110 if Sys. islinux ()
104111 cxx_version = get_libstdcxx_version_bound ()
105- CondaPkg. add (" libstdcxx-ng" , version= cxx_version, channel= " conda-forge" , temp= true , file= joinpath (@__DIR__ , " .." , " .." , " CondaPkg.toml" ), resolve= false )
112+ if cxx_version != = nothing
113+ CondaPkg. add (" libstdcxx-ng" , version= cxx_version, channel= " conda-forge" , temp= true , file= joinpath (@__DIR__ , " .." , " .." , " CondaPkg.toml" ), resolve= false )
114+ end
115+ # if cxx_version is nothing, then we assume that Julia does not link against libstdcxx-ng, and so we do not
116+ # enforce a version bound.
106117 end
107118 # By default, we use Python installed by CondaPkg.
108119 exe_path = Sys. iswindows () ? joinpath (CondaPkg. envdir (), " python.exe" ) : joinpath (CondaPkg. envdir (), " bin" , " python" )
0 commit comments