prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `var/spack/repos/builtin/packages/nn-c/package.py`
  Content:
  ```
  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 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/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"}], "after_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.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", "path": "var/spack/repos/builtin/packages/nn-c/package.py"}]}