prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  nn-c uses invalid self.compiler.pic_flag?  (breaks nn-c build, via elmerfem build)
  These lines fail, because there is no such member, and looking at other packages, it seems that flags like
  ```
  self.compiler.cc_pic_flag
  self.compiler.cxx_pic_flag
  self.compiler.fc_pic_flag
  #or ?
  self.compiler.f77_pic_flag
  ```
  would be appropriate.
  
  https://github.com/spack/spack/blob/601f97d8a50b1840df9b056a34256b6dd2b54ce3/var/spack/repos/builtin/packages/nn-c/package.py#L29-L31
  
  I triggered this on recent `devel` (today) by
  ```
  spack install --test=root elmerfem@devel +mpi +hypre +lua +mumps +openmp +scatt2d +trilinos +zoltan
  ```
  
  </issue>
  <code>
  [start of var/spack/repos/builtin/packages/nn-c/package.py]
  1 # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
  2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
  3 #
  4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
  5 
  6 from spack import *
  7 
  8 
  9 class NnC(AutotoolsPackage):
  10     """nn: Natural Neighbours interpolation. nn is a C code
  11     for Natural Neighbours interpolation of 2D scattered data.
  12     It provides a C library and a command line utility nnbathy."""
  13 
  14     homepage = "https://github.com/sakov/nn-c"
  15     git      = "https://github.com/sakov/nn-c.git"
  16 
  17     version('master', branch='master')
  18     version('1.86.2', commit='343c7784d38d3270d75d450569fc0b64767c37e9')
  19 
  20     variant('pic', default=True,
  21             description='Produce position-independent code (for shared libs)')
  22 
  23     configure_directory = 'nn'
  24 
  25     def configure_args(self):
  26         args = []
  27         if '+pic' in self.spec:
  28             args.extend([
  29                 'CFLAGS={0}'.format(self.compiler.pic_flag),
  30                 'CXXFLAGS={0}'.format(self.compiler.pic_flag),
  31                 'FFLAGS={0}'.format(self.compiler.pic_flag)
  32             ])
  33         return args
  34
  [end of var/spack/repos/builtin/packages/nn-c/package.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/var/spack/repos/builtin/packages/nn-c/package.py b/var/spack/repos/builtin/packages/nn-c/package.py
  --- a/var/spack/repos/builtin/packages/nn-c/package.py
  +++ b/var/spack/repos/builtin/packages/nn-c/package.py
  @@ -26,8 +26,8 @@
           args = []
           if '+pic' in self.spec:
               args.extend([
  -                'CFLAGS={0}'.format(self.compiler.pic_flag),
  -                'CXXFLAGS={0}'.format(self.compiler.pic_flag),
  -                'FFLAGS={0}'.format(self.compiler.pic_flag)
  +                'CFLAGS={0}'.format(self.compiler.cc_pic_flag),
  +                'CXXFLAGS={0}'.format(self.compiler.cxx_pic_flag),
  +                'FFLAGS={0}'.format(self.compiler.fc_pic_flag)
               ])
           return args
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/nn-c/package.py b/var/spack/repos/builtin/packages/nn-c/package.py\n--- a/var/spack/repos/builtin/packages/nn-c/package.py\n+++ b/var/spack/repos/builtin/packages/nn-c/package.py\n@@ -26,8 +26,8 @@\n         args = []\n         if '+pic' in self.spec:\n             args.extend([\n-                'CFLAGS={0}'.format(self.compiler.pic_flag),\n-                'CXXFLAGS={0}'.format(self.compiler.pic_flag),\n-                'FFLAGS={0}'.format(self.compiler.pic_flag)\n+                'CFLAGS={0}'.format(self.compiler.cc_pic_flag),\n+                'CXXFLAGS={0}'.format(self.compiler.cxx_pic_flag),\n+                'FFLAGS={0}'.format(self.compiler.fc_pic_flag)\n             ])\n         return args\n", "issue": "nn-c uses invalid self.compiler.pic_flag?  (breaks nn-c build, via elmerfem build)\nThese lines fail, because there is no such member, and looking at other packages, it seems that flags like\r\n```\r\nself.compiler.cc_pic_flag\r\nself.compiler.cxx_pic_flag\r\nself.compiler.fc_pic_flag\r\n#or ?\r\nself.compiler.f77_pic_flag\r\n```\r\nwould be appropriate.\r\n\r\nhttps://github.com/spack/spack/blob/601f97d8a50b1840df9b056a34256b6dd2b54ce3/var/spack/repos/builtin/packages/nn-c/package.py#L29-L31\r\n\r\nI triggered this on recent `devel` (today) by\r\n```\r\nspack install --test=root elmerfem@devel +mpi +hypre +lua +mumps +openmp +scatt2d +trilinos +zoltan\r\n```\n", "before_files": [{"content": "# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass NnC(AutotoolsPackage):\n    \"\"\"nn: Natural Neighbours interpolation. nn is a C code\n    for Natural Neighbours interpolation of 2D scattered data.\n    It provides a C library and a command line utility nnbathy.\"\"\"\n\n    homepage = \"https://github.com/sakov/nn-c\"\n    git      = \"https://github.com/sakov/nn-c.git\"\n\n    version('master', branch='master')\n    version('1.86.2', commit='343c7784d38d3270d75d450569fc0b64767c37e9')\n\n    variant('pic', default=True,\n            description='Produce position-independent code (for shared libs)')\n\n    configure_directory = 'nn'\n\n    def configure_args(self):\n        args = []\n        if '+pic' in self.spec:\n            args.extend([\n                'CFLAGS={0}'.format(self.compiler.pic_flag),\n                'CXXFLAGS={0}'.format(self.compiler.pic_flag),\n                'FFLAGS={0}'.format(self.compiler.pic_flag)\n            ])\n        return args\n", "path": "var/spack/repos/builtin/packages/nn-c/package.py"}]}