Skip to content
Browse files

only add libc++ to args if on a mac

  • Loading branch information...
1 parent 14da7ef commit a1bfcadcb6a0a09741b87cf93b0221fad9d7b740 @zahanm zahanm committed
Showing with 9 additions and 2 deletions.
  1. +9 −2 setup.py
View
11 setup.py
@@ -22,6 +22,8 @@
from __future__ import division
import os
+import platform
+
try:
import setuptools
except:
@@ -31,6 +33,7 @@
On linux, the package is often called python-setuptools'''
from sys import exit
exit(1)
+
from numpy.distutils.core import setup, Extension
execfile('milk/milk_version.py')
long_description = file('README.rst').read()
@@ -44,7 +47,6 @@
('EIGEN_INTERNAL_DEBUGGING', '1'),
]
-
_extensions = {
'milk.unsupervised._kmeans' : ['milk/unsupervised/_kmeans.cpp'],
'milk.unsupervised._som' : ['milk/unsupervised/_som.cpp'],
@@ -54,12 +56,17 @@
'milk.supervised._perceptron' : ['milk/supervised/_perceptron.cpp'],
'milk.supervised._lasso' : ['milk/supervised/_lasso.cpp'],
}
+
+compiler_args = ['-std=c++0x']
+if platform.system() == 'Darwin':
+ compiler_args.append('-stdlib=libc++')
+
ext_modules = [
Extension(key,
sources=sources,
undef_macros=undef_macros,
define_macros=define_macros,
- extra_compile_args=['-std=c++0x', '-stdlib=libc++'],
+ extra_compile_args=compiler_args,
)
for key,sources in _extensions.items()
]

0 comments on commit a1bfcad

Please sign in to comment.
Something went wrong with that request. Please try again.