sru icon indicating copy to clipboard operation
sru copied to clipboard

build error

Open zshy1205 opened this issue 4 years ago • 2 comments

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.

zshy1205 avatar Jan 08 '21 09:01 zshy1205

i have same issue, did you have solved it?

xianyu-123 avatar Nov 06 '21 14:11 xianyu-123

Hi Xianyu,

Nope. I did not.

Regards Venkatesh

On Sat, Nov 6, 2021 at 7:16 AM xianyu-123 @.***> wrote:

i have same issue, did you have solved it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/asappresearch/sru/issues/154#issuecomment-962458204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM45YZVOTCTCZBMHKNEHK73UKU2FJANCNFSM4V2FYEUQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

venkateshsathya avatar Nov 07 '21 18:11 venkateshsathya