Skip to content

Commit c48be43

Browse files
authored
Merge pull request #72 from rflamary/osx-issue
add -tdlib=libc++ argument
2 parents c263149 + 15a062d commit c48be43

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
with open(os.path.join(ROOT, 'README.md'), encoding="utf-8") as f:
2525
README = f.read()
2626

27+
# add platform dependant optional compilation argument
28+
opt_arg=["-O3"]
29+
import platform
30+
if platform.system()=='Darwin':
31+
if platform.release()=='18.0.0':
32+
opt_arg.append("-stdlib=libc++") # correspond to a compilation problem with Mojave and XCode 10
2733

2834
setup(name='POT',
2935
version=__version__,
@@ -39,7 +45,9 @@
3945
sources=["ot/lp/emd_wrap.pyx", "ot/lp/EMD_wrapper.cpp"], # the Cython source and
4046
# additional C++ source files
4147
language="c++", # generate and compile C++ code,
42-
include_dirs=[numpy.get_include(),os.path.join(ROOT,'ot/lp')])),
48+
include_dirs=[numpy.get_include(),os.path.join(ROOT,'ot/lp')],
49+
extra_compile_args=opt_arg
50+
)),
4351
platforms=['linux','macosx','windows'],
4452
download_url='https://github.com/rflamary/POT/archive/{}.tar.gz'.format(__version__),
4553
license = 'MIT',

0 commit comments

Comments
 (0)