prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  "master" fails to build with MKL
  Recently, when I try to build the "master" branch, I keep getting this error from `linalg/solve/dsolve/setup.py`:
  
  ``` .Python
  ValueError: list.remove(x): x not in list
  ```
  
  The error traces to this block of code <a href="https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/dsolve/setup.py#L30-L32">here</a>, for it seems that the `lsame.c` file does not exist in the list of sources.  Sure enough, when I remove this check, `scipy` builds successfully and tests pass.
  
  I don't know what happened recently that caused this setup to break (it has never happened before until now), but is anyone else getting this issue?
  
  Setup: Python 3.5.1, Windows 7, `numpy` 1.10.4, MKL
  
  
  </issue>
  <code>
  [start of scipy/sparse/linalg/dsolve/setup.py]
  1 #!/usr/bin/env python
  2 from __future__ import division, print_function, absolute_import
  3 
  4 from os.path import join, dirname
  5 import sys
  6 import os
  7 import glob
  8 
  9 
  10 def configuration(parent_package='',top_path=None):
  11     from numpy.distutils.misc_util import Configuration
  12     from numpy.distutils.system_info import get_info
  13     from scipy._build_utils import get_sgemv_fix
  14     from scipy._build_utils import numpy_nodepr_api
  15 
  16     config = Configuration('dsolve',parent_package,top_path)
  17     config.add_data_dir('tests')
  18 
  19     lapack_opt = get_info('lapack_opt',notfound_action=2)
  20     if sys.platform == 'win32':
  21         superlu_defs = [('NO_TIMER',1)]
  22     else:
  23         superlu_defs = []
  24     superlu_defs.append(('USE_VENDOR_BLAS',1))
  25 
  26     superlu_src = join(dirname(__file__), 'SuperLU', 'SRC')
  27 
  28     sources = list(glob.glob(join(superlu_src, '*.c')))
  29     headers = list(glob.glob(join(superlu_src, '*.h')))
  30     if os.name == 'nt' and ('FPATH' in os.environ or 'MKLROOT' in os.environ):
  31         # when using MSVC + MKL, lsame is already in MKL
  32         sources.remove(join(superlu_src, 'lsame.c'))
  33 
  34     config.add_library('superlu_src',
  35                        sources=sources,
  36                        macros=superlu_defs,
  37                        include_dirs=[superlu_src],
  38                        )
  39 
  40     # Extension
  41     ext_sources = ['_superlumodule.c',
  42                    '_superlu_utils.c',
  43                    '_superluobject.c']
  44     ext_sources += get_sgemv_fix(lapack_opt)
  45 
  46     config.add_extension('_superlu',
  47                          sources=ext_sources,
  48                          libraries=['superlu_src'],
  49                          depends=(sources + headers),
  50                          extra_info=lapack_opt,
  51                          **numpy_nodepr_api
  52                          )
  53 
  54     return config
  55 
  56 if __name__ == '__main__':
  57     from numpy.distutils.core import setup
  58     setup(**configuration(top_path='').todict())
  59
  [end of scipy/sparse/linalg/dsolve/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/scipy/sparse/linalg/dsolve/setup.py b/scipy/sparse/linalg/dsolve/setup.py
  --- a/scipy/sparse/linalg/dsolve/setup.py
  +++ b/scipy/sparse/linalg/dsolve/setup.py
  @@ -27,9 +27,6 @@
   
       sources = list(glob.glob(join(superlu_src, '*.c')))
       headers = list(glob.glob(join(superlu_src, '*.h')))
  -    if os.name == 'nt' and ('FPATH' in os.environ or 'MKLROOT' in os.environ):
  -        # when using MSVC + MKL, lsame is already in MKL
  -        sources.remove(join(superlu_src, 'lsame.c'))
   
       config.add_library('superlu_src',
                          sources=sources,
  
verification_info: {"golden_diff": "diff --git a/scipy/sparse/linalg/dsolve/setup.py b/scipy/sparse/linalg/dsolve/setup.py\n--- a/scipy/sparse/linalg/dsolve/setup.py\n+++ b/scipy/sparse/linalg/dsolve/setup.py\n@@ -27,9 +27,6 @@\n \n     sources = list(glob.glob(join(superlu_src, '*.c')))\n     headers = list(glob.glob(join(superlu_src, '*.h')))\n-    if os.name == 'nt' and ('FPATH' in os.environ or 'MKLROOT' in os.environ):\n-        # when using MSVC + MKL, lsame is already in MKL\n-        sources.remove(join(superlu_src, 'lsame.c'))\n \n     config.add_library('superlu_src',\n                        sources=sources,\n", "issue": "\"master\" fails to build with MKL\nRecently, when I try to build the \"master\" branch, I keep getting this error from `linalg/solve/dsolve/setup.py`:\n\n``` .Python\nValueError: list.remove(x): x not in list\n```\n\nThe error traces to this block of code <a href=\"https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/dsolve/setup.py#L30-L32\">here</a>, for it seems that the `lsame.c` file does not exist in the list of sources.  Sure enough, when I remove this check, `scipy` builds successfully and tests pass.\n\nI don't know what happened recently that caused this setup to break (it has never happened before until now), but is anyone else getting this issue?\n\nSetup: Python 3.5.1, Windows 7, `numpy` 1.10.4, MKL\n\n", "before_files": [{"content": "#!/usr/bin/env python\nfrom __future__ import division, print_function, absolute_import\n\nfrom os.path import join, dirname\nimport sys\nimport os\nimport glob\n\n\ndef configuration(parent_package='',top_path=None):\n    from numpy.distutils.misc_util import Configuration\n    from numpy.distutils.system_info import get_info\n    from scipy._build_utils import get_sgemv_fix\n    from scipy._build_utils import numpy_nodepr_api\n\n    config = Configuration('dsolve',parent_package,top_path)\n    config.add_data_dir('tests')\n\n    lapack_opt = get_info('lapack_opt',notfound_action=2)\n    if sys.platform == 'win32':\n        superlu_defs = [('NO_TIMER',1)]\n    else:\n        superlu_defs = []\n    superlu_defs.append(('USE_VENDOR_BLAS',1))\n\n    superlu_src = join(dirname(__file__), 'SuperLU', 'SRC')\n\n    sources = list(glob.glob(join(superlu_src, '*.c')))\n    headers = list(glob.glob(join(superlu_src, '*.h')))\n    if os.name == 'nt' and ('FPATH' in os.environ or 'MKLROOT' in os.environ):\n        # when using MSVC + MKL, lsame is already in MKL\n        sources.remove(join(superlu_src, 'lsame.c'))\n\n    config.add_library('superlu_src',\n                       sources=sources,\n                       macros=superlu_defs,\n                       include_dirs=[superlu_src],\n                       )\n\n    # Extension\n    ext_sources = ['_superlumodule.c',\n                   '_superlu_utils.c',\n                   '_superluobject.c']\n    ext_sources += get_sgemv_fix(lapack_opt)\n\n    config.add_extension('_superlu',\n                         sources=ext_sources,\n                         libraries=['superlu_src'],\n                         depends=(sources + headers),\n                         extra_info=lapack_opt,\n                         **numpy_nodepr_api\n                         )\n\n    return config\n\nif __name__ == '__main__':\n    from numpy.distutils.core import setup\n    setup(**configuration(top_path='').todict())\n", "path": "scipy/sparse/linalg/dsolve/setup.py"}]}