prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Building numpy on AIX (xlc and xlf)
  <!-- Please describe the issue in detail here, and fill in the fields below -->
  build for AIX is not working.
  
  A couple of issues - maybe all simple to fix - still researching the last one...
  
  First one: numpy/fft/_pocketfft.c does not compile -- resolution: `export CFLAGS=-D_LARGE_FILES`
  
  Second issue: Does not find ld_so_aix - expects, it seems, a symbolic link to the correct directory. e.g., calls `/opt/lib/python3.6/config/ld_so_aix` when the actual path is `/opt/lib/python3.6/config-3.6m/ld_so_aix`
  
  Third issue: same issue as issue #6609 - undefined symbols:
  ```
  ld: 0711-317 ERROR: Undefined symbol: .zungqr_
  ld: 0711-317 ERROR: Undefined symbol: .zgeqrf_
  ld: 0711-317 ERROR: Undefined symbol: .zgelsd_
  ld: 0711-317 ERROR: Undefined symbol: .dorgqr_
  ld: 0711-317 ERROR: Undefined symbol: .dgeqrf_
  ld: 0711-317 ERROR: Undefined symbol: .dgelsd_
  ```
  
  The first issues are easy to get around - export CFLAGS and add a symbolic link for the generic path.
  
  For the final issue I am going to guess that there is a macro involved - that is adding an underscore to the function being called - as they do exist in liblapack.a
  
  ### Reproducing code example:
  
  `python setup.py build`
  
  <!-- Remove these sections for a feature request -->
  
  ### Error message:
  More detail:
  ```
  ld: 0711-318 ERROR: Undefined symbols were found.
          The following symbols are in error:
   Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}
                                RLD: Address  Section  Rld-type Referencing Symbol
   ----------------------------------------------------------------------------------------------
   .zungqr_                  [124]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)
                                     000002c0 .text    R_RBR    [10]    <.lapack_lite_zungqr>
   .zgeqrf_                  [128]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)
                                     00000454 .text    R_RBR    [12]    <.lapack_lite_zgeqrf>
   .zgelsd_                  [130]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)
                                     000006fc .text    R_RBR    [14]    <.lapack_lite_zgelsd>
   .dorgqr_                  [132]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)
                                     00000920 .text    R_RBR    [16]    <.lapack_lite_dorgqr>
   .dgeqrf_                  [134]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)
                                     00000a94 .text    R_RBR    [18]    <.lapack_lite_dgeqrf>
   .dgelsd_                  [136]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)
                                     00000d3c .text    R_RBR    [20]    <.lapack_lite_dgelsd>
  ER: The return code is 8.
  
  
  ```
  
  Note: They do exist - just without the trailing underscore (_)
  
  ```
  (py36) root@x066:[/data/prj/python/numpy-1.17.4]nm -Ae /usr/lib/liblapack.a | egrep "zungqr|zgeqrf|zgelsd|dorgqr|dgeqrf|dgelsd"_ | grep -v " U " | egrep ": \.[a-z]"
  /usr/lib/liblapack.a[dgeqrf.o]: .dgeqrf              T           0
  /usr/lib/liblapack.a[dgeqrfp.o]: .dgeqrfp             T           0
  /usr/lib/liblapack.a[dorgqr.o]: .dorgqr              T           0
  /usr/lib/liblapack.a[zgelsd.o]: .zgelsd              T           0
  /usr/lib/liblapack.a[zgeqrf.o]: .zgeqrf              T           0
  /usr/lib/liblapack.a[zgeqrfp.o]: .zgeqrfp             T           0
  /usr/lib/liblapack.a[zungqr.o]: .zungqr              T           0
  
  ```
  
  * UPDATE: this is resolved by adding -DNO_APPEND_FORTRAN to CFLAGS
  
  * Now I am open to suggestions on where and how to best get these automated in setup.py process.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `numpy/fft/setup.py`
  Content:
  ```
  1 
  2 def configuration(parent_package='',top_path=None):
  3     from numpy.distutils.misc_util import Configuration
  4     config = Configuration('fft', parent_package, top_path)
  5 
  6     config.add_data_dir('tests')
  7 
  8     # Configure pocketfft_internal
  9     config.add_extension('_pocketfft_internal',
  10                          sources=['_pocketfft.c']
  11                          )
  12 
  13     return config
  14 
  15 if __name__ == '__main__':
  16     from numpy.distutils.core import setup
  17     setup(configuration=configuration)
  18
  ```
  --- 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/numpy/fft/setup.py b/numpy/fft/setup.py
  --- a/numpy/fft/setup.py
  +++ b/numpy/fft/setup.py
  @@ -1,3 +1,4 @@
  +import sys
   
   def configuration(parent_package='',top_path=None):
       from numpy.distutils.misc_util import Configuration
  @@ -5,9 +6,12 @@
   
       config.add_data_dir('tests')
   
  +    # AIX needs to be told to use large file support - at all times
  +    defs = [('_LARGE_FILES', None)] if sys.platform[:3] == "aix" else []
       # Configure pocketfft_internal
       config.add_extension('_pocketfft_internal',
  -                         sources=['_pocketfft.c']
  +                         sources=['_pocketfft.c'],
  +                         define_macros=defs,
                            )
   
       return config
  
verification_info: {"golden_diff": "diff --git a/numpy/fft/setup.py b/numpy/fft/setup.py\n--- a/numpy/fft/setup.py\n+++ b/numpy/fft/setup.py\n@@ -1,3 +1,4 @@\n+import sys\n \n def configuration(parent_package='',top_path=None):\n     from numpy.distutils.misc_util import Configuration\n@@ -5,9 +6,12 @@\n \n     config.add_data_dir('tests')\n \n+    # AIX needs to be told to use large file support - at all times\n+    defs = [('_LARGE_FILES', None)] if sys.platform[:3] == \"aix\" else []\n     # Configure pocketfft_internal\n     config.add_extension('_pocketfft_internal',\n-                         sources=['_pocketfft.c']\n+                         sources=['_pocketfft.c'],\n+                         define_macros=defs,\n                          )\n \n     return config\n", "issue": "Building numpy on AIX (xlc and xlf)\n<!-- Please describe the issue in detail here, and fill in the fields below -->\r\nbuild for AIX is not working.\r\n\r\nA couple of issues - maybe all simple to fix - still researching the last one...\r\n\r\nFirst one: numpy/fft/_pocketfft.c does not compile -- resolution: `export CFLAGS=-D_LARGE_FILES`\r\n\r\nSecond issue: Does not find ld_so_aix - expects, it seems, a symbolic link to the correct directory. e.g., calls `/opt/lib/python3.6/config/ld_so_aix` when the actual path is `/opt/lib/python3.6/config-3.6m/ld_so_aix`\r\n\r\nThird issue: same issue as issue #6609 - undefined symbols:\r\n```\r\nld: 0711-317 ERROR: Undefined symbol: .zungqr_\r\nld: 0711-317 ERROR: Undefined symbol: .zgeqrf_\r\nld: 0711-317 ERROR: Undefined symbol: .zgelsd_\r\nld: 0711-317 ERROR: Undefined symbol: .dorgqr_\r\nld: 0711-317 ERROR: Undefined symbol: .dgeqrf_\r\nld: 0711-317 ERROR: Undefined symbol: .dgelsd_\r\n```\r\n\r\nThe first issues are easy to get around - export CFLAGS and add a symbolic link for the generic path.\r\n\r\nFor the final issue I am going to guess that there is a macro involved - that is adding an underscore to the function being called - as they do exist in liblapack.a\r\n\r\n### Reproducing code example:\r\n\r\n`python setup.py build`\r\n\r\n<!-- Remove these sections for a feature request -->\r\n\r\n### Error message:\r\nMore detail:\r\n```\r\nld: 0711-318 ERROR: Undefined symbols were found.\r\n        The following symbols are in error:\r\n Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}\r\n                              RLD: Address  Section  Rld-type Referencing Symbol\r\n ----------------------------------------------------------------------------------------------\r\n .zungqr_                  [124]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)\r\n                                   000002c0 .text    R_RBR    [10]    <.lapack_lite_zungqr>\r\n .zgeqrf_                  [128]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)\r\n                                   00000454 .text    R_RBR    [12]    <.lapack_lite_zgeqrf>\r\n .zgelsd_                  [130]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)\r\n                                   000006fc .text    R_RBR    [14]    <.lapack_lite_zgelsd>\r\n .dorgqr_                  [132]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)\r\n                                   00000920 .text    R_RBR    [16]    <.lapack_lite_dorgqr>\r\n .dgeqrf_                  [134]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)\r\n                                   00000a94 .text    R_RBR    [18]    <.lapack_lite_dgeqrf>\r\n .dgelsd_                  [136]   ER PR numpy/linalg/lapack_litemodule.c(build/temp.AIX.6106.1043.64-3.6/numpy/linalg/lapack_litemodule.o)\r\n                                   00000d3c .text    R_RBR    [20]    <.lapack_lite_dgelsd>\r\nER: The return code is 8.\r\n\r\n\r\n```\r\n\r\nNote: They do exist - just without the trailing underscore (_)\r\n\r\n```\r\n(py36) root@x066:[/data/prj/python/numpy-1.17.4]nm -Ae /usr/lib/liblapack.a | egrep \"zungqr|zgeqrf|zgelsd|dorgqr|dgeqrf|dgelsd\"_ | grep -v \" U \" | egrep \": \\.[a-z]\"\r\n/usr/lib/liblapack.a[dgeqrf.o]: .dgeqrf              T           0\r\n/usr/lib/liblapack.a[dgeqrfp.o]: .dgeqrfp             T           0\r\n/usr/lib/liblapack.a[dorgqr.o]: .dorgqr              T           0\r\n/usr/lib/liblapack.a[zgelsd.o]: .zgelsd              T           0\r\n/usr/lib/liblapack.a[zgeqrf.o]: .zgeqrf              T           0\r\n/usr/lib/liblapack.a[zgeqrfp.o]: .zgeqrfp             T           0\r\n/usr/lib/liblapack.a[zungqr.o]: .zungqr              T           0\r\n\r\n```\r\n\r\n* UPDATE: this is resolved by adding -DNO_APPEND_FORTRAN to CFLAGS\r\n\r\n* Now I am open to suggestions on where and how to best get these automated in setup.py process.\n", "before_files": [{"content": "\ndef configuration(parent_package='',top_path=None):\n    from numpy.distutils.misc_util import Configuration\n    config = Configuration('fft', parent_package, top_path)\n\n    config.add_data_dir('tests')\n\n    # Configure pocketfft_internal\n    config.add_extension('_pocketfft_internal',\n                         sources=['_pocketfft.c']\n                         )\n\n    return config\n\nif __name__ == '__main__':\n    from numpy.distutils.core import setup\n    setup(configuration=configuration)\n", "path": "numpy/fft/setup.py"}], "after_files": [{"content": "import sys\n\ndef configuration(parent_package='',top_path=None):\n    from numpy.distutils.misc_util import Configuration\n    config = Configuration('fft', parent_package, top_path)\n\n    config.add_data_dir('tests')\n\n    # AIX needs to be told to use large file support - at all times\n    defs = [('_LARGE_FILES', None)] if sys.platform[:3] == \"aix\" else []\n    # Configure pocketfft_internal\n    config.add_extension('_pocketfft_internal',\n                         sources=['_pocketfft.c'],\n                         define_macros=defs,\n                         )\n\n    return config\n\nif __name__ == '__main__':\n    from numpy.distutils.core import setup\n    setup(configuration=configuration)\n", "path": "numpy/fft/setup.py"}]}