[mac/clang/libc++/c++11] force clang to use libc++ for c++11, instead of the default old libstdc++4.2.1 which doesn't support c++11

release/4.3a0
Duy-Nguyen Ta 2017-03-21 15:02:21 -04:00
parent a8d363c347
commit 90ea744619
2 changed files with 15 additions and 3 deletions

View File

@ -2,6 +2,12 @@ from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import eigency
from sys import platform
# force clang use libc++ instead of the default libstdc++ shipped with MacOSX, which doesn't support c++11
libc_flag = []
if platform == "darwin":
libc_flag = ["-stdlib=libc++"]
setup(
ext_modules = cythonize(Extension(
@ -13,5 +19,6 @@ setup(
libraries = ['gtsam'],
library_dirs = ["${CMAKE_BINARY_DIR}/gtsam"],
language="c++",
extra_compile_args=["-std=c++11"])),
)
extra_compile_args=["-std=c++11"] + libc_flag,
extra_link_args=libc_flag)),
)

View File

@ -7,6 +7,10 @@ import sys
# so that it can find the wrapped gtsam package
sys.path.append("..")
libc_flag = []
if sys.platform == "darwin":
libc_flag = ["-stdlib=libc++"]
setup(
ext_modules=cythonize(Extension(
"gtsam_unstable",
@ -17,6 +21,7 @@ setup(
libraries=['gtsam', 'gtsam_unstable'],
library_dirs=["${GTSAM_DIR}/../../"],
language="c++",
extra_compile_args=["-std=c++11"])),
extra_compile_args=["-std=c++11"] + libc_flag,
extra_link_args=libc_flag)),
)