Unverified Commit 5b72bd4b authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

fix the compiling on mac os (#97)

parent 30985b2f
#include <math.h>
#include <string.h>
#include <iostream>
using namespace std;
......
......@@ -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
......
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,
),
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment