Skip to content

rl_sim包catkin build编译时find_package找不到一系列功能包 #1

@Wwwwjunjie

Description

@Wwwwjunjie

rl_sim包中的CMakeLists出现问题,find_package所有包都找不到,换catkin_make出现以下报错

home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h: In member function ‘virtual std::shared_ptr<torch::jit::SugaredValue> torch::jit::TensorCastValue::call(const torch::jit::SourceRange&, torch::jit::GraphFunction&, c10::ArrayRef<torch::jit::NamedValue>, c10::ArrayRef<torch::jit::NamedValue>, size_t)’: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:555:60: error: cannot convert ‘const torch::jit::SourceRange’ to ‘int’ 555 | Value* dtype_const = m.graph()->insertConstant(dtype_, loc); | ^~~ | | | const torch::jit::SourceRange In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/function_impl.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/method.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/object.h:6, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/module.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/import.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:9, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/ir/ir.h:1371:7: note: initializing argument 2 of ‘torch::jit::Value* torch::jit::Graph::insertConstant(const c10::IValue&, int)’ 1371 | std::optional<SourceRange> loc = c10::nullopt, | ^~~~~~~~~~~~~ In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/resolver.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/script_type_parser.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/unpickler.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/pickle.h:8, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:10, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:562:19: error: cannot convert ‘const torch::jit::SourceRange’ to ‘int’ 562 | /*range=*/loc); | ^~~ | | | const torch::jit::SourceRange In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/function_impl.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/method.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/object.h:6, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/module.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/import.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:9, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/ir/ir.h:1385:7: note: initializing argument 4 of ‘torch::jit::Value* torch::jit::Graph::insert(c10::Symbol, c10::ArrayRef<torch::jit::NamedValue>, c10::ArrayRef<torch::jit::NamedValue>, int)’ 1385 | const std::optional<SourceRange>& range = {}); | ^~~~~~~~~~~~~~~~~~~ In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/resolver.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/script_type_parser.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/unpickler.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/pickle.h:8, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:10, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h: At global scope: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:641:12: error: ‘std::optional’ has not been declared 641 | std::optional<int64_t> static_len = c10::nullopt); | ^~~~~~~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:641:20: error: expected ‘,’ or ‘...’ before ‘<’ token 641 | std::optional<int64_t> static_len = c10::nullopt); | ^ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:657:8: error: ‘optional’ in namespace ‘std’ does not name a template type 657 | std::optional<int64_t> staticLen() override { | ^~~~~~~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:657:3: note: ‘std::optional’ is only available from C++17 onwards 657 | std::optional<int64_t> staticLen() override { | ^~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:670:8: error: ‘optional’ in namespace ‘std’ does not name a template type 670 | std::optional<int64_t> static_len_; | ^~~~~~~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:670:3: note: ‘std::optional’ is only available from C++17 onwards 670 | std::optional<int64_t> static_len_; | ^~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:715:8: error: ‘optional’ in namespace ‘std’ does not name a template type 715 | std::optional<int64_t> staticLen() override { | ^~~~~~~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:715:3: note: ‘std::optional’ is only available from C++17 onwards 715 | std::optional<int64_t> staticLen() override { | ^~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:733:8: error: ‘optional’ in namespace ‘std’ does not name a template type 733 | std::optional<int64_t> unroll_length_ = c10::nullopt; | ^~~~~~~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:733:3: note: ‘std::optional’ is only available from C++17 onwards 733 | std::optional<int64_t> unroll_length_ = c10::nullopt; | ^~~ /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h: In member function ‘virtual std::shared_ptr<torch::jit::SugaredValue> torch::jit::SimpleSelf::makeSugared(torch::jit::Value*) const’: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:747:16: error: cannot convert ‘const ClassTypePtr’ {aka ‘const std::shared_ptr<c10::ClassType>’} to ‘c10::TypePtr’ {aka ‘c10::Type::SingletonOrSharedTypePtr<c10::Type>’} 747 | v->setType(classType_); | ^~~~~~~~~~ | | | const ClassTypePtr {aka const std::shared_ptr<c10::ClassType>} In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/function_impl.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/method.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/object.h:6, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/module.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/import.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:9, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/ir/ir.h:1504:38: note: initializing argument 1 of ‘torch::jit::Value* torch::jit::Value::setType(c10::TypePtr)’ 1504 | inline Value* Value::setType(TypePtr type) { | ~~~~~~~~^~~~ In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/resolver.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/script_type_parser.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/unpickler.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/pickle.h:8, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:10, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h: In member function ‘virtual std::shared_ptr<torch::jit::SugaredValue> torch::jit::ExceptionValue::call(const torch::jit::SourceRange&, torch::jit::GraphFunction&, c10::ArrayRef<torch::jit::NamedValue>, c10::ArrayRef<torch::jit::NamedValue>, size_t)’: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:797:74: error: cannot convert ‘const torch::jit::SourceRange’ to ‘int’ 797 | auto exception_message = insertConstant(*m.graph(), message_ + ": ", loc); | ^~~ | | | const torch::jit::SourceRange In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/ir/named_value.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/ir/ir.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/function_impl.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/method.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/object.h:6, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/api/module.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/import.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:9, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/ir/constants.h:28:5: note: initializing argument 3 of ‘torch::jit::Value* torch::jit::insertConstant(torch::jit::Graph&, const c10::IValue&, int)’ 28 | std::optional<SourceRange> loc = c10::nullopt, | ^~~~~~~~~~~~~ In file included from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/resolver.h:5, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/script_type_parser.h:4, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/unpickler.h:7, from /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/serialization/pickle.h:8, from /home/ros/tmp/libtorch/libtorch/include/torch/script.h:10, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.hpp:4, from /home/ros/tmp/wiki-grx-gazebo/src/rl_sim/library/rl_sdk/rl_sdk.cpp:1: /home/ros/tmp/libtorch/libtorch/include/torch/csrc/jit/frontend/sugared_value.h:800:43: error: no match for ‘operator*’ (operand type is ‘c10::StringTypePtr’ {aka ‘c10::SingletonTypePtr<c10::StringType>’}) 800 | if (!input_str->type()->isSubtypeOf(*StringType::get())) { | ^~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions