Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97809 > unrolled thread

OS X Python: can I explicitly set MACOSX_DEPLOYMENT_TARGET for extensions?

Started byAndrew Jaffe <a.h.jaffe@gmail.com>
First post2015-10-19 12:20 +0100
Last post2015-10-19 12:20 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  OS X Python: can I explicitly set MACOSX_DEPLOYMENT_TARGET for extensions? Andrew Jaffe <a.h.jaffe@gmail.com> - 2015-10-19 12:20 +0100

#97809 — OS X Python: can I explicitly set MACOSX_DEPLOYMENT_TARGET for extensions?

FromAndrew Jaffe <a.h.jaffe@gmail.com>
Date2015-10-19 12:20 +0100
SubjectOS X Python: can I explicitly set MACOSX_DEPLOYMENT_TARGET for extensions?
Message-ID<mailman.31.1445253666.878.python-list@python.org>
I use the python.org framework build of Python under recent versions of 
OS X (i.e., 10.11 El Capitan). I need to build some extensions that rely 
on recent versions of compilers (e.g., C++-11 features). However the 
python.org python is built to work on older systems as well, for 
backward compatibility.

Hence, it has the environment variable MACOSX_DEPLOYMENT_TARGET=10.6. 
This means that extensions are built by default with a toolchain that, I 
think, mimics gcc-4.2, in particular in terms of what stdlib it searches.

In the past, I have fixed this by installing more recent compilers with 
homebrew and explicitly setting CC, CXX, etc before installation.

However, I have tried just setting MACOSX_DEPLOYMENT_TARGET=10.11, and 
that seems to work. Is this safe? Are there any downsides? (I don't need 
to distribute these builds, just use them locally?)

Conversely, are there any upsides? Does a newer deployment target allow 
more recent compilers and/or higher optimizations?

-Andrew

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web