您好,
方便提供一下ubuntu16.04的make教程吗?我的报错了。
-- Caffe2: CUDA detected: 10.1
-- Caffe2: CUDA nvcc is: /usr/local/cuda-10.1/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-10.1
-- Caffe2: Header version is: 10.1
-- Found cuDNN: v7.6.4 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
CMake Warning (dev) at /usr/local/share/cmake-3.16/Modules/UseSWIG.cmake:607 (message):
Policy CMP0078 is not set: UseSWIG generates standard target names. Run
"cmake --help-policy CMP0078" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:31 (swig_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/share/cmake-3.16/Modules/UseSWIG.cmake:460 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/local/share/cmake-3.16/Modules/UseSWIG.cmake:702 (SWIG_ADD_SOURCE_TO_MODULE)
CMakeLists.txt:31 (swig_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/snail/Desktop/alpha-zero-gomoku-master/build
[ 16%] Built target library_swig_compilation
[ 33%] Building CXX object CMakeFiles/_library.dir/src/libtorch.cpp.o
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp: In constructor ‘NeuralNetwork::NeuralNetwork(std::__cxx11::string, bool, unsigned int)’:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: error: no matching function for call to ‘std::shared_ptrtorch::jit::script::Module::shared_ptr(torch::jit::script::Module)’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:327:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Tp>&, std::nothrow_t) [with _Tp = torch::jit::script::Module]
shared_ptr(const weak_ptr<_Tp>& __r, std::nothrow_t)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:327:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/6/bits/shared_ptr.h:317:2: note: candidate: template<class _Alloc, class ... _Args> std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...)
shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:317:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: candidate expects at least 2 arguments, 1 provided
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:269:17: note: candidate: constexpr std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t) [with _Tp = torch::jit::script::Module; std::nullptr_t = std::nullptr_t]
constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:269:17: note: no known conversion for argument 1 from ‘torch::jit::script::Module’ to ‘std::nullptr_t’
/usr/include/c++/6/bits/shared_ptr.h:262:2: note: candidate: template<class _Tp1, class _Del, class> std::shared_ptr<_Tp>::shared_ptr(std::unique_ptr<_Up, _Ep>&&)
shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:262:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: ‘torch::jit::script::Module’ is not derived from ‘std::unique_ptr<_Tp, _Dp>’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:255:2: note: candidate: template std::shared_ptr<_Tp>::shared_ptr(std::auto_ptr<_Up>&&)
shared_ptr(std::auto_ptr<_Tp1>&& __r);
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:255:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: ‘torch::jit::script::Module’ is not derived from ‘std::auto_ptr<_Up>’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:250:11: note: candidate: template std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Tp1>&)
explicit shared_ptr(const weak_ptr<_Tp1>& __r)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:250:11: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: ‘torch::jit::script::Module’ is not derived from ‘const std::weak_ptr<_Tp>’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:238:2: note: candidate: template<class _Tp1, class> std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp1>&&)
shared_ptr(shared_ptr<_Tp1>&& __r) noexcept
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:238:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: ‘torch::jit::script::Module’ is not derived from ‘std::shared_ptr<_Tp1>’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:229:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = torch::jit::script::Module]
shared_ptr(shared_ptr&& __r) noexcept
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:229:7: note: no known conversion for argument 1 from ‘torch::jit::script::Module’ to ‘std::shared_ptrtorch::jit::script::Module&&’
/usr/include/c++/6/bits/shared_ptr.h:221:2: note: candidate: template<class _Tp1, class> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp1>&)
shared_ptr(const shared_ptr<_Tp1>& __r) noexcept
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:221:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: ‘torch::jit::script::Module’ is not derived from ‘const std::shared_ptr<_Tp1>’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:210:2: note: candidate: template std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp1>&, _Tp*)
shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p) noexcept
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:210:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: ‘torch::jit::script::Module’ is not derived from ‘const std::shared_ptr<_Tp1>’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:188:2: note: candidate: template<class _Deleter, class _Alloc> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter, _Alloc)
shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:188:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: candidate expects 3 arguments, 1 provided
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:169:2: note: candidate: template<class _Tp1, class _Deleter, class _Alloc> std::shared_ptr<_Tp>::shared_ptr(_Tp1*, _Deleter, _Alloc)
shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:169:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: mismatched types ‘_Tp1*’ and ‘torch::jit::script::Module’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:150:2: note: candidate: template std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter)
shared_ptr(nullptr_t __p, _Deleter __d)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:150:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: candidate expects 2 arguments, 1 provided
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:133:2: note: candidate: template<class _Tp1, class _Deleter> std::shared_ptr<_Tp>::shared_ptr(_Tp1*, _Deleter)
shared_ptr(_Tp1* __p, _Deleter __d)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:133:2: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: mismatched types ‘_Tp1*’ and ‘torch::jit::script::Module’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:116:11: note: candidate: template std::shared_ptr<_Tp>::shared_ptr(_Tp1*)
explicit shared_ptr(_Tp1* __p)
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:116:11: note: template argument deduction/substitution failed:
/home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:15:19: note: mismatched types ‘_Tp1*’ and ‘torch::jit::script::Module’
loop(nullptr) {
^
In file included from /usr/include/c++/6/memory:82:0,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/c10/core/Allocator.h:4,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/ATen/ATen.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/libtorch/include/torch/script.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/./src/libtorch.h:3,
from /home/snail/Desktop/alpha-zero-gomoku-master/src/libtorch.cpp:1:
/usr/include/c++/6/bits/shared_ptr.h:107:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp>&) [with _Tp = torch::jit::script::Module]
shared_ptr(const shared_ptr&) noexcept = default;
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:107:7: note: no known conversion for argument 1 from ‘torch::jit::script::Module’ to ‘const std::shared_ptrtorch::jit::script::Module&’
/usr/include/c++/6/bits/shared_ptr.h:104:17: note: candidate: constexpr std::shared_ptr<_Tp>::shared_ptr() [with _Tp = torch::jit::script::Module]
constexpr shared_ptr() noexcept
^~~~~~~~~~
/usr/include/c++/6/bits/shared_ptr.h:104:17: note: candidate expects 0 arguments, 1 provided
CMakeFiles/_library.dir/build.make:88: recipe for target 'CMakeFiles/_library.dir/src/libtorch.cpp.o' failed
make[2]: *** [CMakeFiles/_library.dir/src/libtorch.cpp.o] Error 1
CMakeFiles/Makefile2:76: recipe for target 'CMakeFiles/_library.dir/all' failed
make[1]: *** [CMakeFiles/_library.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2