v-morello / pyne2001

A python wrapper around the original FORTRAN implementation of the NE2001 Galactic free electron density model
MIT License
2 stars 6 forks source link

Fortran source build failing on pip install: 'f77' not found #1

Closed mkuiack closed 4 years ago

mkuiack commented 4 years ago

Attempting to instal in a virtual. Python 2.7 and python 3.+


Building wheel for pyne2001 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python3/bin/python3.5 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py'"'"'; __file__='"'"'/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-wheel-9_4ioh16
       cwd: /private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/
  Complete output (38 lines):
  /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  rm -f ../bin/NE2001 NE2001.o dmdsm.NE2001.o density.NE2001.o neLISM.NE2001.o neclumpN.o nevoidN.o scattering98.o libNE2001.a
  f77 -O -std=gnu  -c -o NE2001.o NE2001.f
  make: f77: No such file or directory
  make: *** [NE2001.o] Error 1
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py", line 97, in <module>
      'build_py': CustomBuildPy
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 179, in run
      self.run_command('build')
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py", line 49, in run
      compile_ne2001()
    File "/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py", line 17, in compile_ne2001
      subprocess.check_call('make all', shell=True)
    File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 584, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'make all' returned non-zero exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for pyne2001
  Running setup.py clean for pyne2001
Failed to build pyne2001
Installing collected packages: pyne2001
    Running setup.py install for pyne2001 ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python3/bin/python3.5 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py'"'"'; __file__='"'"'/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-record-mw9gzoh7/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.5m/pyne2001
         cwd: /private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/
    Complete output (24 lines):
    /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    running install
    rm -f ../bin/NE2001 NE2001.o dmdsm.NE2001.o density.NE2001.o neLISM.NE2001.o neclumpN.o nevoidN.o scattering98.o libNE2001.a
    f77 -O -std=gnu  -c -o NE2001.o NE2001.f
    make: f77: No such file or directory
    make: *** [NE2001.o] Error 1
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py", line 97, in <module>
        'build_py': CustomBuildPy
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py", line 27, in run
        compile_ne2001()
      File "/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py", line 17, in compile_ne2001
        subprocess.check_call('make all', shell=True)
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 584, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'make all' returned non-zero exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python3/bin/python3.5 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py'"'"'; __file__='"'"'/private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-install-yg5jmeme/pyne2001/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/3q/ssp1j8vs19s9z9720yf1pz0m0000gn/T/pip-record-mw9gzoh7/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.5m/pyne2001 Check the logs for full command output.```
v-morello commented 4 years ago

Hi there Mark,

Are you on a Mac ? Someone reported the same issue to me some time ago. The problem is here specifically in your traceback, when the fortran source is being built:

  f77 -O -std=gnu  -c -o NE2001.o NE2001.f
  make: f77: No such file or directory

In the fortran Makefile, the variable FC refers to f77 by default. On linux f77 is always aliased (in my experience) to whatever fortran compiler is installed on your system. So in your case, either you don't have a fortran compiler installed, or more likely 'f77' is not pointing to anything.

The solution is simple. If for example, you have gfortran installed, type this: FC=gfortran pip install pyne2001

Which basically overrides the FC environment variable for this specific command only. Let me know if that works.

mkuiack commented 4 years ago

Ah yes, that's right, I don't have a Fortran compiler.

Thanks!