prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  mmcv error
  My environment is macOS Mojave 10.14.4, Anaconda 4.4.0,Python 3.6.1.
   I directly use "pip install mmcv and got:
  "Running setup.py clean for mmcv
  Failed to build mmcv
  Installing collected packages: mmcv
  Running setup.py install for mmcv ... error" and :
  "In file included from ./mmcv/video/optflow_warp/flow_warp.cpp:1:
  ./mmcv/video/optflow_warp/flow_warp.hpp:3:10: fatal error: 'iostream' file not found
  #include <iostream>"
  Anybody help? Thank you very much.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 import sys
  2 from io import open  # for Python 2 (identical to builtin in Python 3)
  3 
  4 from setuptools import Extension, find_packages, setup
  5 
  6 import numpy
  7 from Cython.Distutils import build_ext
  8 
  9 install_requires = [
  10     'numpy>=1.11.1', 'pyyaml', 'six', 'addict', 'requests', 'opencv-python',
  11     'Cython'
  12 ]
  13 if sys.version_info < (3, 3):
  14     install_requires.append('backports.shutil_get_terminal_size')
  15 if sys.version_info < (3, 4):
  16     install_requires.extend(['enum34', 'pathlib'])
  17 
  18 
  19 def readme():
  20     with open('README.rst', encoding='utf-8') as f:
  21         content = f.read()
  22     return content
  23 
  24 
  25 def get_version():
  26     version_file = 'mmcv/version.py'
  27     with open(version_file, 'r', encoding='utf-8') as f:
  28         exec(compile(f.read(), version_file, 'exec'))
  29     return locals()['__version__']
  30 
  31 
  32 EXT_MODULES = [
  33     Extension(
  34         name='mmcv._ext',
  35         sources=[
  36             './mmcv/video/optflow_warp/flow_warp.cpp',
  37             './mmcv/video/optflow_warp/flow_warp_module.pyx'
  38         ],
  39         include_dirs=[numpy.get_include()],
  40         language="c++",
  41     ),
  42 ]
  43 
  44 setup(
  45     name='mmcv',
  46     version=get_version(),
  47     description='Open MMLab Computer Vision Foundation',
  48     long_description=readme(),
  49     keywords='computer vision',
  50     packages=find_packages(),
  51     classifiers=[
  52         'Development Status :: 4 - Beta',
  53         'License :: OSI Approved :: Apache Software License',
  54         'Operating System :: OS Independent',
  55         'Programming Language :: Python :: 2',
  56         'Programming Language :: Python :: 2.7',
  57         'Programming Language :: Python :: 3',
  58         'Programming Language :: Python :: 3.4',
  59         'Programming Language :: Python :: 3.5',
  60         'Programming Language :: Python :: 3.6',
  61         'Programming Language :: Python :: 3.7',
  62         'Topic :: Utilities',
  63     ],
  64     url='https://github.com/open-mmlab/mmcv',
  65     author='Kai Chen',
  66     author_email='chenkaidev@gmail.com',
  67     setup_requires=['pytest-runner'],
  68     tests_require=['pytest'],
  69     install_requires=install_requires,
  70     ext_modules=EXT_MODULES,
  71     cmdclass={'build_ext': build_ext},
  72     zip_safe=False)
  73
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -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 @@
       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 @@
               './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,
       ),
   ]
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,6 +1,6 @@\n+import platform\n import sys\n from io import open  # for Python 2 (identical to builtin in Python 3)\n-\n from setuptools import Extension, find_packages, setup\n \n import numpy\n@@ -29,6 +29,13 @@\n     return locals()['__version__']\n \n \n+if platform.system() == 'Darwin':\n+    extra_compile_args = ['-stdlib=libc++']\n+    extra_link_args = ['-stdlib=libc++']\n+else:\n+    extra_compile_args = []\n+    extra_link_args = []\n+\n EXT_MODULES = [\n     Extension(\n         name='mmcv._ext',\n@@ -37,7 +44,9 @@\n             './mmcv/video/optflow_warp/flow_warp_module.pyx'\n         ],\n         include_dirs=[numpy.get_include()],\n-        language=\"c++\",\n+        language='c++',\n+        extra_compile_args=extra_compile_args,\n+        extra_link_args=extra_link_args,\n     ),\n ]\n", "issue": "mmcv error\nMy environment is macOS Mojave 10.14.4, Anaconda 4.4.0,Python 3.6.1.\r\n I directly use \"pip install mmcv and got:\r\n\"Running setup.py clean for mmcv\r\nFailed to build mmcv\r\nInstalling collected packages: mmcv\r\nRunning setup.py install for mmcv ... error\" and :\r\n\"In file included from ./mmcv/video/optflow_warp/flow_warp.cpp:1:\r\n./mmcv/video/optflow_warp/flow_warp.hpp:3:10: fatal error: 'iostream' file not found\r\n#include <iostream>\"\r\nAnybody help? Thank you very much.\n", "before_files": [{"content": "import sys\nfrom io import open  # for Python 2 (identical to builtin in Python 3)\n\nfrom setuptools import Extension, find_packages, setup\n\nimport numpy\nfrom Cython.Distutils import build_ext\n\ninstall_requires = [\n    'numpy>=1.11.1', 'pyyaml', 'six', 'addict', 'requests', 'opencv-python',\n    'Cython'\n]\nif sys.version_info < (3, 3):\n    install_requires.append('backports.shutil_get_terminal_size')\nif sys.version_info < (3, 4):\n    install_requires.extend(['enum34', 'pathlib'])\n\n\ndef readme():\n    with open('README.rst', encoding='utf-8') as f:\n        content = f.read()\n    return content\n\n\ndef get_version():\n    version_file = 'mmcv/version.py'\n    with open(version_file, 'r', encoding='utf-8') as f:\n        exec(compile(f.read(), version_file, 'exec'))\n    return locals()['__version__']\n\n\nEXT_MODULES = [\n    Extension(\n        name='mmcv._ext',\n        sources=[\n            './mmcv/video/optflow_warp/flow_warp.cpp',\n            './mmcv/video/optflow_warp/flow_warp_module.pyx'\n        ],\n        include_dirs=[numpy.get_include()],\n        language=\"c++\",\n    ),\n]\n\nsetup(\n    name='mmcv',\n    version=get_version(),\n    description='Open MMLab Computer Vision Foundation',\n    long_description=readme(),\n    keywords='computer vision',\n    packages=find_packages(),\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Topic :: Utilities',\n    ],\n    url='https://github.com/open-mmlab/mmcv',\n    author='Kai Chen',\n    author_email='chenkaidev@gmail.com',\n    setup_requires=['pytest-runner'],\n    tests_require=['pytest'],\n    install_requires=install_requires,\n    ext_modules=EXT_MODULES,\n    cmdclass={'build_ext': build_ext},\n    zip_safe=False)\n", "path": "setup.py"}], "after_files": [{"content": "import platform\nimport sys\nfrom io import open  # for Python 2 (identical to builtin in Python 3)\nfrom setuptools import Extension, find_packages, setup\n\nimport numpy\nfrom Cython.Distutils import build_ext\n\ninstall_requires = [\n    'numpy>=1.11.1', 'pyyaml', 'six', 'addict', 'requests', 'opencv-python',\n    'Cython'\n]\nif sys.version_info < (3, 3):\n    install_requires.append('backports.shutil_get_terminal_size')\nif sys.version_info < (3, 4):\n    install_requires.extend(['enum34', 'pathlib'])\n\n\ndef readme():\n    with open('README.rst', encoding='utf-8') as f:\n        content = f.read()\n    return content\n\n\ndef get_version():\n    version_file = 'mmcv/version.py'\n    with open(version_file, 'r', encoding='utf-8') as f:\n        exec(compile(f.read(), version_file, 'exec'))\n    return locals()['__version__']\n\n\nif platform.system() == 'Darwin':\n    extra_compile_args = ['-stdlib=libc++']\n    extra_link_args = ['-stdlib=libc++']\nelse:\n    extra_compile_args = []\n    extra_link_args = []\n\nEXT_MODULES = [\n    Extension(\n        name='mmcv._ext',\n        sources=[\n            './mmcv/video/optflow_warp/flow_warp.cpp',\n            './mmcv/video/optflow_warp/flow_warp_module.pyx'\n        ],\n        include_dirs=[numpy.get_include()],\n        language='c++',\n        extra_compile_args=extra_compile_args,\n        extra_link_args=extra_link_args,\n    ),\n]\n\nsetup(\n    name='mmcv',\n    version=get_version(),\n    description='Open MMLab Computer Vision Foundation',\n    long_description=readme(),\n    keywords='computer vision',\n    packages=find_packages(),\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Topic :: Utilities',\n    ],\n    url='https://github.com/open-mmlab/mmcv',\n    author='Kai Chen',\n    author_email='chenkaidev@gmail.com',\n    setup_requires=['pytest-runner'],\n    tests_require=['pytest'],\n    install_requires=install_requires,\n    ext_modules=EXT_MODULES,\n    cmdclass={'build_ext': build_ext},\n    zip_safe=False)\n", "path": "setup.py"}]}