Trying to use the nightly version completely fails for me. I’m not sure if I should open another topic for this, maybe I made a mistake somewhere. For reference here is exactly what I tried:
I get a very lengthy error message running python setup.py install
: command ‘gcc’ failed with exit status 1.
The whole output is 23169 lines long, so I can hardly post it here. It starts with
which: no nvcc in ($PATH)
which is confusing to me since I installed the cpu optimized version (no CUDA on my platform). After this it looks normal
running install
running bdist_egg
running egg_info
writing diff_cpp.egg-info/PKG-INFO
writing dependency_links to diff_cpp.egg-info/dependency_links.txt
writing top-level names to diff_cpp.egg-info/top_level.txt
reading manifest file 'diff_cpp.egg-info/SOURCES.txt'
writing manifest file 'diff_cpp.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'diff_cpp' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include -I/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/TH -I/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/THC -I/home/mtgd/cpp-test/env/include -I/usr/include/python3.7m -c diff.cpp -o build/temp.linux-x86_64-3.7/diff.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=diff_cpp -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
Then comes the error output
In file included from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/TensorMethods.h:10,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:12,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/torch/extension.h:4,
from diff.cpp:1:
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h: In instantiation of ‘Return c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = void; Args = {const at::Tensor&, const at::Tensor&, bool, bool}]’:
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:201:114: required from ‘Return c10::Dispatcher::callUnboxedOnly(const c10::OperatorHandle&, Args ...) const [with Return = void; Args = {const at::Tensor&, const at::Tensor&, bool, bool}]’
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/TensorMethods.h:66:75: required from here
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘const at::Tensor& args#0’
211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘const at::Tensor& args#0’ previously declared here
209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘const at::Tensor& args#1’
211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘const at::Tensor& args#1’ previously declared here
209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘bool& args#2’
211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘bool& args#2’ previously declared here
209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘bool& args#3’
211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘bool& args#3’ previously declared here
209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);
| ^~~~
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:208:38: error: member ‘c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = void; Args = {const at::Tensor&, const at::Tensor&, bool, bool}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>::<args#0 capture>’ is uninitialized reference
208 | return backendFallbackKernels.read([&] (const ska::flat_hash_map<TensorTypeId, KernelFunction>& backendFallbackKernels) -> Return {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210 | const KernelFunction& kernel = dispatch_(dispatchTable, backendFallbackKernels, dispatchKey);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212 | });
| ~
It goes on like this for quite a stretch, the last line is
/home/mtgd/cpp-test/env/lib/python3.7/site-packages/torch/include/c10/util/LeftRight.h:67:10: error: ‘typename std::result_of<F(const T&)>::type c10::LeftRight<T>::read(F&&) const [with F = c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor; Args = {const at::Tensor&, c10::ArrayRef<long int>, c10::ArrayRef<long int>, c10::ArrayRef<long int>, c10::ArrayRef<long int>}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>; T = ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>; typename std::result_of<F(const T&)>::type = at::Tensor]’, declared using local type ‘c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor; Args = {const at::Tensor&, c10::ArrayRef<long int>, c10::ArrayRef<long int>, c10::ArrayRef<long int>, c10::ArrayRef<long int>}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>’, is used but never defined [-fpermissive]
I’m not sure where to move from here. It doesn’t seem to matter what the content of the extension is. I get the same error even if the source script is completely empty (except for the include).
In case the full error message would be useful, please let me know.
Thanks for your time!