[Numpy-discussion] numscons/numpy.distutils bug related to MACOSX_DEPLOYMENT_TARGET

Robert Kern robert.kern@gmail....
Tue Feb 3 18:42:31 CST 2009

On Tue, Feb 3, 2009 at 18:34, Brian Granger <ellisonbg.net@gmail.com> wrote:
>> What is the fix you are thinking of?
> This is how Cython currently handles this logic.  This would have to
> be modified to include the additional case of a user setting
> MACOSX_DEPLOYMENT_TARGET in their environment, but that logic is
> already in numpy.distutils.fcompiler.gnu.get_flags_linker_so
> This is really just a special case for 1) OS X 10.5 and 2) built-in Python.
> # MACOSX_DEPLOYMENT_TARGET can be set to 10.3 in most cases.
> # But for the built-in Python 2.5.1 on Leopard, it needs to be set for 10.5.
> # This looks like a bug that will be fixed in 2.5.2. If Apple updates their
> # Python to 2.5.2, this fix should be OK.
> import distutils.sysconfig as sc
> python_prefix = sc.get_config_var('prefix')
> leopard_python_prefix =
> '/System/Library/Frameworks/Python.framework/Versions/2.5'
> full_version = "%s.%s.%s" % sys.version_info[:3]
> if python_prefix == leopard_python_prefix and full_version == '2.5.1':
>    os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.5"
> else:
>    os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.3"

Hmm, that's still going to break for any custom build that decides to
build Python with a specific MACOSX_DEPLOYMENT_TARGET. If you're going
to fix it at all, it should default to the value in the Makefile that
sysconfig is going to check against. The relevant code to copy is in

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list