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

[Help needed] Failed to run cmake for SIMULATOR64 platform #148

Closed
Dinesh-Ramakrishnan opened this issue Jun 9, 2022 · 2 comments
Closed
Assignees
Labels

Comments

@Dinesh-Ramakrishnan
Copy link

Describe the bug

Running cmake for the platform SIMULATOR64 resulted in error.

Log

build % cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=SIMULATOR64
-- [DEFAULTS] Using explicit named language support! E.g., enable_language(CXX) is needed in the project files.
-- [DEFAULTS] Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!
-- [DEFAULTS] Enabling ARC support by default. ENABLE_ARC not provided!
-- [DEFAULTS] Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!
-- [DEFAULTS] Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!
-- Not setting any manual command-line buildflags, since Xcode is selected as generator. Modifying the Xcode build-settings directly instead.
-- Configuring iphonesimulator build for platform: SIMULATOR64, architecture(s): x86_64
-- Using SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk
-- Using C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Using CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- Using install name tool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool
-- Autoconf target triple: x86_64-apple-ios11.0-simulator
-- Using minimum deployment version: 11.0 (SDK version: 15.5)
-- Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!
-- Using Xcode version: 13.4.1
-- CMake version: 3.23.2
-- Using a data_ptr size of: 8
-- Bitcode: Disabled
-- ARC: Enabled
-- Hiding symbols: Enabled
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- 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 /usr/local/Cellar/cmake/3.23.2/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (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/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_7fbd2 -parallelizeTargets -configuration Debug -hideShellScriptEnvironment && 2022-06-09 23:22:01.151 xcodebuild[33404:444983] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-06-09 23:22:01.151 xcodebuild[33404:444983] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_7fbd2 -parallelizeTargets -configuration Debug -hideShellScriptEnvironment
    
    User defaults from command line:
        HideShellScriptEnvironment = YES
        IDEPackageSupportUseBuiltinSCM = YES
    
    note: Using new build system
    note: Planning
    Analyze workspace
    
    Create build description
    Build description signature: 089d37b83570689a5bdff1104c63c652
    Build description path: /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/build/XCBuildData/089d37b83570689a5bdff1104c63c652-desc.xcbuild
    
    note: Build preparation complete
    note: Building targets in dependency order
    CreateBuildDirectory /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp
        cd /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.xcodeproj
        builtin-create-build-directory /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp
    
    CreateBuildDirectory /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug
        cd /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.xcodeproj
        builtin-create-build-directory /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug
    
    CompileC /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/testCCompiler.o /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/testCCompiler.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'cmTC_7fbd2' from project 'CMAKE_TRY_COMPILE')
        cd /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -target x86_64-apple-ios11.0-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -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\=\"Debug-iphonesimulator\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -I/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug/include -I/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/DerivedSources-normal/x86_64 -I/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/DerivedSources/x86_64 -I/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/DerivedSources -F/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -miphoneos-version-min\=11.0 -MMD -MT dependencies -MF /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/testCCompiler.d --serialize-diagnostics /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/testCCompiler.dia -c /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/testCCompiler.c -o /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/testCCompiler.o
    
    WriteAuxiliaryFile /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/cmTC_7fbd2.LinkFileList (in target 'cmTC_7fbd2' from project 'CMAKE_TRY_COMPILE')
        cd /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp
        write-file /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/cmTC_7fbd2.LinkFileList
    
    Libtool /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug/libcmTC_7fbd2.a normal (in target 'cmTC_7fbd2' from project 'CMAKE_TRY_COMPILE')
        cd /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk -L/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug -filelist /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/cmTC_7fbd2.LinkFileList -dependency_info /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug-iphonesimulator/cmTC_7fbd2.build/Objects-normal/x86_64/cmTC_7fbd2_libtool_dependency_info.dat -o /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug/libcmTC_7fbd2.a
    error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no library created (no object files in input files matching -arch_only x86_64)
    Command Libtool failed with a nonzero exit code
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
    	Libtool /Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeTmp/Debug/libcmTC_7fbd2.a normal (in target 'cmTC_7fbd2' from project 'CMAKE_TRY_COMPILE')
    (1 failure)
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeOutput.log".
See also "/Users/xyz/sw_devel/ios-cmake/example/example-lib/build/CMakeFiles/CMakeError.log".

To Reproduce
Steps to reproduce the behavior:

  1. cd example/example-lib
  2. mkdir build
  3. cd build
  4. cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=SIMULATOR64

Post this step, we get error attached under the log section

Expected behavior
Build successfully

Environment

  • What version of CMake did you run?
    -- Using Xcode version: 13.4.1
    -- CMake version: 3.23.2

  • Your faulty CMakeLists.txt here:
    I am running the cmake for example-lib

@Dinesh-Ramakrishnan
Copy link
Author

This issue is related to few of my environment variables set to wrong values. The problem is resolved post resetting my env variables.

@SiuyuenChow
Copy link

I met the same problem, how did you solve it?
#150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants