I’ve build the pytorch iOS libraries using IOS_PLATFORM=SIMULATOR BUILD_PYTORCH_MOBILE=1 BUILD_LITE_INTERPRETER=0 ./scripts/build_ios.sh. I’ve put NO_API to OFF and BUILD_MOBILE_AUTOGRAD to ON in the root CMakeList file.
I’ve then linked cpuinfo,clog,pthreadpool,torch_cpu and c10 with my application to build my own library.
However when i run my app in xcode i get an Could not find schema for aten::empty.memory_format error in my log.
I tried linking the other libtorch libraries but to no avail.
I did notice that when building the libtorch libraries i got a few warnings about an objects being empty.
[ 99%] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/utils/crash_handler.cpp.o
[100%] Linking CXX static library ../lib/libtorch_cpu.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(DynamicLibrary.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(ParallelNativeTBB.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(ParallelOpenMP.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(TensorMeta.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(ATenGeneral.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(blob.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(LegacyBridge.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(IDeepRegistration.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(MKLDNNCommon.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(Shim.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(nnapi_register.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(intrinsic_symbols.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(llvm_codegen.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(llvm_jit.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(variadic.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(vision.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(DynamicLibrary.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(ParallelNativeTBB.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(ParallelOpenMP.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(TensorMeta.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(ATenGeneral.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(blob.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(LegacyBridge.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(IDeepRegistration.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(MKLDNNCommon.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(Shim.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(nnapi_register.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(intrinsic_symbols.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(llvm_codegen.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(llvm_jit.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(variadic.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libtorch_cpu.a(vision.cpp.o) has no symbols
[100%] Built target torch_cpu
Scanning 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/matthieu.rochard/tts_sdk_java_android/pytorch/build_ios/install for further Xcode project usage.'
Will install headers and libs to /Users/matthieu.rochard/tts_sdk_java_android/pytorch/build_ios/install for further Xcode project usage.
+ make install
[  1%] Built target eigen_blas
[  1%] Built target pthreadpool
[  1%] Built target clog
[  1%] Built target cpuinfo_internals
[  2%] Built target cpuinfo
[  4%] Built target pytorch_qnnpack
[ 75%] Built target XNNPACK
[ 75%] Built target fmt
[ 77%] Built target c10
[ 77%] Built target ATEN_CPU_FILES_GEN_TARGET
[100%] Built target torch_cpu
[100%] Built target torch
Install the project...
-- Install configuration: "MinSizeRel"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(DynamicLibrary.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(ATenGeneral.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(blob.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(intrinsic_symbols.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(llvm_codegen.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(llvm_jit.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(variadic.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch_cpu.a(vision.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/devUser/tts_sdk_java_android/pytorch/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/devUser/tts_sdk_java_android/pytorch/build_ios/install/lib/libtorch.a the table of contents is empty (no object file members in the library define global symbols)