compile of openvino-rs/crates/openvino-sys fails with: ade/source/execution_engine.cpp:141:21: error: redundant move in return statement
stefson opened this issue · 4 comments
command was:
git clone --recursive https://github.com/intel/openvino-rs.git && cd openvino-rs/crates/openvino-sys
LANG=C RUST_BACKTRACE=full LIBCLANG_PATH=/usr/lib/llvm/10/lib64/ cargo build -vv -j12
my rustc is 1.50.0 on amd64 linux
from the build log:
/tmp/openvino-rs/crates/openvino-sys/upstream/inference-engine/thirdparty/ade/sources/ade/source/execution_engine.cpp: In member function 'std::unique_ptr<ade::Executable> ade::ExecutionEngine::createExecutable(const ade::Graph&)':
/tmp/openvino-rs/crates/openvino-sys/upstream/inference-engine/thirdparty/ade/sources/ade/source/execution_engine.cpp:141:21: error: redundant move in return statement [-Werror=redundant-move]
141 | return std::move(ret);
| ~~~~~~~~~^~~~~
/tmp/openvino-rs/crates/openvino-sys/upstream/inference-engine/thirdparty/ade/sources/ade/source/execution_engine.cpp:141:21: note: remove 'std::move' call
Thanks for the report; I have indeed run into this same issue but it was quite a long time ago and apparently I didn't write down the resolution. I think the issue had something to do with the fact that the compiler used to compile openvino-rs
may not be the same one used by CMake in the build.rs script. Perhaps CMake is selecting GCC there or an older version of Clang?
I found an article: https://www.samontab.com/web/2020/07/minimal-install-of-openvino-2020-4-in-kubuntu-20-04-lts-for-c-inference-on-cpu/
which implies a rather simple solution for the given error. Maybe you can forge it into the source code?
Yes, at one point I did have a commit that fixed up all of those places but I removed it because I did not want to have to repeatedly rebase it on to the OpenVINO tip-of-tree (also, I wasn't sure about any other implications this change might have). So I would prefer to solve it as a "let's document the right tools to use" problem. Can you determine what compiler and compiler version CMake was using?
Also, the preferred build method--linking to pre-built binaries--should also work for you if this is a blocker.
thank you very much for the fix, I must have forgotten in all this tabula rasa :(