Skip to content

Commit faaadf2

Browse files
committed
1 parent 8f62844 commit faaadf2

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Diff for: diffcp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.0.8"
1+
__version__ = "1.0.9"
22

33
from diffcp.cone_program import solve_and_derivative, \
44
solve_and_derivative_batch, \

Diff for: setup.py

+23-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import distutils.sysconfig
2+
import distutils.version
3+
from glob import glob
14
import os
5+
import platform
26
from setuptools import Extension, setup, find_packages
37
from setuptools.command.build_ext import build_ext
4-
import sys
5-
import setuptools
6-
from glob import glob
78
import subprocess
9+
import sys
810

911

1012
with open("README.md", "r") as fh:
@@ -53,11 +55,28 @@ def get_openmp_flag():
5355
extra_compile_args=["-O3", "-std=c++11", "-march=native"] + get_openmp_flag()
5456
)
5557

58+
def is_platform_mac():
59+
return sys.platform == 'darwin'
60+
61+
62+
# For mac, ensure extensions are built for macos 10.9 when compiling on a
63+
# 10.9 system or above, overriding distutils behaviour which is to target
64+
# the version that python was built for. This may be overridden by setting
65+
# MACOSX_DEPLOYMENT_TARGET before calling setup.py. This behavior is
66+
# motivated by Apple dropping support for libstdc++.
67+
if is_platform_mac():
68+
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
69+
current_system = distutils.version.LooseVersion(platform.mac_ver()[0])
70+
python_target = distutils.version.LooseVersion(
71+
distutils.sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET'))
72+
if python_target < '10.9' and current_system >= '10.9':
73+
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'
74+
5675
ext_modules = [_diffcp]
5776

5877
setup(
5978
name='diffcp',
60-
version="1.0.8",
79+
version="1.0.9",
6180
author="Akshay Agrawal, Shane Barratt, Stephen Boyd, Enzo Busseti, Walaa Moursi",
6281
long_description=long_description,
6382
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)