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

build error #154

Open
zshy1205 opened this issue Jan 8, 2021 · 2 comments
Open

build error #154

zshy1205 opened this issue Jan 8, 2021 · 2 comments

Comments

@zshy1205
Copy link

zshy1205 commented Jan 8, 2021

I use "pip install sru[cuda]" to install the sru, but when I import SRU, This error is occured。
Please help me , thanks.

import sru
/opt/conda/lib/python3.7/site-packages/torch/utils/cpp_extension.py:252: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) is not compatible with the compiler Pytorch was
built with for this platform, which is g++ on linux. Please
use g++ to to compile your extension. Alternatively, you may
compile PyTorch from source using c++, and then you can also use
c++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

platform=sys.platform))
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1515, in _run_ninja_build
env=env)
File "/opt/conda/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/opt/conda/lib/python3.7/site-packages/sru/init.py", line 8, in
from sru.modules import SRU, SRUCell # noqa: F401
File "/opt/conda/lib/python3.7/site-packages/sru/modules.py", line 11, in
from sru.ops import (elementwise_recurrence_cpu,
File "/opt/conda/lib/python3.7/site-packages/sru/ops.py", line 17, in
verbose=False
File "/opt/conda/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 974, in load
keep_intermediates=keep_intermediates)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1179, in _jit_compile
with_cuda=with_cuda)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1279, in _write_ninja_file_and_build_library
error_prefix="Error building extension '{}'".format(name))
File "/opt/conda/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error building extension 'sru_cpu': [1/2] c++ -MMD -MF sru_cpu_impl.o.d -DTORCH_EXTENSION_NAME=sru_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /opt/conda/lib/python3.7/site-packages/torch/include -isystem /opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /opt/conda/lib/python3.7/site-packages/torch/include/TH -isystem /opt/conda/lib/python3.7/site-packages/torch/include/THC -isystem /opt/conda/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -O3 -c /opt/conda/lib/python3.7/site-packages/sru/csrc/sru_cpu_impl.cpp -o sru_cpu_impl.o
FAILED: sru_cpu_impl.o
c++ -MMD -MF sru_cpu_impl.o.d -DTORCH_EXTENSION_NAME=sru_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /opt/conda/lib/python3.7/site-packages/torch/include -isystem /opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /opt/conda/lib/python3.7/site-packages/torch/include/TH -isystem /opt/conda/lib/python3.7/site-packages/torch/include/THC -isystem /opt/conda/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -O3 -c /opt/conda/lib/python3.7/site-packages/sru/csrc/sru_cpu_impl.cpp -o sru_cpu_impl.o
c++: error: unrecognized command line option ‘-std=c++14’
ninja: build stopped: subcommand failed.

@xianyu-123
Copy link

i have same issue, did you have solved it?

@venkateshsathya
Copy link

venkateshsathya commented Nov 7, 2021 via email

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

3 participants