tch-rs icon indicating copy to clipboard operation
tch-rs copied to clipboard

Android/iOS supported?

Open songww opened this issue 4 years ago • 4 comments

Failed to build for iOS:

warning: clang: warning: -Wl,-rpath=/Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/lib: 'linker' input unused [-Wunused-command-line-argument]
warning: In file included from libtch/torch_api.cpp:1:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/autograd/engine.h:6:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/ATen/Tensor.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/ATen/core/TensorBody.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/c10/core/Device.h:5:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/c10/util/Exception.h:5:
warning: /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/c10/util/StringUtil.h:77:5: error: thread-local storage is not supported for the current target
warning:     thread_local const std::string empty_string_literal;
warning:     ^
warning: /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/c10/util/StringUtil.h:78:12: warning: reference to stack memory associated with local variable 'empty_string_literal' returned [-Wreturn-stack-address]
warning:     return empty_string_literal;
warning:            ^~~~~~~~~~~~~~~~~~~~
warning: In file included from libtch/torch_api.cpp:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/torch.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/all.h:8:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/data.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/data/dataloader.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/data/dataloader/base.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/data/dataloader_options.h:4:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/types.h:7:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/autograd/generated/variable_factories.h:12:
warning: /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/jit/frontend/tracer.h:140:10: error: thread-local storage is not supported for the current target
warning:   static thread_local ArgumentStash stash;
warning:          ^
warning: In file included from libtch/torch_api.cpp:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/torch.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/all.h:12:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/nn.h:3:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/nn/cloneable.h:5:
warning: In file included from /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/torch/csrc/api/include/torch/utils.h:3:
warning: /Users/songmowei/Workspace/src/gitlab.weilaicheng.com/pytorch/build_ios/install/include/ATen/Parallel.h:41:3: error: thread-local storage is not supported for the current target
warning:   thread_local bool init = false;
warning:   ^
warning: In file included from libtch/torch_api.cpp:8:
warning: libtch/torch_api.h:6:1: error: thread-local storage is not supported for the current target
warning: thread_local char *torch_last_err = nullptr;
warning: ^
warning: 1 warning and 4 errors generated.

error: failed to run custom build command for `torch-sys v0.3.1`

songww avatar Jan 19 '21 06:01 songww

For iOS, should add flag -miphoneos-version-min=9.0 to cc.

songww avatar Jan 19 '21 08:01 songww

Many srcs not compiled for mobile default. Perhaps we should add some feature gates to works for mobile?

songww avatar Jan 19 '21 13:01 songww

To fix this thread_local issue, specify a IPHONEOS_DEPLOYMENT_TARGET of something 9.0 or later. It defaults to 7.0.

simlay avatar Mar 26 '23 19:03 simlay

Any news so far ?

flutter-painter avatar Oct 27 '23 21:10 flutter-painter