Build from source fails #79
Description
Describe the bug:
$ cmake --build build
[ 12%] Building CXX object src/cc/torchdistx/CMakeFiles/torchdistx.dir/deferred_init.cc.o
In file included from /usr/include/c++/11/memory:76,
from /home/ubuntu/.local/lib/python3.8/site-packages/torch/include/c10/util/C++17.h:8,
from /home/ubuntu/.local/lib/python3.8/site-packages/torch/include/c10/util/string_view.h:4,
from /home/ubuntu/.local/lib/python3.8/site-packages/torch/include/c10/util/StringUtil.h:6,
from /home/ubuntu/.local/lib/python3.8/site-packages/torch/include/c10/util/Exception.h:5,
from /home/ubuntu/.local/lib/python3.8/site-packages/torch/include/c10/core/DispatchKeySet.h:3,
from /home/ubuntu/.local/lib/python3.8/site-packages/torch/include/c10/core/impl/LocalDispatchKeySet.h:3,
from /home/ubuntu/torchdistx/src/cc/torchdistx/deferred_init.h:10,
from /home/ubuntu/torchdistx/src/cc/torchdistx/deferred_init.cc:7:
/usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = torchdistx::detail::{anonymous}::ProxyVariableHooks; _Args = {at::impl::VariableHooksInterface*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptrtorchdistx::detail::{anonymous}::ProxyVariableHooks]’:
/home/ubuntu/torchdistx/src/cc/torchdistx/deferred_init.cc:1098:50: required from here
/usr/include/c++/11/bits/unique_ptr.h:962:30: error: invalid new-expression of abstract class type ‘torchdistx::detail::{anonymous}::ProxyVariableHooks’
962 | { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/torchdistx/src/cc/torchdistx/deferred_init.cc:956:7: note: because the following virtual functions are pure within ‘torchdistx::detail::{anonymous}::ProxyVariableHooks’:
956 | class ProxyVariableHooks : public VariableHooksInterface {
| ^~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/torchdistx/src/cc/torchdistx/deferred_init.cc:21:
/home/ubuntu/.local/lib/python3.8/site-packages/torch/include/ATen/core/VariableHooksInterface.h:62:16: note: ‘virtual void at::impl::VariableHooksInterface::basic_autograd_not_implemented_fallback(const c10::OperatorHandle&, c10::DispatchKeySet, torch::jit::Stack*) const’
62 | virtual void basic_autograd_not_implemented_fallback(const c10::OperatorHandle& op, c10::DispatchKeySet dispatch_keys, torch::jit::Stack* stack) const = 0;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/cc/torchdistx/CMakeFiles/torchdistx.dir/build.make:76: src/cc/torchdistx/CMakeFiles/torchdistx.dir/deferred_init.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:888: src/cc/torchdistx/CMakeFiles/torchdistx.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Describe how to reproduce:
Build against PyTorch with CUDA 11.8
pip install --upgrade -r requirements.txt -r use-cu118.txt
cmake -DTORCHDIST_INSTALL_STANDALONE=ON -B build
cmake --build build
Describe the expected behavior:
Clean build
Environment:
- OS: Ubuntu-20.4
- CMake: 3.27
- gcc/g++: 11.4 (both)
Additional context:
Add any other context about the problem here.