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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LibTorch-Lite] Add a custom flag to build LibTorch-Lite with LAPACK included #68871

Open
anhappdev opened this issue Nov 24, 2021 · 5 comments
Labels
enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: ios Related to iOS support - build, API, Continuous Integration, document oncall: mobile Related to mobile support, including iOS and Android

Comments

@anhappdev
Copy link

馃殌 Feature

Add a custom flag to build LibTorch-Lite with LAPACK to ./scripts/build_ios.sh (and ./scripts/build_android.sh).

Motivation

There are many issues caused by error

RuntimeError: <some_function>: LAPACK library not found in compilation

when trying running TorchScript on mobile devices.
Since LibTorch-Lite from Cocoapods does not include LAPACK, the only option is to build it from source.

Pitch

We can build LibTorch-Lite from source with LAPACK included by setting the environment variable USE_LAPACK=1

Alternatives

Include LAPACK into LibTorch-Lite from Cocoapods

Additional context

I tried to build LibTorch-Lite for iOS from source with LAPACK included.
Some answers found on the internet suggest adding CMAKE_ARGS+=("-DUSE_LAPACK=ON") to the build script.

But it did not work in my case because in the file Dependencies.cmake#L1580 USE_LAPACK is first disabled with set(USE_LAPACK 0) then later in Dependencies.cmake#L1771 enabled if LAPACK_FOUND is true. And somehow it could not find LAPACK on my Mac.

My workaround for now is just comment out that line #set(USE_LAPACK 0) then the build run successfully with LAPACK included (no error when running on iOS).

Some related issues are:

@ejguan ejguan added the oncall: mobile Related to mobile support, including iOS and Android label Nov 24, 2021
@xta0 xta0 added the module: ios Related to iOS support - build, API, Continuous Integration, document label Nov 29, 2021
@xta0
Copy link
Contributor

xta0 commented Nov 29, 2021

@anhappdev Thanks for opening this issue. We'll consider including LAPACK support in our libraries. Thanks for all the detailed context!

@xta0 xta0 added the enhancement Not as big of a feature, but technically not a bug. Should be easy to fix label Nov 29, 2021
@Gaozhongpai
Copy link

Gaozhongpai commented Jun 8, 2022

@anhappdev I tried to build LibTorch-Lite with LAPACK on iOS. I added CMAKE_ARGS+=("-DUSE_LAPACK=ON") to the build script and commented out that line # set(USE_LAPACK 0) in Dependencies.cmake#L1580. I can build it successfully. However, when I run on XCode, it still shows:

2022-06-08 09:32:31.275342-0400 ObjectDetection[16020:2681999] svd: LAPACK library not found in compilation.

My code is as follows:

#include <torch/script.h>
#include <ATen/Functions.h>

at::Tensor tensor_test = torch::ones({3,3});
auto result_test = at::svd(tensor_test);

Log:

MacBook-Pro pytorch-1.11 % BUILD_PYTORCH_MOBILE=1 IOS_PLATFORM=SIMULATOR ./scripts/build_ios.sh

+++ dirname ./scripts/build_ios.sh
++ cd ./scripts/..
++ pwd -P

  • CAFFE2_ROOT=/Users/pi/program/pytorch-1.11
  • CMAKE_ARGS=()
  • '[' -z '' ']'
  • CMAKE_ARGS+=("-DCMAKE_PREFIX_PATH=$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')")
    ++ python -c 'import sysconfig; print(sysconfig.get_path("purelib"))'
  • CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=$(python -c 'import sys; print(sys.executable)')")
    ++ python -c 'import sys; print(sys.executable)'
  • CMAKE_ARGS+=("-DBUILD_CUSTOM_PROTOBUF=OFF")
  • '[' -n '' ']'
  • '[' '' == 1 ']'
  • CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=$CAFFE2_ROOT/cmake/iOS.cmake")
  • '[' -n ']'
  • CCACHE_WRAPPER_PATH=/usr/local/opt/ccache/libexec
  • '[' -d /usr/local/opt/ccache/libexec ']'
  • '[' -n SIMULATOR ']'
  • CMAKE_ARGS+=("-DIOS_PLATFORM=${IOS_PLATFORM}")
  • '[' SIMULATOR == WATCHOS ']'
  • '[' -n '' ']'
  • '[' '' == 0 ']'
  • CMAKE_ARGS+=("-DBUILD_LITE_INTERPRETER=ON")
  • '[' '' == 1 ']'
  • CMAKE_ARGS+=("-DTRACING_BASED=OFF")
  • '[' '' == 1 ']'
  • CMAKE_ARGS+=("-DUSE_LIGHTWEIGHT_DISPATCH=OFF")
    + CMAKE_ARGS+=("-DUSE_LAPACK=ON")
  • CMAKE_ARGS+=("-DUSE_LITE_INTERPRETER_PROFILER=OFF")
  • CMAKE_ARGS+=("-DBUILD_TEST=OFF")
  • CMAKE_ARGS+=("-DBUILD_BINARY=OFF")
  • CMAKE_ARGS+=("-DBUILD_PYTHON=OFF")
  • CMAKE_ARGS+=("-DUSE_CUDA=OFF")
  • CMAKE_ARGS+=("-DUSE_GFLAGS=OFF")
  • CMAKE_ARGS+=("-DUSE_OPENCV=OFF")
  • CMAKE_ARGS+=("-DUSE_LMDB=OFF")
  • CMAKE_ARGS+=("-DUSE_LEVELDB=OFF")
  • CMAKE_ARGS+=("-DUSE_MPI=OFF")
  • CMAKE_ARGS+=("-DUSE_NUMPY=OFF")
  • CMAKE_ARGS+=("-DUSE_NNPACK=OFF")
  • CMAKE_ARGS+=("-DUSE_MKLDNN=OFF")
  • '[' '' == 1 ']'
  • '[' '' == 1 ']'
  • CMAKE_ARGS+=("-DCMAKE_THREAD_LIBS_INIT=-lpthread")
  • CMAKE_ARGS+=("-DCMAKE_HAVE_THREADS_LIBRARY=1")
  • CMAKE_ARGS+=("-DCMAKE_USE_PTHREADS_INIT=1")
  • '[' '' == 1 ']'
  • CMAKE_ARGS+=("-DCMAKE_CXX_FLAGS=-fobjc-arc")
  • BUILD_ROOT=/Users/pi/program/pytorch-1.11/build_ios
  • INSTALL_PREFIX=/Users/pi/program/pytorch-1.11/build_ios/install
  • mkdir -p /Users/pi/program/pytorch-1.11/build_ios
  • cd /Users/pi/program/pytorch-1.11/build_ios
  • cmake /Users/pi/program/pytorch-1.11 -DCMAKE_INSTALL_PREFIX=/Users/pi/program/pytorch-1.11/build_ios/install -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=OFF -DBLA_VENDOR=Generic -DCMAKE_PREFIX_PATH=/Users/pi/miniconda3/lib/python3.9/site-packages -DPYTHON_EXECUTABLE=/Users/pi/miniconda3/bin/python -DBUILD_CUSTOM_PROTOBUF=OFF -DCMAKE_TOOLCHAIN_FILE=/Users/pi/program/pytorch-1.11/cmake/iOS.cmake -DIOS_PLATFORM=SIMULATOR -DBUILD_LITE_INTERPRETER=ON -DTRACING_BASED=OFF -DUSE_LIGHTWEIGHT_DISPATCH=OFF -DUSE_LAPACK=ON -DUSE_LITE_INTERPRETER_PROFILER=OFF -DBUILD_TEST=OFF -DBUILD_BINARY=OFF -DBUILD_PYTHON=OFF -DUSE_CUDA=OFF -DUSE_GFLAGS=OFF -DUSE_OPENCV=OFF -DUSE_LMDB=OFF -DUSE_LEVELDB=OFF -DUSE_MPI=OFF -DUSE_NUMPY=OFF -DUSE_NNPACK=OFF -DUSE_MKLDNN=OFF -DCMAKE_THREAD_LIBS_INIT=-lpthread -DCMAKE_HAVE_THREADS_LIBRARY=1 -DCMAKE_USE_PTHREADS_INIT=1 -DCMAKE_CXX_FLAGS=-fobjc-arc
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    -- CLANG_VERSION_STRING: Apple clang version 13.0.0 (clang-1300.0.29.30)
    Target: x86_64-apple-darwin20.6.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

CMake Warning (dev) at /Users/pi/miniconda3/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:255 (cmake_dependent_option)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /Users/pi/miniconda3/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:286 (cmake_dependent_option)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Could not find ccache. Consider installing ccache to speed up compilation.
CMake Warning at CMakeLists.txt:559 (message):
INTERN_BUILD_MOBILE is on, disabling BUILD_LAZY_TS_BACKEND

-- std::exception_ptr is supported.
-- Turning off deprecation warning due to glog.
-- Current compiler supports avx512f extension. Will build fbgemm.
-- Trying to find preferred BLAS backend of choice: Eigen
-- Using pocketfft in directory: /Users/pi/program/pytorch-1.11/third_party/pocketfft/
CMake Warning at cmake/Dependencies.cmake:834 (message):
Turning USE_FAKELOWP off as it depends on USE_FBGEMM.
Call Stack (most recent call first):
CMakeLists.txt:692 (include)

-- Using third party subdirectory Eigen.
-- Using third_party/pybind11.
-- pybind11 include dirs: /Users/pi/program/pytorch-1.11/cmake/../third_party/pybind11/include
-- Version: 7.0.3
-- Build type: MinSizeRel
-- CXX_STANDARD: 14
-- Required features: cxx_variadic_templates
-- Not using libkineto in a mobile build.
-- don't use NUMA
-- headers outputs:
-- sources outputs:
-- declarations_yaml outputs:
-- Using ATen parallel backend: NATIVE
disabling CUDA because USE_CUDA is set false
CMake Warning (dev) at aten/src/ATen/CMakeLists.txt:124:
Syntax Warning in cmake code at column 79

Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.

AT_INSTALL_INCLUDE_DIR include/ATen/core
core header install: /Users/pi/program/pytorch-1.11/build_ios/aten/src/ATen/core/TensorBody.h
core header install: /Users/pi/program/pytorch-1.11/build_ios/aten/src/ATen/core/aten_interned_strings.h
disable aten test when BUILD_LITE_INTERPRETER is enabled
CMake Warning (dev) at torch/CMakeLists.txt:447:
Syntax Warning in cmake code at column 107

Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at torch/CMakeLists.txt:447:
Syntax Warning in cmake code at column 115

Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:1052 (message):
Generated cmake files are only fully tested if one builds with system glog,
gflags, and protobuf. Other settings may generate files that are not well
tested.

CMake Warning at CMakeLists.txt:1104 (message):
Generated cmake files are only available when building shared libs.

-- ******** Summary ********
-- General:
-- CMake version : 3.22.1
-- CMake command : /Users/pi/miniconda3/bin/cmake
-- System : Darwin
-- C++ compiler : /usr/bin/g++
-- C++ compiler id : AppleClang
-- C++ compiler version : 13.0.0.13000029
-- Using ccache if found : ON
-- Found ccache : CCACHE_PROGRAM-NOTFOUND
-- CXX flags : -fobjc-arc -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DBUILD_LITE_INTERPRETER -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-range-loop-analysis -Wno-pass-failed -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wno-invalid-partial-specialization -Wno-typedef-redefinition -Wno-unknown-warning-option -Wno-unused-private-field -Wno-inconsistent-missing-override -Wno-aligned-allocation-unavailable -Wno-c++14-extensions -Wno-constexpr-not-const -Wno-missing-braces -Qunused-arguments -fcolor-diagnostics -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-unused-private-field -Wno-missing-braces -Wno-c++14-extensions -Wno-constexpr-not-const
-- Build type : MinSizeRel
-- Compile definitions :
-- CMAKE_PREFIX_PATH : /Users/pi/miniconda3/lib/python3.9/site-packages
-- CMAKE_INSTALL_PREFIX : /Users/pi/program/pytorch-1.11/build_ios/install
-- USE_GOLD_LINKER : OFF
-- TORCH_VERSION : 1.13.0
-- CAFFE2_VERSION : 1.13.0
-- BUILD_CAFFE2 : OFF
-- BUILD_CAFFE2_OPS : OFF
-- BUILD_CAFFE2_MOBILE : OFF
-- BUILD_STATIC_RUNTIME_BENCHMARK: OFF
-- BUILD_TENSOREXPR_BENCHMARK: OFF
-- BUILD_NVFUSER_BENCHMARK: OFF
-- BUILD_BINARY : OFF
-- BUILD_CUSTOM_PROTOBUF : OFF
-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_DOCS : OFF
-- BUILD_PYTHON : OFF
-- BUILD_SHARED_LIBS : OFF
-- CAFFE2_USE_MSVC_STATIC_RUNTIME : ON
-- BUILD_TEST : OFF
-- BUILD_JNI : OFF
-- BUILD_MOBILE_AUTOGRAD : OFF
-- BUILD_LITE_INTERPRETER: ON
-- CROSS_COMPILING_MACOSX :
-- INTERN_BUILD_MOBILE : ON
-- USE_BLAS : 1
-- BLAS :
-- BLAS_HAS_SBGEMM :
-- USE_LAPACK : ON
-- LAPACK :
-- USE_ASAN : OFF
-- USE_CPP_CODE_COVERAGE : OFF
-- USE_CUDA : OFF
-- USE_ROCM : OFF
-- USE_EIGEN_FOR_BLAS : ON
-- USE_FBGEMM : OFF
-- USE_FAKELOWP : OFF
-- USE_KINETO : OFF
-- USE_FFMPEG : OFF
-- USE_GFLAGS : OFF
-- USE_GLOG : OFF
-- USE_LEVELDB : OFF
-- USE_LITE_PROTO : OFF
-- USE_LMDB : OFF
-- USE_METAL : ON
-- USE_PYTORCH_METAL : OFF
-- USE_PYTORCH_METAL_EXPORT : OFF
-- USE_MPS : OFF
-- USE_FFTW : OFF
-- USE_MKL :
-- USE_MKLDNN : OFF
-- USE_NCCL : OFF
-- USE_NNPACK : OFF
-- USE_NUMPY : OFF
-- USE_OBSERVERS : OFF
-- USE_OPENCL : OFF
-- USE_OPENCV : OFF
-- USE_OPENMP : OFF
-- USE_TBB : OFF
-- USE_VULKAN : OFF
-- USE_PROF : OFF
-- USE_QNNPACK : OFF
-- USE_PYTORCH_QNNPACK : ON
-- USE_XNNPACK : ON
-- USE_REDIS : OFF
-- USE_ROCKSDB : OFF
-- USE_ZMQ : OFF
-- USE_DISTRIBUTED : OFF
-- USE_DEPLOY : OFF
-- Public Dependencies : caffe2::Threads
-- Private Dependencies : eigen_blas;pthreadpool;cpuinfo;pytorch_qnnpack;XNNPACK;fp16;fmt::fmt-header-only
-- USE_COREML_DELEGATE : OFF
-- BUILD_LAZY_TS_BACKEND : OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pi/program/pytorch-1.11/build_ios
++ sysctl -n hw.ncpu

  • cmake --build . -- -j8
    Consolidate compiler generated dependencies of target clog
    Consolidate compiler generated dependencies of target pthreadpool
    Consolidate compiler generated dependencies of target fmt
    Consolidate compiler generated dependencies of target eigen_blas
    [ 0%] Built target clog
    [ 0%] Built target pthreadpool
    [ 0%] Built target fmt
    Consolidate compiler generated dependencies of target cpuinfo
    Consolidate compiler generated dependencies of target cpuinfo_internals
    Consolidate compiler generated dependencies of target packing
    Consolidate compiler generated dependencies of target indirection
    [ 0%] Built target eigen_blas
    [ 0%] Built target packing
    Consolidate compiler generated dependencies of target jit
    [ 0%] Built target indirection
    [ 1%] Built target cpuinfo_internals
    [ 1%] Built target cpuinfo
    Consolidate compiler generated dependencies of target c10
    [ 2%] Built target jit
    Consolidate compiler generated dependencies of target pytorch_qnnpack
    [ 3%] Built target pytorch_qnnpack
    [ 5%] Built target c10
    Consolidate compiler generated dependencies of target XNNPACK
    [ 5%] Built target ATEN_CPU_FILES_GEN_TARGET
    [ 16%] Built target XNNPACK
    Consolidate compiler generated dependencies of target all_microkernels
    Consolidate compiler generated dependencies of target torch_cpu
    [ 88%] Built target all_microkernels
    [100%] Built target torch_cpu
    Consolidate compiler generated dependencies of target torch
    [100%] Building CXX object caffe2/CMakeFiles/torch.dir/__/empty.cpp.o
    [100%] Linking CXX static library ../lib/libtorch.a
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch.a(empty.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch.a(empty.cpp.o) has no symbols
    warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: ../lib/libtorch.a the table of contents is empty (no object file members in the library define global symbols)
    [100%] Built target torch
  • echo 'Will install headers and libs to /Users/pi/program/pytorch-1.11/build_ios/install for further Xcode project usage.'
    Will install headers and libs to /Users/pi/program/pytorch-1.11/build_ios/install for further Xcode project usage.
  • make install
    [ 0%] Built target eigen_blas
    [ 0%] Built target pthreadpool
    [ 0%] Built target clog
    [ 0%] Built target cpuinfo
    [ 1%] Built target cpuinfo_internals
    [ 2%] Built target pytorch_qnnpack
    [ 74%] Built target all_microkernels
    [ 74%] Built target indirection
    [ 74%] Built target packing
    [ 75%] Built target jit
    [ 86%] Built target XNNPACK
    [ 86%] Built target fmt
    [ 88%] Built target c10
    [ 88%] Built target ATEN_CPU_FILES_GEN_TARGET
    [100%] Built target torch_cpu
    Consolidate compiler generated dependencies of target torch
    [100%] Built target torch
    Install the project...
    -- Install configuration: "MinSizeRel"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libXNNPACK.a(datatype-strings.c.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libXNNPACK.a(operator-strings.c.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libXNNPACK.a(subgraph-strings.c.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(Storage.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(StorageImpl.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(Array.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(C++17.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(LeftRight.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(MathConstants.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(Metaprogramming.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(Optional.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(TypeList.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(TypeTraits.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(Type_demangle.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(Unicode.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(flags_use_gflags.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libc10.a(intrusive_ptr.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(ParallelNativeTBB.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(ParallelOpenMP.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(TensorMeta.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(IDeepRegistration.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(MKLDNNCommon.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(RuyUtils.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(LegacyBridge.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(Shim.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch_cpu.a(nnapi_register.cpp.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch.a(empty.cpp.o) has no symbols
    warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: /Users/pi/program/pytorch-1.11/build_ios/install/lib/libtorch.a the table of contents is empty (no object file members in the library define global symbols)
  • echo 'Installation completed, now you can copy the headers/libs from /Users/pi/program/pytorch-1.11/build_ios/install to your Xcode project directory.'
    Installation completed, now you can copy the headers/libs from /Users/pi/program/pytorch-1.11/build_ios/install to your Xcode project directory.

Do you know what the problem is? Thanks

@anhappdev
Copy link
Author

@Gaozhongpai The code involved overtime, so I don't know if there are any other changes in the build script. You may want to test with the commit I used at that time 7d8a79b6f31eccb94aa8ce38935917f476b534d5 to see if it works first.

@anhappdev
Copy link
Author

@Gaozhongpai it was long time ago. I don鈥檛 have the files anymore.

@Gaozhongpai
Copy link

@anhappdev It works. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: ios Related to iOS support - build, API, Continuous Integration, document oncall: mobile Related to mobile support, including iOS and Android
Projects
None yet
Development

No branches or pull requests

4 participants