sagemath / cysignals

cysignals: interrupt and signal handling for Cython. Source repository for https://pypi.org/project/cysignals/
GNU Lesser General Public License v3.0
44 stars 23 forks source link

Cannot install cysignals on macOS (catalina) #116

Closed AckslD closed 4 years ago

AckslD commented 4 years ago

When I do pip3 install cysignals, I get the following error:

Looking in indexes: https://pypi.org/simple, https://pypi.netsquid.org
Collecting cysignals
  Using cached https://files.pythonhosted.org/packages/51/5f/727aa099de5c60b3fb42cdde72097277803dabe78b177afdb5b835bbf909/cysignals-1.10.2.tar.gz
Requirement already satisfied: Cython>=0.28 in /usr/local/lib/python3.7/site-packages (from cysignals) (0.28.5)
Building wheels for collected packages: cysignals
  Running setup.py bdist_wheel for cysignals: started
  Running setup.py bdist_wheel for cysignals: finished with status 'error'
  Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/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/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-wheel-5bm4dbh3 --python-tag cp37:
  running bdist_wheel
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
    return f(*args, **kwds)
  running build
  make: `configure' is up to date.
  checking for gcc... gcc
  checking whether the C compiler works... no
  configure: error: in `/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/setup.py", line 151, in <module>
      cmdclass=dict(build=build, bdist_egg=no_egg),
    File "/Users/adahlberg/Library/Python/3.7/lib/python/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/Users/adahlberg/Library/Python/3.7/lib/python/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/setup.py", line 96, in run
      subprocess.check_call(["sh", "configure"])
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 328, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['sh', 'configure']' returned non-zero exit status 77.

  ----------------------------------------
  Failed building wheel for cysignals
  Running setup.py clean for cysignals
Failed to build cysignals
Installing collected packages: cysignals
  Running setup.py install for cysignals: started
    Running setup.py install for cysignals: finished with status 'error'
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/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/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-record-31boyisu/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    make: `configure' is up to date.
    checking for gcc... gcc
    checking whether the C compiler works... no
    configure: error: in `/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals':
    configure: error: C compiler cannot create executables
    See `config.log' for more details
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/setup.py", line 151, in <module>
        cmdclass=dict(build=build, bdist_egg=no_egg),
      File "/Users/adahlberg/Library/Python/3.7/lib/python/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/Users/adahlberg/Library/Python/3.7/lib/python/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/setup.py", line 96, in run
        subprocess.check_call(["sh", "configure"])
      File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 328, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['sh', 'configure']' returned non-zero exit status 77.

    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/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/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-record-31boyisu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals/

What could be wrong?

kiwifb commented 4 years ago

We need to see the config.log file to make a proper diagnostic. configure says the compiler is not working and config.log may tell us exactly what is the problem.

AckslD commented 4 years ago

Hi @kiwifb! Thanks for your reply! Where can I find the configure.log? If I try to access the folder /private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-qji9bd90/cysignals it seems it does not exist anymore.

kiwifb commented 4 years ago

Run pip3 install --no-clean ... and it should keep all those files and directories.

AckslD commented 4 years ago

Hi again @kiwifb, below is the core tests part from the config.log, it seems as some arguments to gcc are not recognized. I've before this update gcc by running brew upgrade gcc:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2269: checking for gcc
configure:2285: found /usr/local/bin/gcc
configure:2296: result: gcc
configure:2525: checking for C compiler version
configure:2534: gcc --version >&5
gcc (Homebrew GCC 4.8.5) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2545: $? = 0
configure:2534: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc@4.8/4.8.5/libexec/gcc/x86_64-apple-darwin16.3.0/4.8.5/lto-wrapper
Target: x86_64-apple-darwin16.3.0
Configured with: ../configure --build=x86_64-apple-darwin16.3.0 --prefix=/usr/local/Cellar/gcc@4.8/4.8.5 --libdir=/usr/local/Cellar/gcc@4.8/4.8.5/lib/gcc/4.8 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp@4 --with-mpfr=/usr/local/opt/mpfr@2 --with-mpc=/usr/local/opt/libmpc@0.8 --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl@0.12 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew GCC 4.8.5' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues MAKEINFO=missing --with-build-config=bootstrap-debug --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.5 (Homebrew GCC 4.8.5) 
configure:2545: $? = 0
configure:2534: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2545: $? = 1
configure:2534: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2545: $? = 1
configure:2565: checking whether the C compiler works
configure:2587: gcc    conftest.c  >&5
configure:2591: $? = 0
configure:2639: result: yes
configure:2642: checking for C compiler default output file name
configure:2644: result: a.out
configure:2650: checking for suffix of executables
configure:2657: gcc -o conftest    conftest.c  >&5
configure:2661: $? = 0
configure:2683: result: 
configure:2705: checking whether we are cross compiling
configure:2713: gcc -o conftest    conftest.c  >&5
conftest.c:9:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
compilation terminated.
configure:2717: $? = 1
configure:2724: ./conftest
configure: line 2726: ./conftest: No such file or directory
configure:2728: $? = 127
configure:2735: error: in `/private/var/folders/_r/04lvqnvj5db5462z07vq_6rsb00kgf/T/pip-install-96ba_zea/cysignals':
configure:2737: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
kiwifb commented 4 years ago

Some standard headers weren't found. You are using an (old) gcc from homebrew and obviously it doesn't know where to find the header. I am guessing your homebrew installation is from before upgrading to Catalina.

AckslD commented 4 years ago

@kiwifb Your right, it seems when upgrading to Catalina, the folder /usr/include was removed. I followed this answer and it now worked.

Thanks a lot for your help!