title: Error in setup script during Fortran extension compilation: "No such file or directory"
body: <p>I have managed to wrap a set of Fortran 90 sources manually using f2py. To do so, I generated the signature file as explained in: <a href="http://docs.scipy.org/doc/numpy/user/c-info.python-as-glue.html" rel="nofollow">http://docs.scipy.org/doc/numpy/user/c-info.python-as-glue.html</a> and I can obtain a .so which I can call from some Python interface files.</p>
  
  <p>Now I want to create a package from it which would automatically build the Fortran extension. The only addition in the folder containing the Fortran sources and signature file is now a setup.py file with the following content:</p>
  
  <pre><code>from numpy.distutils.core import setup, Extension
  from numpy.distutils.misc_util import Configuration
  
  DISTNAME = 'greengard'
  
  def configuration(parent_package='',top_path=None):
      config = Configuration(DISTNAME, parent_package, top_path)
      # the Fortran sources
      f90_sources = ['_greengard.pyf'
                     'nufft1df90.f',
                     'nufft2df90.f',
                     'nufft3df90.f',
                     'next235.f',
                     'dfftpack.f',
                     ]
      config.add_extension('_greengard', f90_sources)
  return config
  
  if __name__ == "__main__":
      setup(configuration=configuration) 
  </code></pre>
  
  <p>Then activated a virtualenv and tried to install the package</p>
  
  <pre><code>python setup.py install 
  </code></pre>
  
  <p>But get the following error in the end:</p>
  
  <pre><code>creating build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/greengard
  compile options: '-Ibuild/src.linux-x86_64-2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
  gcc: build/src.linux-x86_64-2.7/greengard/_greengardmodule.c
  gcc: build/src.linux-x86_64-2.7/fortranobject.c
  compiling Fortran sources
  Fortran f77 compiler: /usr/bin/gfortran -Wall -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
  Fortran f90 compiler: /usr/bin/gfortran -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
  Fortran fix compiler: /usr/bin/gfortran -Wall -ffixed-form -fno-second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
  compile options: '-Ibuild/src.linux-x86_64-2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
  error: _greengard.pyfnufft1df90.f: No such file or directory
  </code></pre>
  
  <p>First line after launching setup.py gave:</p>
  
  <pre><code>non-existing path in '': '_greengard.pyfnufft1df90.f'
  </code></pre>
  
  <p>But the setup process keeps going and the Fortran extension seem to be compiled (the displayed lines look like what I get by manually running f2py).</p>
  
  <p>I tried to find a solution from the examples available online but most of them were a bit too simple to be helpful. Can someone with experience in Python packaging help me on this one please ? </p>