New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors building Cython extensions on Python 3.5 #1029

Closed
arokem opened this Issue Apr 14, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@arokem
Member

arokem commented Apr 14, 2016

On my Mac, with Anaconda Python, Cython 0.24:

chlosyne:dipy (master) $python setup.py build_ext --inplace -f
running build_ext
gcc -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/arokem/anaconda/include -arch x86_64 -I/Users/arokem/anaconda/include/python3.5m -c test.c -o test.o /arch:SSE2
clang: error: no such file or directory: '/arch:SSE2'
Flags ['/arch:SSE2'] omitted because of compile or link error
gcc -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/arokem/anaconda/include -arch x86_64 -I/Users/arokem/anaconda/include/python3.5m -c test.c -o test.o -msse2 -mfpmath=sse
gcc -bundle -undefined dynamic_lookup -L/Users/arokem/anaconda/lib -arch x86_64 test.o -L/Users/arokem/anaconda/lib -o libtestlib.so
gcc -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/arokem/anaconda/include -arch x86_64 -I/Users/arokem/anaconda/include/python3.5m -c test.c -o test.o -fopenmp
clang: error: unsupported option '-fopenmp'
Flags ['-fopenmp', '-fopenmp'] omitted because of compile or link error
cythoning dipy/reconst/peak_direction_getter.pyx to dipy/reconst/peak_direction_getter.c
warning: dipy/reconst/peak_direction_getter.pyx:57:4: Overriding cdef method with def method.
Traceback (most recent call last):
  File "setup.py", line 244, in <module>
    main(**extra_setuptools_args)
  File "setup.py", line 237, in main
    **extra_args
  File "/Users/arokem/anaconda/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Users/arokem/anaconda/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Users/arokem/anaconda/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Distutils/build_ext.py", line 164, in run
    _build_ext.build_ext.run(self)
  File "/Users/arokem/anaconda/lib/python3.5/distutils/command/build_ext.py", line 338, in run
    self.build_extensions()
  File "/Users/arokem/source/dipy/setup_helpers.py", line 194, in build_extensions
    build_ext_class.build_extensions(self)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Distutils/build_ext.py", line 171, in build_extensions
    ext.sources = self.cython_sources(ext.sources, ext)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Distutils/build_ext.py", line 324, in cython_sources
    full_module_name=module_name)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 682, in compile
    return compile_single(source, options, full_module_name)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 635, in compile_single
    return run_pipeline(source, options, full_module_name)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 492, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Compiler/Pipeline.py", line 365, in run_pipeline
    data = phase(data)
  File "/Users/arokem/anaconda/lib/python3.5/site-packages/Cython/Compiler/Pipeline.py", line 130, in inject_utility_code_stage
    tree = utilcode.get_tree(cython_scope=context.cython_scope)
TypeError: get_tree() takes no keyword arguments

@arokem

This comment has been minimized.

Member

arokem commented Apr 14, 2016

For the record, that is the most recent version of Cython.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Apr 14, 2016

Okay good to know.

@arokem

This comment has been minimized.

Member

arokem commented Apr 14, 2016

Any ideas what this could mean, or how I would go about debugging this? Is there some way to drop into the debugger while running setup.py?

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Apr 14, 2016

I don't get this with the current Cython on pypi.

python -m pip install -U pip
pip install numpy scipy nibabel cython
python setup.py build_ext --inplace -f

is running OK on my OSX laptop and a desktop Linux machine. Could something have gone wrong with your Cython install?

It looks like you would get the error by running cython directly on the file - does that work?

@arokem

This comment has been minimized.

Member

arokem commented Apr 14, 2016

Yeah, seems something is borked with my Cython. I get this when running cython on even a trivially simple example. Seems unrelated to Dipy, so I am closing this.

@arokem arokem closed this Apr 14, 2016

@arokem

This comment has been minimized.

Member

arokem commented Apr 14, 2016

Addendum, in case anyone else runs into this:

conda uninstall cython
pip install cython

Seemed to do the trick for me. Might have crossed my wires there before...

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Apr 14, 2016

Is conda's Cython broken? Worth a bug report to Continuum?

@arokem

This comment has been minimized.

Member

arokem commented Apr 14, 2016

No -- my own individual wires were apparently crossed (which is what happens, when you're me...). Following all this with a:

pip uninstall
conda install cython

And everything still works. Frankly, I have no idea how I got into this pickle to begin with...

@ruohoruotsi

This comment has been minimized.

ruohoruotsi commented Jul 23, 2017

pip uninstall cython
conda install cython

is what worked for me on MacOS Yosemite, conda 4.1.6, python 3.1.5, pip 9.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment