[x265] How to build the Makefile with cmake for iOS compiling?

steven.Hu huhai8274 at 163.com
Fri Jun 24 05:55:26 CEST 2016


I tried cmake 3.5.2 and 3.6.0 rc3(I used rc2 just now), the same problem occured!I used Xcode 7.3.1(Version 7.3.1 (7D1014)).






At 2016-06-24 11:43:51, "chen" <chenm003 at 163.com> wrote:

I take a look, my cmake is brew 3.5.2 version
In your message, there are AppleClang otherthan my Clang, I guess the problem in cmake



在 2016-06-24 11:31:15,"steven.Hu" <huhai8274 at 163.com> 写道:

I'm using cmake 3.6.0, that's the highest version I can find yet.Which version of cmake do you use?






在 2016-06-24 11:27:22,"chen" <chenm003 at 163.com> 写道:

No, it is native compiler, we need cross-compiler
try with upgrade your cmake


At 2016-06-24 11:26:01,"steven.Hu" <huhai8274 at 163.com> wrote:

'Your system' means Mac OS X?I'm using Max OS X 10.11.5.
If remove '-DCMAKE_C_FLAGS="$IOS_CFLAGS" -DCMAKE_CXX_FLAGS="$IOS_CFLAGS" -DIOS_PLATFORM_SDK="$IOS_PLATFORM_SDK"' in make-Makefiles.bash, the C comiler check will succeed!
I found that there is '-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' in the compiling command, is it that cause the problem?






在 2016-06-24 11:10:38,"chen" <chenm003 at 163.com> 写道:

You clang version same as me, but your cmake is lower, and looks your system can't support armv7, are you use ARM64?



At 2016-06-24 11:07:05,"steven.Hu" <huhai8274 at 163.com> wrote:

I've tried your patch, but there is a new problem.When I run 'make-Makefiles.bash' under 'build/arm-ios/' the errors occured:

-- cmake version 3.6.0-rc2

-- The C compiler identification is AppleClang 7.3.0.7030031

-- The CXX compiler identification is AppleClang 7.3.0.7030031

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):

  The C compiler

  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.




  It fails with the following output:




   Change Dir: /Users/huhai/dev/sources/video_opensource/x265_new/x265_dev/build/arm-ios/CMakeFiles/CMakeTmp




  




  Run Build Command:"/usr/bin/make" "cmTC_83901/fast"




  /Applications/Xcode.app/Contents/Developer/usr/bin/make -f

  CMakeFiles/cmTC_83901.dir/build.make CMakeFiles/cmTC_83901.dir/build




  Building C object CMakeFiles/cmTC_83901.dir/testCCompiler.c.o




  

  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

  -arch armv7 -mfpu=neon -pthread -isysroot

  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk

  -miphoneos-version-min=7.0 -Qunused-arguments -isysroot

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

  -o CMakeFiles/cmTC_83901.dir/testCCompiler.c.o -c

  /Users/huhai/dev/sources/video_opensource/x265_new/x265_dev/build/arm-ios/CMakeFiles/CMakeTmp/testCCompiler.c







  Linking C executable cmTC_83901




  /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script

  CMakeFiles/cmTC_83901.dir/link.txt --verbose=1




  

  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

  -arch armv7 -mfpu=neon -pthread -isysroot

  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk

  -miphoneos-version-min=7.0 -Qunused-arguments -isysroot

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

  -Wl,-headerpad_max_install_names

  CMakeFiles/cmTC_83901.dir/testCCompiler.c.o -o cmTC_83901




  ld: warning: ignoring file

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libSystem.tbd,

  missing required architecture armv7 in file

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libSystem.tbd







  ld: dynamic main executables must link with libSystem.dylib for

  architecture armv7




  clang: error: linker command failed with exit code 1 (use -v to see

  invocation)




  make[1]: *** [cmTC_83901] Error 1




  make: *** [cmTC_83901/fast] Error 2




  




  




  CMake will not be able to correctly generate this project.

Call Stack (most recent call first):

  CMakeLists.txt:19 (project)







-- Configuring incomplete, errors occurred!

See also "/Users/huhai/dev/sources/video_opensource/x265_new/x265_dev/build/arm-ios/CMakeFiles/CMakeOutput.log".

See also "/Users/huhai/dev/sources/video_opensource/x265_new/x265_dev/build/arm-ios/CMakeFiles/CMakeError.log".





The C compiler check failed!And I found that it's the '-DCMAKE_C_FLAGS="$IOS_CFLAGS" -DCMAKE_CXX_FLAGS="$IOS_CFLAGS" -DIOS_PLATFORM_SDK="$IOS_PLATFORM_SDK"' cause the problem!
How I can fix it, do you have some ideas?

在 2016-06-24 07:49:20,"huhai" <huhai8274 at 163.com> 写道:

Thank you!Sure,I'll have a try!

发自我的 iPhone

在 2016年6月24日,06:44,chen <chenm003 at 163.com> 写道:


Could you try my new patch?


At 2016-06-23 11:20:02,"steven.Hu" <huhai8274 at 163.com> wrote:

I found 'arm-linux' directory under 'build' directory, and I changed the 'crosscompile.cmake' to the following:


# CMake toolchain file for cross compiling x265 for ARM arch
# This feature is only supported as experimental. Use with caution.
# Please report bugs on bitbucket
# Run cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G "Unix Makefiles" ../../source && ccmake ../../source


set(CROSS_COMPILE_ARM 1)
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR armv7l)


# specify the cross compiler
set(CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)
set(CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++)


# specify the target environment
SET(CMAKE_FIND_ROOT_PATH  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/)


Then I run 'cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G "Unix Makefiles" ../../source && ccmake ../../source' from the arm-linux directory, and I got the'Makefile' without any error info.
But when run 'make', it reported many errors, which may be caused by incorrect headers including.I found the compiler uses the headers under '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk', instead, it should use the headers under '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/'.
How can I fix it? Any suggestion would be appreciated!




 

_______________________________________________
x265-devel mailing list
x265-devel at videolan.org
https://mailman.videolan.org/listinfo/x265-devel






 





 





 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160624/73071b42/attachment-0001.html>


More information about the x265-devel mailing list