solrex / caffe-mobile

Optimized (for size and speed) Caffe lib for iOS and Android with out-of-the-box demo APP.
Other
317 stars 121 forks source link

"./build-protobuf-3.1.0.sh iPhoneOS" compile with error "No iOS SDK's found in default search path . Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK." #3

Closed zhaoxiangyulove closed 7 years ago

zhaoxiangyulove commented 7 years ago

error log: CMake Error at /Users/zhaoxiangyu/Documents/caffe-mobile/third_party/ios-cmake/toolchain/iOS.cmake:143 (message): No iOS SDK's found in default search path . Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK. Call Stack (most recent call first): /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/CMakeDetermineSystem.cmake:85 (include) CMakeLists.txt:12 (project) pls tell me how to fix it! thx!

solrex commented 7 years ago

Do you have Xcode installed?

Normally you can find your iOS SDKs in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/.

zhaoxiangyulove commented 7 years ago

@solrex Thanks for helping me! I did install Xcode 8.0 ,and find iOS SDKs in that path. When I run "./build-protobuf-3.1.0.sh iPhoneOS" ,it is still not working! here are All logs: bogon:third_party zhaoxiangyu$ ./build-protobuf-3.1.0.sh iPhoneOS Building Google Protobuf for iPhoneOS ########################################## Fetch Google Protobuf 3.1.0 from source. ##########################################

##################### Building protobuf for iPhoneOS #####################

CMake Error at /Users/zhaoxiangyu/Documents/caffe-mobile/third_party/ios-cmake/toolchain/iOS.cmake:143 (message): No iOS SDK's found in default search path . Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK. Call Stack (most recent call first): /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/CMakeDetermineSystem.cmake:85 (include) CMakeLists.txt:12 (project)

-- Configuring incomplete, errors occurred! make: No targets specified and no makefile found. Stop. make: No rule to make target `install'. Stop.

Maybe I write wrong? Trouble you to help!

solrex commented 7 years ago

The default search path is determined by command /usr/bin/xcode-select -p. It prints /Applications/Xcode.app/Contents/Developer on my Mac. You can check if this command outputs the right thing.

Moreover, you can manually set CMAKE_IOS_SDK_ROOT yourself. Open build-protobuf-3.1.0.sh, find line 181 (the cmake * line in function build-iPhoneOS). Then add a -DCMAKE_IOS_SDK_ROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer to cmake options as bellow:

cmake ../cmake -DCMAKE_INSTALL_PREFIX=../../protobuf-$TARGET\
    -DCMAKE_TOOLCHAIN_FILE="../../ios-cmake/toolchain/iOS.cmake" \
    -DCMAKE_IOS_SDK_ROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer" \
    -DIOS_PLATFORM=OS \
    -DCMAKE_CXX_FLAGS="-fembed-bitcode" \
    -Dprotobuf_BUILD_TESTS=OFF \
    -Dprotobuf_BUILD_SHARED_LIBS=OFF \
    -Dprotobuf_WITH_ZLIB=OFF
zhaoxiangyulove commented 7 years ago

OK!It works!Thank you~~~