Legoless / OpenCV-Dynamic

OpenCV iOS Dynamic Framework Podspec
http://opencv.org
Other
24 stars 13 forks source link

Error when installing OpenCV-Dynamic through cocoapods #8

Closed fellowProgrammer closed 5 years ago

fellowProgrammer commented 6 years ago

I am trying to install this cocoapod, but when I put in my podfile and run pod install it returns a huge error message. I have already installed CMake and have also run the command Xcode-select --install. The problem is specific to this cocoapod because the normal OpenCV cocoapod installs just fine. I see you have encountered this issue before (https://github.com/Legoless/OpenCV-Dynamic/issues/1). My error message seems to be a bit different. I put this code in my podfile pod 'OpenCV-Dynamic', '~> 3.2.1' but it always installs version 3.2.4.

Error Message:

`[!] /bin/bash -c 
set -e
git submodule init
git submodule update
python opencv/platforms/ios/build_framework.py ios --dynamic
cp -a ./ios/opencv2.framework ./opencv2.framework

Submodule path 'opencv': checked out 'a8aff6f64330a0ab2c9d71033412af892dd9b710'
-- Setting up iPhoneOS toolchain for IOS_ARCH='armv7;armv7s;arm64'
-- iPhoneOS toolchain loaded
-- Setting up iPhoneOS toolchain for IOS_ARCH='armv7;armv7s;arm64'
-- iPhoneOS toolchain loaded
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- The C compiler identification is AppleClang 9.0.0.9000039`

Is there something wrong with specific version or is there another issue? How would I fix this?

Thanks in advance :)

Legoless commented 6 years ago

There is no error message visible in the log. The version 3.2.1 is installed because of the operator ~>, in that case you should specify the version directly. 'OpenCV-Dynamic', '3.2.4'.

francisli commented 6 years ago

@Legoless I'm not sure what the original poster was encountering, but I currently receive the following error when trying to install via CocoaPods:

CompileC /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/Objects-normal/arm64/gzlib.o 3rdparty/zlib/gzlib.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/francisli/.rvm/gems/ruby-2.4.1/bin:/Users/francisli/.rvm/gems/ruby-2.4.1@global/bin:/Users/francisli/.rvm/rubies/ruby-2.4.1/bin:/Users/francisli/.fastlane/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/ant/bin:/Users/francisli/.rvm/bin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Release-iphoneos\" -DNO_FSEEKO -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -fstrict-aliasing -Wdeprecated-declarations -miphoneos-version-min=8.0 -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -fembed-bitcode-marker -I/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/lib/Release/include -I/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib -I/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib -I/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos -I/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/DerivedSources/arm64 -I/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/lib/Release -fembed-bitcode -Wno-unused-function -Wno-overloaded-virtual -Wno-unused-function -Wno-overloaded-virtual -Wno-unused-function -Wno-overloaded-virtual -fPIC -DNDEBUG -DNDEBUG -MMD -MT dependencies -MF /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/Objects-normal/arm64/gzlib.d --serialize-diagnostics /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/Objects-normal/arm64/gzlib.dia -c /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzlib.c -o /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/ios/build/build-iphoneos/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/Objects-normal/arm64/gzlib.o
/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzlib.c:256:24: error: implicit declaration of function 'lseek' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        state->start = LSEEK(state->fd, 0, SEEK_CUR);
                       ^
/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzlib.c:256:24: note: did you mean 'fseek'?
/Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
In file included from /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzlib.c:6:
In file included from /Users/francisli/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/3rdparty/zlib/gzguts.h:21:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/usr/include/stdio.h:162:6: note: 'fseek' declared here
int      fseek(FILE *, long, int);
         ^
1 error generated.

Do you have any insight on how to address this issue? Thanks!

Legoless commented 6 years ago

I have run into the same error, so I have updated OpenCV to 3.4.1. Did not push the podspec yet, so try pointing your pod to this repository:

pod 'OpenCV-Dynamic', :git => 'https://github.com/Legoless/OpenCV-Dynamic.git'
magneter commented 5 years ago

when I use pod ,I still got a error.

magneter commented 5 years ago

RROR: Command '['xcodebuild', 'IPHONEOS_DEPLOYMENT_TARGET=8.0', 'ONLY_ACTIVE_ARCH=NO', '-arch', 'armv7', '-arch', 'armv7s', '-arch', 'arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '4', '-target', 'ALL_BUILD', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65

magneter commented 5 years ago

many repo depend the dynamic opencv .when I use pod to get them ,I got the same error. https://stackoverflow.com/questions/22227029/how-to-build-zlib-for-arm64/22228306#22228306

Legoless commented 5 years ago

Seems to be an issue with arm64. I did update podspec to OpenCV 4.0.0 though, which seems to go through fine. It's hard to maintain together, when both OpenCV and Xcode are changing..

magneter commented 5 years ago

how could I fix this complie problem?my Xcode version is 10.0 and the opencv above 3.0 is fine too.

Legoless commented 5 years ago

Did you try installing 4.0.0-Alpha?