prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  ubuntu　 ctp导入问题
  ## 环境
  
  * 操作系统: Ubuntu 18.04
  * Anaconda版本: Python 3.7 64位
  * vn.py版本: DEV-2.0.1 branch 20190313（下载日期）
  
  ## Issue类型
  三选一：Buｇ
  
  ## 预期程序行为
  ```
  from vnpy.gateway.ctp import ctp_gateway导入成功
  ## 实际程序行为
  '''from vnpy.gateway.ctp.ctp_gateway import CtpGateWay
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/vnpy/vnpy/vnpy/gateway/ctp/__init__.py", line 1, in <module>
      from .ctp_gateway import CtpGateway
    File "/home/vnpy/vnpy/vnpy/gateway/ctp/ctp_gateway.py", line 6, in <module>
      from vnpy.api.ctp import (
    File "/home/vnpy/vnpy/vnpy/api/ctp/__init__.py", line 1, in <module>
      from .vnctpmd import MdApi
  ModuleNotFoundError: No module named 'vnpy.api.ctp.vnctpmd'
  ```
  
  ## 重现步骤
  
  ```
  删除setup下面的oes安装模块   
  git clone -b v2.0.1-DEV https://github.com/vnpy/vnpy
  cd vnpy
  vim setup.py   #具体删除删除相关代码即可 
  chmod +x install.sh  && ./install.sh   
  # 安装会正常进行 
  ```
  
  针对Bug类型Issue，请提供具体重现步骤以及报错截图
  
  
  
  </issue>
  <code>
  [start of setup.py]
  1 import ast
  2 import platform
  3 import re
  4 
  5 from setuptools import Extension, find_packages, setup
  6 
  7 with open("vnpy/__init__.py", "rb") as f:
  8     version_line = re.search(
  9         r"__version__\s+=\s+(.*)", f.read().decode("utf-8")
  10     ).group(1)
  11     version = str(ast.literal_eval(version_line))
  12 
  13 if platform.uname().system == "Windows":
  14     compiler_flags = ["/MP", "/std:c++17",  # standard
  15                       "/O2", "/Ob2", "/Oi", "/Ot", "/Oy", "/GL",  # Optimization
  16                       "/wd4819"  # 936 code page
  17                       ]
  18     extra_link_args = []
  19 else:
  20     compiler_flags = ["-std=c++17",
  21                       "-Wno-delete-incomplete", "-Wno-sign-compare",
  22                       ]
  23     extra_link_args = ["-lstdc++"]
  24 
  25 vnctpmd = Extension("vnpy.api.ctp.vnctpmd",
  26                     [
  27                         "vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp",
  28                     ],
  29                     include_dirs=["vnpy/api/ctp/include", "vnpy/api/ctp/vnctp", ],
  30                     define_macros=[],
  31                     undef_macros=[],
  32                     library_dirs=["vnpy/api/ctp/libs", "vnpy/api/ctp"],
  33                     libraries=["thostmduserapi", "thosttraderapi", ],
  34                     extra_compile_args=compiler_flags,
  35                     extra_link_args=extra_link_args,
  36                     depends=[],
  37                     runtime_library_dirs=["vnpy/api/ctp"],
  38                     language="cpp",
  39                     )
  40 vnctptd = Extension("vnpy.api.ctp.vnctptd",
  41                     [
  42                         "vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp",
  43                     ],
  44                     include_dirs=["vnpy/api/ctp/include", "vnpy/api/ctp/vnctp", ],
  45                     define_macros=[],
  46                     undef_macros=[],
  47                     library_dirs=["vnpy/api/ctp/libs", "vnpy/api/ctp"],
  48                     libraries=["thostmduserapi", "thosttraderapi", ],
  49                     extra_compile_args=compiler_flags,
  50                     extra_link_args=extra_link_args,
  51                     runtime_library_dirs=["vnpy/api/ctp"],
  52                     depends=[],
  53                     language="cpp",
  54                     )
  55 vnoes = Extension("vnpy.api.oes.vnoes",
  56                   [
  57                       "vnpy/api/oes/vnoes/generated_files/classes_1.cpp",
  58                       "vnpy/api/oes/vnoes/generated_files/classes_2.cpp",
  59                       "vnpy/api/oes/vnoes/generated_files/module.cpp",
  60                   ],
  61                   include_dirs=["vnpy/api/oes/include", "vnpy/api/oes/vnoes", ],
  62                   define_macros=[("BRIGAND_NO_BOOST_SUPPORT", "1")],
  63                   undef_macros=[],
  64                   library_dirs=["vnpy/api/oes/libs"],
  65                   libraries=["oes_api"],
  66                   extra_compile_args=compiler_flags,
  67                   extra_link_args=extra_link_args,
  68                   depends=[],
  69                   language="cpp",
  70                   )
  71 
  72 if platform.uname().system == "Windows":
  73     # use pre-built pyd for windows ( support python 3.7 only )
  74     ext_modules = []
  75 else:
  76     ext_modules = [vnctptd, vnctpmd, vnoes]
  77 
  78 pkgs = find_packages()
  79 
  80 setup(
  81     name="vnpy",
  82     version=version,
  83     include_package_data=True,
  84     packages=pkgs,
  85     package_data={"": [
  86         "*.json", "*.md", "*.ico", "*.ini",
  87         "*.dll", "*.so", "*.pyd"
  88     ]},
  89     install_requires=[],
  90     ext_modules=ext_modules
  91 )
  92
  [end of setup.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -34,7 +34,7 @@
                       extra_compile_args=compiler_flags,
                       extra_link_args=extra_link_args,
                       depends=[],
  -                    runtime_library_dirs=["vnpy/api/ctp"],
  +                    runtime_library_dirs=["$ORIGIN"],
                       language="cpp",
                       )
   vnctptd = Extension("vnpy.api.ctp.vnctptd",
  @@ -48,7 +48,7 @@
                       libraries=["thostmduserapi", "thosttraderapi", ],
                       extra_compile_args=compiler_flags,
                       extra_link_args=extra_link_args,
  -                    runtime_library_dirs=["vnpy/api/ctp"],
  +                    runtime_library_dirs=["$ORIGIN"],
                       depends=[],
                       language="cpp",
                       )
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -34,7 +34,7 @@\n                     extra_compile_args=compiler_flags,\n                     extra_link_args=extra_link_args,\n                     depends=[],\n-                    runtime_library_dirs=[\"vnpy/api/ctp\"],\n+                    runtime_library_dirs=[\"$ORIGIN\"],\n                     language=\"cpp\",\n                     )\n vnctptd = Extension(\"vnpy.api.ctp.vnctptd\",\n@@ -48,7 +48,7 @@\n                     libraries=[\"thostmduserapi\", \"thosttraderapi\", ],\n                     extra_compile_args=compiler_flags,\n                     extra_link_args=extra_link_args,\n-                    runtime_library_dirs=[\"vnpy/api/ctp\"],\n+                    runtime_library_dirs=[\"$ORIGIN\"],\n                     depends=[],\n                     language=\"cpp\",\n                     )\n", "issue": "ubuntu\u3000 ctp\u5bfc\u5165\u95ee\u9898\n## \u73af\u5883\r\n\r\n* \u64cd\u4f5c\u7cfb\u7edf: Ubuntu 18.04\r\n* Anaconda\u7248\u672c: Python 3.7 64\u4f4d\r\n* vn.py\u7248\u672c: DEV-2.0.1 branch 20190313\uff08\u4e0b\u8f7d\u65e5\u671f\uff09\r\n\r\n## Issue\u7c7b\u578b\r\n\u4e09\u9009\u4e00\uff1aBu\uff47\r\n\r\n## \u9884\u671f\u7a0b\u5e8f\u884c\u4e3a\r\n```\r\nfrom vnpy.gateway.ctp import ctp_gateway\u5bfc\u5165\u6210\u529f\r\n## \u5b9e\u9645\u7a0b\u5e8f\u884c\u4e3a\r\n'''from vnpy.gateway.ctp.ctp_gateway import CtpGateWay\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/vnpy/vnpy/vnpy/gateway/ctp/__init__.py\", line 1, in <module>\r\n    from .ctp_gateway import CtpGateway\r\n  File \"/home/vnpy/vnpy/vnpy/gateway/ctp/ctp_gateway.py\", line 6, in <module>\r\n    from vnpy.api.ctp import (\r\n  File \"/home/vnpy/vnpy/vnpy/api/ctp/__init__.py\", line 1, in <module>\r\n    from .vnctpmd import MdApi\r\nModuleNotFoundError: No module named 'vnpy.api.ctp.vnctpmd'\r\n```\r\n\r\n## \u91cd\u73b0\u6b65\u9aa4\r\n\r\n```\r\n\u5220\u9664setup\u4e0b\u9762\u7684oes\u5b89\u88c5\u6a21\u5757   \r\ngit clone -b v2.0.1-DEV https://github.com/vnpy/vnpy\r\ncd vnpy\r\nvim setup.py   #\u5177\u4f53\u5220\u9664\u5220\u9664\u76f8\u5173\u4ee3\u7801\u5373\u53ef \r\nchmod +x install.sh  && ./install.sh   \r\n# \u5b89\u88c5\u4f1a\u6b63\u5e38\u8fdb\u884c \r\n```\r\n\r\n\u9488\u5bf9Bug\u7c7b\u578bIssue\uff0c\u8bf7\u63d0\u4f9b\u5177\u4f53\u91cd\u73b0\u6b65\u9aa4\u4ee5\u53ca\u62a5\u9519\u622a\u56fe\r\n\r\n\n", "before_files": [{"content": "import ast\nimport platform\nimport re\n\nfrom setuptools import Extension, find_packages, setup\n\nwith open(\"vnpy/__init__.py\", \"rb\") as f:\n    version_line = re.search(\n        r\"__version__\\s+=\\s+(.*)\", f.read().decode(\"utf-8\")\n    ).group(1)\n    version = str(ast.literal_eval(version_line))\n\nif platform.uname().system == \"Windows\":\n    compiler_flags = [\"/MP\", \"/std:c++17\",  # standard\n                      \"/O2\", \"/Ob2\", \"/Oi\", \"/Ot\", \"/Oy\", \"/GL\",  # Optimization\n                      \"/wd4819\"  # 936 code page\n                      ]\n    extra_link_args = []\nelse:\n    compiler_flags = [\"-std=c++17\",\n                      \"-Wno-delete-incomplete\", \"-Wno-sign-compare\",\n                      ]\n    extra_link_args = [\"-lstdc++\"]\n\nvnctpmd = Extension(\"vnpy.api.ctp.vnctpmd\",\n                    [\n                        \"vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp\",\n                    ],\n                    include_dirs=[\"vnpy/api/ctp/include\", \"vnpy/api/ctp/vnctp\", ],\n                    define_macros=[],\n                    undef_macros=[],\n                    library_dirs=[\"vnpy/api/ctp/libs\", \"vnpy/api/ctp\"],\n                    libraries=[\"thostmduserapi\", \"thosttraderapi\", ],\n                    extra_compile_args=compiler_flags,\n                    extra_link_args=extra_link_args,\n                    depends=[],\n                    runtime_library_dirs=[\"vnpy/api/ctp\"],\n                    language=\"cpp\",\n                    )\nvnctptd = Extension(\"vnpy.api.ctp.vnctptd\",\n                    [\n                        \"vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp\",\n                    ],\n                    include_dirs=[\"vnpy/api/ctp/include\", \"vnpy/api/ctp/vnctp\", ],\n                    define_macros=[],\n                    undef_macros=[],\n                    library_dirs=[\"vnpy/api/ctp/libs\", \"vnpy/api/ctp\"],\n                    libraries=[\"thostmduserapi\", \"thosttraderapi\", ],\n                    extra_compile_args=compiler_flags,\n                    extra_link_args=extra_link_args,\n                    runtime_library_dirs=[\"vnpy/api/ctp\"],\n                    depends=[],\n                    language=\"cpp\",\n                    )\nvnoes = Extension(\"vnpy.api.oes.vnoes\",\n                  [\n                      \"vnpy/api/oes/vnoes/generated_files/classes_1.cpp\",\n                      \"vnpy/api/oes/vnoes/generated_files/classes_2.cpp\",\n                      \"vnpy/api/oes/vnoes/generated_files/module.cpp\",\n                  ],\n                  include_dirs=[\"vnpy/api/oes/include\", \"vnpy/api/oes/vnoes\", ],\n                  define_macros=[(\"BRIGAND_NO_BOOST_SUPPORT\", \"1\")],\n                  undef_macros=[],\n                  library_dirs=[\"vnpy/api/oes/libs\"],\n                  libraries=[\"oes_api\"],\n                  extra_compile_args=compiler_flags,\n                  extra_link_args=extra_link_args,\n                  depends=[],\n                  language=\"cpp\",\n                  )\n\nif platform.uname().system == \"Windows\":\n    # use pre-built pyd for windows ( support python 3.7 only )\n    ext_modules = []\nelse:\n    ext_modules = [vnctptd, vnctpmd, vnoes]\n\npkgs = find_packages()\n\nsetup(\n    name=\"vnpy\",\n    version=version,\n    include_package_data=True,\n    packages=pkgs,\n    package_data={\"\": [\n        \"*.json\", \"*.md\", \"*.ico\", \"*.ini\",\n        \"*.dll\", \"*.so\", \"*.pyd\"\n    ]},\n    install_requires=[],\n    ext_modules=ext_modules\n)\n", "path": "setup.py"}]}