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

Exporting project #4

Closed
thomasnieren opened this issue Nov 24, 2015 · 9 comments
Closed

Exporting project #4

thomasnieren opened this issue Nov 24, 2015 · 9 comments

Comments

@thomasnieren
Copy link

Hello,

Thank you for your project who helped me a lot. Now that my model works properly i'm trying to export it into another app, unfortunatly, i'm facing some problems. All the files a compiled but the app cannot be launch. The following issues are thrown by xcode:

ld: warning: ignoring file /Users/actimage/Documents/Actelin/Actelin/caffe/lib/libprotoc.a, file was built for archive which is not the architecture being linked (armv7): /Users/actimage/Documents/Actelin/Actelin/caffe/lib/libprotoc.a
Undefined symbols for architecture armv7:
  "_cblas_dcopy", referenced from:
      void caffe::caffe_cpu_scale<double>(int, double, double const*, double*) in math_functions.o
  "_cblas_scopy", referenced from:
      void caffe::caffe_cpu_scale<float>(int, float, float const*, float*) in math_functions.o
  "_cblas_sasum", referenced from:
      float caffe::caffe_cpu_asum<float>(int, float const*) in math_functions.o
  "_cblas_dgemm", referenced from:
      void caffe::caffe_cpu_gemm<double>(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, double, double const*, double const*, double, double*) in math_functions.o
  "_cblas_sgemv", referenced from:
      void caffe::caffe_cpu_gemv<float>(CBLAS_TRANSPOSE, int, int, float, float const*, float const*, float, float*) in math_functions.o
  "_cblas_sscal", referenced from:
      void caffe::caffe_scal<float>(int, float, float*) in math_functions.o
      void caffe::caffe_cpu_scale<float>(int, float, float const*, float*) in math_functions.o
      cblas_saxpby(int, float, float const*, int, float, float*, int) in math_functions.o
  "_cblas_daxpy", referenced from:
      void caffe::caffe_axpy<double>(int, double, double const*, double*) in math_functions.o
      cblas_daxpby(int, double, double const*, int, double, double*, int) in math_functions.o
  "_cblas_ddot", referenced from:
      double caffe::caffe_cpu_strided_dot<double>(int, double const*, int, double const*, int) in math_functions.o
  "_cblas_saxpy", referenced from:
      void caffe::caffe_axpy<float>(int, float, float const*, float*) in math_functions.o
      cblas_saxpby(int, float, float const*, int, float, float*, int) in math_functions.o
  "_cblas_dgemv", referenced from:
      void caffe::caffe_cpu_gemv<double>(CBLAS_TRANSPOSE, int, int, double, double const*, double const*, double, double*) in math_functions.o
  "_cblas_dscal", referenced from:
      void caffe::caffe_scal<double>(int, double, double*) in math_functions.o
      void caffe::caffe_cpu_scale<double>(int, double, double const*, double*) in math_functions.o
      cblas_daxpby(int, double, double const*, int, double, double*, int) in math_functions.o
  "_cblas_sgemm", referenced from:
      void caffe::caffe_cpu_gemm<float>(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const*, float const*, float, float*) in math_functions.o
  "_cblas_dasum", referenced from:
      double caffe::caffe_cpu_asum<double>(int, double const*) in math_functions.o
  "_cblas_sdot", referenced from:
      float caffe::caffe_cpu_strided_dot<float>(int, float const*, int, float const*, int) in math_functions.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea?

@craftzdog
Copy link
Owner

Xcode 7 changed its linker rules and it causes linker error with static libraries.
So please try it on Xcode 6.

@thomasnieren
Copy link
Author

Ok, but it's working fine with your sample project. I think that i'm missing something, all the errors are about math_functions.

@craftzdog
Copy link
Owner

Did you add Generate protobuf files in Build Rules section?
Please also check what's missing in the Build Phases and Build Settings of the project.

@thomasnieren
Copy link
Author

Thank you, I've just checked and everything seems right. Generate protobuf files is in Build Rules. Build Phases and Build settings are identical to sample-project. I've noticed something but i'm not sure if it matters.

Ld /Users/actimage/Library/Developer/Xcode/DerivedData/Actelin-etnlfimuyfbcwfawuwdkkhkwhjke/Build/Products/Debug-iphoneos/Actelin.app/Actelin normal armv7
    cd /Users/actimage/Documents/Actelin/Actelin
    export IPHONEOS_DEPLOYMENT_TARGET=8.3
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -L/Users/actimage/Library/Developer/Xcode/DerivedData/Actelin-etnlfimuyfbcwfawuwdkkhkwhjke/Build/Products/Debug-iphoneos -L/Users/actimage/Documents/Actelin/Actelin/caffe/lib -L/Users/actimage/Documents/Actelin/Actelin/caffe/ios/lib -F/Users/actimage/Library/Developer/Xcode/DerivedData/Actelin-etnlfimuyfbcwfawuwdkkhkwhjke/Build/Products/Debug-iphoneos -F. -FActelin -FActelin.xcworkspace -FActelinTests -Fcaffe -FPods -FActelin/Controllers -FActelin/CoreData -FActelin/model -FActelin/Models -FActelin/Ressources -FActelin/StoryBoard -FActelin/Storyboards -FActelin/Utils -FActelin/Views -FActelin.xcworkspace/xcshareddata -FActelin.xcworkspace/xcuserdata -Fcaffe/bin -Fcaffe/include -Fcaffe/ios -Fcaffe/lib -Fcaffe/src -FPods/Charts -FPods/Headers -FPods/Local\ Podspecs -FPods/MagicalRecord -FPods/MFSideMenu -FPods/Reachability -FPods/Target\ Support\ Files -FPods/TPKeyboardAvoiding -FActelin/Controllers/Authentication -FActelin/CoreData/Actelin.xcdatamodeld -FActelin/CoreData/Model -FActelin/Ressources/Images -FActelin.xcworkspace/xcuserdata/actimage.xcuserdatad -Fcaffe/include/caffe -Fcaffe/include/gflags -Fcaffe/include/glog -Fcaffe/include/google -Fcaffe/include/leveldb -Fcaffe/include/opencv -Fcaffe/include/opencv2 -Fcaffe/ios/include -Fcaffe/ios/lib -Fcaffe/src/caffe -Fcaffe/src/gflags -Fcaffe/src/gtest -FPods/Charts/Charts -FPods/Headers/Private -FPods/MagicalRecord/MagicalRecord -FPods/MFSideMenu/MFSideMenu -FPods/Target\ Support\ Files/Charts -FPods/Target\ Support\ Files/MagicalRecord -FPods/Target\ Support\ Files/MFSideMenu -FPods/Target\ Support\ Files/Pods -FPods/Target\ Support\ Files/Reachability -FPods/Target\ Support\ Files/TPKeyboardAvoiding -FPods/TPKeyboardAvoiding/TPKeyboardAvoiding -FActelin/CoreData/Actelin.xcdatamodeld/Actelin.xcdatamodel -FActelin.xcworkspace/xcuserdata/actimage.xcuserdatad/xcdebugger -Fcaffe/include/caffe/proto -Fcaffe/include/caffe/test -Fcaffe/include/caffe/util -Fcaffe/include/google/protobuf -Fcaffe/include/opencv2/calib3d -Fcaffe/include/opencv2/contrib -Fcaffe/include/opencv2/core -Fcaffe/include/opencv2/features2d -Fcaffe/include/opencv2/flann -Fcaffe/include/opencv2/highgui -Fcaffe/include/opencv2/imgproc -Fcaffe/include/opencv2/legacy -Fcaffe/include/opencv2/ml -Fcaffe/include/opencv2/nonfree -Fcaffe/include/opencv2/objdetect -Fcaffe/include/opencv2/photo -Fcaffe/include/opencv2/stitching -Fcaffe/include/opencv2/video -Fcaffe/include/opencv2/videostab -Fcaffe/include/opencv2/world -Fcaffe/ios/include/leveldb -Fcaffe/ios/include/opencv -Fcaffe/ios/include/opencv2 -Fcaffe/src/caffe/layers -Fcaffe/src/caffe/proto -Fcaffe/src/caffe/test -Fcaffe/src/caffe/util -FPods/Charts/Charts/Classes -FPods/Headers/Private/MagicalRecord -FPods/Headers/Private/MFSideMenu -FPods/Headers/Private/Reachability -FPods/Headers/Private/TPKeyboardAvoiding -FPods/MagicalRecord/MagicalRecord/Categories -FPods/MagicalRecord/MagicalRecord/Core -Fcaffe/include/google/protobuf/compiler -Fcaffe/include/google/protobuf/io -Fcaffe/include/google/protobuf/stubs -Fcaffe/include/opencv2/stitching/detail -Fcaffe/ios/include/opencv2/core -Fcaffe/src/caffe/test/test_data -FPods/Charts/Charts/Classes/Animation -FPods/Charts/Charts/Classes/Charts -FPods/Charts/Charts/Classes/Components -FPods/Charts/Charts/Classes/Data -FPods/Charts/Charts/Classes/Filters -FPods/Charts/Charts/Classes/Formatters -FPods/Charts/Charts/Classes/Highlight -FPods/Charts/Charts/Classes/Interfaces -FPods/Charts/Charts/Classes/Renderers -FPods/Charts/Charts/Classes/Utils -FPods/Headers/Private/MagicalRecord/MagicalRecord -FPods/MagicalRecord/MagicalRecord/Categories/DataImport -FPods/MagicalRecord/MagicalRecord/Categories/NSManagedObject -FPods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext -Fcaffe/include/google/protobuf/compiler/cpp -Fcaffe/include/google/protobuf/compiler/java -Fcaffe/include/google/protobuf/compiler/python -F/Users/actimage/Documents/Actelin/Actelin/Actelin -filelist /Users/actimage/Library/Developer/Xcode/DerivedData/Actelin-etnlfimuyfbcwfawuwdkkhkwhjke/Build/Intermediates/Actelin.build/Debug-iphoneos/Actelin.build/Objects-normal/armv7/Actelin.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.3 -dead_strip -framework Charts -framework MFSideMenu -framework MagicalRecord -framework Reachability -framework TPKeyboardAvoiding -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -framework opencv2 -lprotobuf -lglog -lleveldb -framework Pods -lprotoc -Xlinker -dependency_info -Xlinker /Users/actimage/Library/Developer/Xcode/DerivedData/Actelin-etnlfimuyfbcwfawuwdkkhkwhjke/Build/Intermediates/Actelin.build/Debug-iphoneos/Actelin.build/Objects-normal/armv7/Actelin_dependency_info.dat -o /Users/actimage/Library/Developer/Xcode/DerivedData/Actelin-etnlfimuyfbcwfawuwdkkhkwhjke/Build/Products/Debug-iphoneos/Actelin.app/Actelin

All the -F links are in relative path here, and in the sample-project, links are in full path.

Ld /Users/actimage/Library/Developer/Xcode/DerivedData/CaffeApp-anmviuhewnamliaeelsghoeapldb/Build/Products/Debug-iphoneos/CaffeApp.app/CaffeApp normal armv7
    cd "/Users/actimage/Documents/Actelin/integration/caffe-ios-sample-master 2"
    export IPHONEOS_DEPLOYMENT_TARGET=8.3
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -L/Users/actimage/Library/Developer/Xcode/DerivedData/CaffeApp-anmviuhewnamliaeelsghoeapldb/Build/Products/Debug-iphoneos -L/Users/actimage/Documents/Actelin/integration/caffe-ios-sample-master\ 2/caffe/lib -L/Users/actimage/Documents/Actelin/integration/caffe-ios-sample-master\ 2/caffe/ios/lib -F/Users/actimage/Library/Developer/Xcode/DerivedData/CaffeApp-anmviuhewnamliaeelsghoeapldb/Build/Products/Debug-iphoneos -F/Users/actimage/Documents/Actelin/integration/caffe-ios-sample-master\ 2/CaffeApp -F/Users/actimage/Documents/Actelin/integration/caffe-ios-sample-master\ 2 -filelist /Users/actimage/Library/Developer/Xcode/DerivedData/CaffeApp-anmviuhewnamliaeelsghoeapldb/Build/Intermediates/CaffeApp.build/Debug-iphoneos/CaffeApp.build/Objects-normal/armv7/CaffeApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.3 -dead_strip -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -framework opencv2 -lleveldb -lglog -framework AudioToolbox -framework Accelerate -lprotobuf -lprotoc -Xlinker -dependency_info -Xlinker /Users/actimage/Library/Developer/Xcode/DerivedData/CaffeApp-anmviuhewnamliaeelsghoeapldb/Build/Intermediates/CaffeApp.build/Debug-iphoneos/CaffeApp.build/Objects-normal/armv7/CaffeApp_dependency_info.dat -o /Users/actimage/Library/Developer/Xcode/DerivedData/CaffeApp-anmviuhewnamliaeelsghoeapldb/Build/Products/Debug-iphoneos/CaffeApp.app/CaffeApp

@craftzdog
Copy link
Owner

hmm,

How about you import your app into this sample?
It's hard to find what's missing.

@thomasnieren
Copy link
Author

I forgot to use Accelerate...

@afathi3
Copy link

afathi3 commented Mar 8, 2016

Is there anyway that I can get this working on xcode 7?

@thomasnierenactimage
Copy link

It's working on Xcode 7. I suggest you to open a new issue and explain your problem.

@afathi3
Copy link

afathi3 commented Mar 9, 2016

@thomasnierenactimage @thomasnieren I am getting a very similar error to what is stated above.
Xcode complains that the libprotoc.a was built for a different architecture.

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

4 participants