mirror of https://github.com/open-mmlab/mmcv.git
fix the compiling on mac os (#97)
parent
30985b2f76
commit
5b72bd4baf
|
@ -1,6 +1,5 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ split_before_expression_after_opening_paren = true
|
||||||
[isort]
|
[isort]
|
||||||
line_length = 79
|
line_length = 79
|
||||||
multi_line_output = 0
|
multi_line_output = 0
|
||||||
|
known_standard_library = setuptools
|
||||||
known_first_party = mmcv
|
known_first_party = mmcv
|
||||||
known_third_party = addict,cv2,matplotlib,numpy,requests,six,torch,yaml
|
known_third_party = addict,cv2,matplotlib,numpy,requests,six,torch,yaml
|
||||||
no_lines_before = STDLIB,LOCALFOLDER
|
no_lines_before = STDLIB,LOCALFOLDER
|
||||||
|
|
13
setup.py
13
setup.py
|
@ -1,6 +1,6 @@
|
||||||
|
import platform
|
||||||
import sys
|
import sys
|
||||||
from io import open # for Python 2 (identical to builtin in Python 3)
|
from io import open # for Python 2 (identical to builtin in Python 3)
|
||||||
|
|
||||||
from setuptools import Extension, find_packages, setup
|
from setuptools import Extension, find_packages, setup
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
@ -29,6 +29,13 @@ def get_version():
|
||||||
return locals()['__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 = [
|
EXT_MODULES = [
|
||||||
Extension(
|
Extension(
|
||||||
name='mmcv._ext',
|
name='mmcv._ext',
|
||||||
|
@ -37,7 +44,9 @@ EXT_MODULES = [
|
||||||
'./mmcv/video/optflow_warp/flow_warp_module.pyx'
|
'./mmcv/video/optflow_warp/flow_warp_module.pyx'
|
||||||
],
|
],
|
||||||
include_dirs=[numpy.get_include()],
|
include_dirs=[numpy.get_include()],
|
||||||
language="c++",
|
language='c++',
|
||||||
|
extra_compile_args=extra_compile_args,
|
||||||
|
extra_link_args=extra_link_args,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue