prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Issue while building mpiP
  Trying to build this on ubuntu desktop gives (config.log):
  
  ```
  configure:4289: /home/guest/workarena/softwares/sources/spack/lib/spack/env/gcc/gcc -c   conftest.c >&5
  conftest.c:11:17: fatal error: mpi.h: No such file or directory
  compilation terminated.
  configure:4289: $? = 1
  configure: failed program was:
  | /* confdefs.h */
  | #define PACKAGE_NAME "mpiP"
  | #define PACKAGE_TARNAME "mpip"
  | #define PACKAGE_VERSION "3.3"
  | #define PACKAGE_STRING "mpiP 3.3"
  | #define PACKAGE_BUGREPORT "mpip-help@lists.sourceforge.net"
  | #define PACKAGE_URL ""
  | #define DEFAULT_REPORT_FORMAT mpiPi_style_verbose
  | #define HAVE_LIBM 1
  | /* end confdefs.h.  */
  | #include "mpi.h"
  |
  | int
  | main ()
  | {
  | #ifndef MPI_Init
  | #ifdef __cplusplus
  |   (void) MPI_Init;
  | #else
  |   (void) MPI_Init;
  | #endif
  | #endif
  |
  |   ;
  |   return 0;
  | }
  configure:4289: result: no
  configure:4294: error: "Failed to find declaration for MPI_Init!"
  ```
  
  I am creating PR with additional `--with-cc` option to configure but then seeing next error:
  
  ```
    File "/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py", line 712, in StandardFileHeader
      olist = StandardFileHeader(sname)
    File "/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py", line 712, in StandardFileHeader
      olist.append("/* Creator: " + os.environ["LOGNAME"] + "  */\n")
    File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
      olist.append("/* Creator: " + os.environ["LOGNAME"] + "  */\n")
      raise KeyError(key)
    File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
  KeyError: 'LOGNAME'    raise KeyError(key)
  ```
  
  Issue while building mpiP
  Trying to build this on ubuntu desktop gives (config.log):
  
  ```
  configure:4289: /home/guest/workarena/softwares/sources/spack/lib/spack/env/gcc/gcc -c   conftest.c >&5
  conftest.c:11:17: fatal error: mpi.h: No such file or directory
  compilation terminated.
  configure:4289: $? = 1
  configure: failed program was:
  | /* confdefs.h */
  | #define PACKAGE_NAME "mpiP"
  | #define PACKAGE_TARNAME "mpip"
  | #define PACKAGE_VERSION "3.3"
  | #define PACKAGE_STRING "mpiP 3.3"
  | #define PACKAGE_BUGREPORT "mpip-help@lists.sourceforge.net"
  | #define PACKAGE_URL ""
  | #define DEFAULT_REPORT_FORMAT mpiPi_style_verbose
  | #define HAVE_LIBM 1
  | /* end confdefs.h.  */
  | #include "mpi.h"
  |
  | int
  | main ()
  | {
  | #ifndef MPI_Init
  | #ifdef __cplusplus
  |   (void) MPI_Init;
  | #else
  |   (void) MPI_Init;
  | #endif
  | #endif
  |
  |   ;
  |   return 0;
  | }
  configure:4289: result: no
  configure:4294: error: "Failed to find declaration for MPI_Init!"
  ```
  
  I am creating PR with additional `--with-cc` option to configure but then seeing next error:
  
  ```
    File "/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py", line 712, in StandardFileHeader
      olist = StandardFileHeader(sname)
    File "/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py", line 712, in StandardFileHeader
      olist.append("/* Creator: " + os.environ["LOGNAME"] + "  */\n")
    File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
      olist.append("/* Creator: " + os.environ["LOGNAME"] + "  */\n")
      raise KeyError(key)
    File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
  KeyError: 'LOGNAME'    raise KeyError(key)
  ```
  
  
  --- 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/mpip/package.py`
  Content:
  ```
  1 ##############################################################################
  2 # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
  3 # Produced at the Lawrence Livermore National Laboratory.
  4 #
  5 # This file is part of Spack.
  6 # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
  7 # LLNL-CODE-647188
  8 #
  9 # For details, see https://github.com/llnl/spack
  10 # Please also see the NOTICE and LICENSE files for our notice and the LGPL.
  11 #
  12 # This program is free software; you can redistribute it and/or modify
  13 # it under the terms of the GNU Lesser General Public License (as
  14 # published by the Free Software Foundation) version 2.1, February 1999.
  15 #
  16 # This program is distributed in the hope that it will be useful, but
  17 # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
  18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
  19 # conditions of the GNU Lesser General Public License for more details.
  20 #
  21 # You should have received a copy of the GNU Lesser General Public
  22 # License along with this program; if not, write to the Free Software
  23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24 ##############################################################################
  25 from spack import *
  26 import os
  27 
  28 
  29 class Mpip(AutotoolsPackage):
  30     """mpiP: Lightweight, Scalable MPI Profiling"""
  31     homepage = "http://mpip.sourceforge.net/"
  32     url      = "http://downloads.sourceforge.net/project/mpip/mpiP/mpiP-3.4.1/mpiP-3.4.1.tar.gz"
  33 
  34     version("3.4.1", "1168adc83777ac31d6ebd385823aabbd")
  35 
  36     depends_on("libelf", type="build")
  37     depends_on("libdwarf", type="build")
  38     depends_on('libunwind', when=os.uname()[4] == "x86_64", type="build")
  39     depends_on("mpi", type="build")
  40 
  41     def configure_args(self):
  42         return ['--without-f77']
  43
  ```
  --- 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/mpip/package.py b/var/spack/repos/builtin/packages/mpip/package.py
  --- a/var/spack/repos/builtin/packages/mpip/package.py
  +++ b/var/spack/repos/builtin/packages/mpip/package.py
  @@ -33,10 +33,14 @@
   
       version("3.4.1", "1168adc83777ac31d6ebd385823aabbd")
   
  -    depends_on("libelf", type="build")
  -    depends_on("libdwarf", type="build")
  -    depends_on('libunwind', when=os.uname()[4] == "x86_64", type="build")
  -    depends_on("mpi", type="build")
  +    depends_on("libelf")
  +    depends_on("libdwarf")
  +    depends_on('libunwind', when=os.uname()[4] == "x86_64")
  +    depends_on("mpi")
   
       def configure_args(self):
  -        return ['--without-f77']
  +        config_args = ['--without-f77']
  +        config_args.append("--with-cc=%s" % self.spec['mpi'].mpicc)
  +        config_args.append("--with-cxx=%s" % self.spec['mpi'].mpicxx)
  +
  +        return config_args
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/mpip/package.py b/var/spack/repos/builtin/packages/mpip/package.py\n--- a/var/spack/repos/builtin/packages/mpip/package.py\n+++ b/var/spack/repos/builtin/packages/mpip/package.py\n@@ -33,10 +33,14 @@\n \n     version(\"3.4.1\", \"1168adc83777ac31d6ebd385823aabbd\")\n \n-    depends_on(\"libelf\", type=\"build\")\n-    depends_on(\"libdwarf\", type=\"build\")\n-    depends_on('libunwind', when=os.uname()[4] == \"x86_64\", type=\"build\")\n-    depends_on(\"mpi\", type=\"build\")\n+    depends_on(\"libelf\")\n+    depends_on(\"libdwarf\")\n+    depends_on('libunwind', when=os.uname()[4] == \"x86_64\")\n+    depends_on(\"mpi\")\n \n     def configure_args(self):\n-        return ['--without-f77']\n+        config_args = ['--without-f77']\n+        config_args.append(\"--with-cc=%s\" % self.spec['mpi'].mpicc)\n+        config_args.append(\"--with-cxx=%s\" % self.spec['mpi'].mpicxx)\n+\n+        return config_args\n", "issue": "Issue while building mpiP\nTrying to build this on ubuntu desktop gives (config.log):\r\n\r\n```\r\nconfigure:4289: /home/guest/workarena/softwares/sources/spack/lib/spack/env/gcc/gcc -c   conftest.c >&5\r\nconftest.c:11:17: fatal error: mpi.h: No such file or directory\r\ncompilation terminated.\r\nconfigure:4289: $? = 1\r\nconfigure: failed program was:\r\n| /* confdefs.h */\r\n| #define PACKAGE_NAME \"mpiP\"\r\n| #define PACKAGE_TARNAME \"mpip\"\r\n| #define PACKAGE_VERSION \"3.3\"\r\n| #define PACKAGE_STRING \"mpiP 3.3\"\r\n| #define PACKAGE_BUGREPORT \"mpip-help@lists.sourceforge.net\"\r\n| #define PACKAGE_URL \"\"\r\n| #define DEFAULT_REPORT_FORMAT mpiPi_style_verbose\r\n| #define HAVE_LIBM 1\r\n| /* end confdefs.h.  */\r\n| #include \"mpi.h\"\r\n|\r\n| int\r\n| main ()\r\n| {\r\n| #ifndef MPI_Init\r\n| #ifdef __cplusplus\r\n|   (void) MPI_Init;\r\n| #else\r\n|   (void) MPI_Init;\r\n| #endif\r\n| #endif\r\n|\r\n|   ;\r\n|   return 0;\r\n| }\r\nconfigure:4289: result: no\r\nconfigure:4294: error: \"Failed to find declaration for MPI_Init!\"\r\n```\r\n\r\nI am creating PR with additional `--with-cc` option to configure but then seeing next error:\r\n\r\n```\r\n  File \"/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py\", line 712, in StandardFileHeader\r\n    olist = StandardFileHeader(sname)\r\n  File \"/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py\", line 712, in StandardFileHeader\r\n    olist.append(\"/* Creator: \" + os.environ[\"LOGNAME\"] + \"  */\\n\")\r\n  File \"/usr/lib/python2.7/UserDict.py\", line 40, in __getitem__\r\n    olist.append(\"/* Creator: \" + os.environ[\"LOGNAME\"] + \"  */\\n\")\r\n    raise KeyError(key)\r\n  File \"/usr/lib/python2.7/UserDict.py\", line 40, in __getitem__\r\nKeyError: 'LOGNAME'    raise KeyError(key)\r\n```\r\n\nIssue while building mpiP\nTrying to build this on ubuntu desktop gives (config.log):\r\n\r\n```\r\nconfigure:4289: /home/guest/workarena/softwares/sources/spack/lib/spack/env/gcc/gcc -c   conftest.c >&5\r\nconftest.c:11:17: fatal error: mpi.h: No such file or directory\r\ncompilation terminated.\r\nconfigure:4289: $? = 1\r\nconfigure: failed program was:\r\n| /* confdefs.h */\r\n| #define PACKAGE_NAME \"mpiP\"\r\n| #define PACKAGE_TARNAME \"mpip\"\r\n| #define PACKAGE_VERSION \"3.3\"\r\n| #define PACKAGE_STRING \"mpiP 3.3\"\r\n| #define PACKAGE_BUGREPORT \"mpip-help@lists.sourceforge.net\"\r\n| #define PACKAGE_URL \"\"\r\n| #define DEFAULT_REPORT_FORMAT mpiPi_style_verbose\r\n| #define HAVE_LIBM 1\r\n| /* end confdefs.h.  */\r\n| #include \"mpi.h\"\r\n|\r\n| int\r\n| main ()\r\n| {\r\n| #ifndef MPI_Init\r\n| #ifdef __cplusplus\r\n|   (void) MPI_Init;\r\n| #else\r\n|   (void) MPI_Init;\r\n| #endif\r\n| #endif\r\n|\r\n|   ;\r\n|   return 0;\r\n| }\r\nconfigure:4289: result: no\r\nconfigure:4294: error: \"Failed to find declaration for MPI_Init!\"\r\n```\r\n\r\nI am creating PR with additional `--with-cc` option to configure but then seeing next error:\r\n\r\n```\r\n  File \"/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py\", line 712, in StandardFileHeader\r\n    olist = StandardFileHeader(sname)\r\n  File \"/home/guest/workarena/softwares/sources/spack/var/spack/stage/mpip-3.4.1-x7l5jk256ayuuirddcxdpbpytlnis3hq/mpiP-3.4.1/make-wrappers.py\", line 712, in StandardFileHeader\r\n    olist.append(\"/* Creator: \" + os.environ[\"LOGNAME\"] + \"  */\\n\")\r\n  File \"/usr/lib/python2.7/UserDict.py\", line 40, in __getitem__\r\n    olist.append(\"/* Creator: \" + os.environ[\"LOGNAME\"] + \"  */\\n\")\r\n    raise KeyError(key)\r\n  File \"/usr/lib/python2.7/UserDict.py\", line 40, in __getitem__\r\nKeyError: 'LOGNAME'    raise KeyError(key)\r\n```\r\n\n", "before_files": [{"content": "##############################################################################\n# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory.\n#\n# This file is part of Spack.\n# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.\n# LLNL-CODE-647188\n#\n# For details, see https://github.com/llnl/spack\n# Please also see the NOTICE and LICENSE files for our notice and the LGPL.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License (as\n# published by the Free Software Foundation) version 2.1, February 1999.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and\n# conditions of the GNU Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n##############################################################################\nfrom spack import *\nimport os\n\n\nclass Mpip(AutotoolsPackage):\n    \"\"\"mpiP: Lightweight, Scalable MPI Profiling\"\"\"\n    homepage = \"http://mpip.sourceforge.net/\"\n    url      = \"http://downloads.sourceforge.net/project/mpip/mpiP/mpiP-3.4.1/mpiP-3.4.1.tar.gz\"\n\n    version(\"3.4.1\", \"1168adc83777ac31d6ebd385823aabbd\")\n\n    depends_on(\"libelf\", type=\"build\")\n    depends_on(\"libdwarf\", type=\"build\")\n    depends_on('libunwind', when=os.uname()[4] == \"x86_64\", type=\"build\")\n    depends_on(\"mpi\", type=\"build\")\n\n    def configure_args(self):\n        return ['--without-f77']\n", "path": "var/spack/repos/builtin/packages/mpip/package.py"}], "after_files": [{"content": "##############################################################################\n# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory.\n#\n# This file is part of Spack.\n# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.\n# LLNL-CODE-647188\n#\n# For details, see https://github.com/llnl/spack\n# Please also see the NOTICE and LICENSE files for our notice and the LGPL.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License (as\n# published by the Free Software Foundation) version 2.1, February 1999.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and\n# conditions of the GNU Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n##############################################################################\nfrom spack import *\nimport os\n\n\nclass Mpip(AutotoolsPackage):\n    \"\"\"mpiP: Lightweight, Scalable MPI Profiling\"\"\"\n    homepage = \"http://mpip.sourceforge.net/\"\n    url      = \"http://downloads.sourceforge.net/project/mpip/mpiP/mpiP-3.4.1/mpiP-3.4.1.tar.gz\"\n\n    version(\"3.4.1\", \"1168adc83777ac31d6ebd385823aabbd\")\n\n    depends_on(\"libelf\")\n    depends_on(\"libdwarf\")\n    depends_on('libunwind', when=os.uname()[4] == \"x86_64\")\n    depends_on(\"mpi\")\n\n    def configure_args(self):\n        config_args = ['--without-f77']\n        config_args.append(\"--with-cc=%s\" % self.spec['mpi'].mpicc)\n        config_args.append(\"--with-cxx=%s\" % self.spec['mpi'].mpicxx)\n\n        return config_args\n", "path": "var/spack/repos/builtin/packages/mpip/package.py"}]}