manodeep / Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
https://corrfunc.readthedocs.io
MIT License
163 stars 50 forks source link

Compile failure for missing 'CC' in the environment #225

Closed manodeep closed 3 years ago

manodeep commented 3 years ago

General information

Reported by Meredith Clark Powell, with the issue faced Riley Jane Shaper

Issue description

Compilation fails when 'CC' is not defined in the environment

Expected behavior

Corrfunc should compile with some default compiler (or fail when the default compiler is unavailable)

Actual behavior

A KeyError is raised. Here's the traceback

 $ python -m pip install . --user

Processing /data/rjshaper/software/Corrfunc

    ERROR: Command errored out with exit status 1:

     command: /home/rjshaper/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-0egvp1cp/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-0egvp1cp/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-0egvp1cp/pip-egg-info

         cwd: /tmp/pip-req-build-0egvp1cp/

    Complete output (11 lines):

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-req-build-0egvp1cp/setup.py", line 558, in <module>

        setup_packages()

      File "/tmp/pip-req-build-0egvp1cp/setup.py", line 442, in setup_packages

        common_dict = requirements_check()

      File "/tmp/pip-req-build-0egvp1cp/setup.py", line 238, in requirements_check

        if os.environ['CC']:

      File "/home/rjshaper/anaconda3/lib/python3.7/os.py", line 679, in __getitem__

        raise KeyError(key) from None

    KeyError: 'CC'

    ----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

What have you tried so far?

N/A

Minimal failing example

Checking out the master branch from the repo, and undef'ing 'CC' (if defined) reproduces the error

Additional notes

This bug was introduced in #220

rjshaper commented 3 years ago

Hi, I am getting an error when I try to do this. My input was: $ git checkout fix_env_cc and the output I got was: error: pathspec 'fix_env_cc' did not match any file(s) known to git. What else can I try?

lgarrison commented 3 years ago

@rjshaper Can you try git pull first?

rjshaper commented 3 years ago

@lgarrison That fixed it. Thank you!

manodeep commented 3 years ago

Fixed by #226