Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android/iOS supported? #315

Open
songww opened this issue Jan 19, 2021 · 4 comments
Open

Android/iOS supported? #315

songww opened this issue Jan 19, 2021 · 4 comments

Comments

@songww
Copy link

songww commented Jan 19, 2021

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
Copy link
Author

songww commented Jan 19, 2021

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

@songww
Copy link
Author

songww commented Jan 19, 2021

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

@simlay
Copy link
Contributor

simlay commented Mar 26, 2023

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

@flutter-painter
Copy link

Any news so far ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants