fix the compiling on mac os (#97)

pull/98/head
Kai Chen 2019-07-31 02:22:20 +08:00 committed by GitHub
parent 30985b2f76
commit 5b72bd4baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,5 @@
#include <math.h>
#include <string.h>
#include <iostream>
using namespace std;

View File

@ -15,6 +15,7 @@ split_before_expression_after_opening_paren = true
[isort]
line_length = 79
multi_line_output = 0
known_standard_library = setuptools
known_first_party = mmcv
known_third_party = addict,cv2,matplotlib,numpy,requests,six,torch,yaml
no_lines_before = STDLIB,LOCALFOLDER

View File

@ -1,6 +1,6 @@
import platform
import sys
from io import open # for Python 2 (identical to builtin in Python 3)
from setuptools import Extension, find_packages, setup
import numpy
@ -29,6 +29,13 @@ def get_version():
return locals()['__version__']
if platform.system() == 'Darwin':
extra_compile_args = ['-stdlib=libc++']
extra_link_args = ['-stdlib=libc++']
else:
extra_compile_args = []
extra_link_args = []
EXT_MODULES = [
Extension(
name='mmcv._ext',
@ -37,7 +44,9 @@ EXT_MODULES = [
'./mmcv/video/optflow_warp/flow_warp_module.pyx'
],
include_dirs=[numpy.get_include()],
language="c++",
language='c++',
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
),
]