Skip to content
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

Problem when running pip install ./my_package following the xtensor cookiecutter procedure: gcc failed because of pystrides_adaptor.hpp (operator[]) #100

Closed
alaisjc opened this issue Aug 7, 2017 · 2 comments

Comments

@alaisjc
Copy link

alaisjc commented Aug 7, 2017

(very first issue on github, be indulgent please :) )
When running
(on Sierra 10.12.6, in a conda env in which I previously installed xtensor 0.10.9 and xtensor-python 0.12.1):
pip install ./my_package_created_thanks_to_the_cool_cookiecutter_github_repository (it is named "dyna"),
the following error is returned:
"
Processing ./dyna
Requirement already satisfied: pybind11>=2.0.1 in ./env/lib/python3.6/site-packages (from dyna==0.0.1)
Requirement already satisfied: numpy in ./env/lib/python3.6/site-packages (from dyna==0.0.1)
Installing collected packages: dyna
Running setup.py install for dyna ... error
Complete output from command /Users/jcalais/Prog/workspace/dyna/env/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T/pip-geq3z0bp-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T/pip-fon09ep0-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
creating var
creating var/folders
creating var/folders/x7
creating var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn
creating var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/jcalais/Prog/workspace/dyna/env/include -arch x86_64 -I/Users/jcalais/Prog/workspace/dyna/env/include -arch x86_64 -I/Users/jcalais/Prog/workspace/dyna/env/include/python3.6m -c /var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T/tmpxc3s13qj.cpp -o var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T/tmpxc3s13qj.o -std=c++14
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/jcalais/Prog/workspace/dyna/env/include -arch x86_64 -I/Users/jcalais/Prog/workspace/dyna/env/include -arch x86_64 -I/Users/jcalais/Prog/workspace/dyna/env/include/python3.6m -c /var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T/tmp3qr7nhob.cpp -o var/folders/x7/h2yj87t94x9gb6nkm0qg1ck40000gn/T/tmp3qr7nhob.o -fvisibility=hidden
building 'dyna' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/jcalais/Prog/workspace/dyna/env/include -arch x86_64 -I/Users/jcalais/Prog/workspace/dyna/env/include -arch x86_64 -I/Users/jcalais/Prog/workspace/dyna/env/include/python3.6m -I/Users/jcalais/.local/include/python3.6m -I/Users/jcalais/Prog/workspace/dyna/env/lib/python3.6/site-packages/numpy/core/include -I/Users/jcalais/Prog/workspace/dyna/env/include -I/Users/jcalais/Prog/workspace/dyna/env/Library/include -I/Users/jcalais/Prog/workspace/dyna/env/include/python3.6m -c src/main.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/main.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.1" -std=c++14 -fvisibility=hidden
In file included from src/main.cpp:3:
In file included from /Users/jcalais/Prog/workspace/dyna/env/include/xtensor/xmath.hpp:20:
In file included from /Users/jcalais/Prog/workspace/dyna/env/include/xtensor/xoperation.hpp:18:
/Users/jcalais/Prog/workspace/dyna/env/include/xtensor/xstrides.hpp:88:26: error: no viable overloaded operator[] for type 'const const xt::pystrides_iterator<8>'
return arg * strides[dim] + raw_data_offset<size_type, S, dim + 1>(strides, args...);
^~~~~~~ ~~~
/Users/jcalais/Prog/workspace/dyna/env/include/xtensor/xstrides.hpp:116:28: note: in instantiation of function template specialization 'xt::detail::raw_data_offset<unsigned long, const xt::pystrides_iterator<8>, 0, unsigned long>' requested here
return detail::raw_data_offset<size_type, const typename S::const_iterator, dim, Arg, Args...>(view, arg, args...);
^
/Users/jcalais/Prog/workspace/dyna/env/include/xtensor/xcontainer.hpp:377:27: note: in instantiation of function template specialization 'xt::data_offset<unsigned long, xt::pystrides_adaptor<8>, 0, unsigned long>' requested here
size_type index = data_offset<size_type>(strides(), static_cast<size_type>(args)...);
^
src/main.cpp:20:13: note: in instantiation of function template specialization 'xt::xcontainer<xt::pyarray >::operator()' requested here
return m(0);
^_

_ **/Users/jcalais/Prog/workspace/dyna/env/include/xtensor-python/pystrides_adaptor.hpp:83:26: note: candidate function not viable: 'this' argument has type 'const const xt::pystrides_iterator<8>', but method is not marked const

        inline reference operator[] (difference_type n) { return *(p_current + n) / N; }
                         ^
1 error generated.
error: command 'gcc' failed with exit status 1**

"

@SylvainCorlay
Copy link
Member

@alaisjc sorry for the late reply. This fell between the cracks. This has been solved since you posted the issue. It was broken for a few days as we released xtensor 0.10.9.

@SylvainCorlay
Copy link
Member

FYI, the issue was fixed in #101.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants