Search code examples
c++iosmacosconan

Conan: cannot run C compiled programs


I'm trying to build the PoDoFo (https://github.com/podofo/podofo) library for iOS using Conan. I get an error stating configure: error: cannot run C compiled programs. If you meant to cross compile, use --host' when installing the gperf package.

You can find my host and build profiles below, followed by the full error output:

tarlanismayilsoy@Tarlans-MacBook-Pro build % conan install --build=missing --profile:host=default --profile:build=default-ios ..

======== Input profiles ========
Profile host:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos

Profile build:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=15
os=iOS
os.sdk=iphoneos
os.version=15.0


======== Computing dependency graph ========
Graph root
    conanfile.txt: /Users/tarlanismayilsoy/Downloads/podofo-master/conanfile.txt
Requirements
    brotli/1.1.0#d56d7bb9ca722942aba17369cb5c0519 - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
    expat/2.6.0#2f92fb3cf504e9731aba6d20dcd641bf - Cache
    fontconfig/2.13.93#5d592b22ecc0f9e5d0ef4d730501605c - Cache
    freetype/2.13.2#dfa3d504cae4a08d5c72113bd6f28498 - Cache
    jbig/20160605#2d29fa02aacd76902e0d2cbbc24631ef - Cache
    libdeflate/1.19#3ea74a4549efc14d4b1202dc4bfbf602 - Cache
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
    libjpeg/9e#68269859e4325ddc3f995d1fd3fc9187 - Cache
    libpng/1.6.39#dcb378460e3ed9d5d5b14c5b66e9599e - Cache
    libtiff/4.4.0#feb03470cd8556afca2d42ae45a7b1e6 - Cache
    libwebp/1.3.2#52f69c4a31c5cf033fdd9230d77a8e38 - Cache
    libxml2/2.10.3#47e6e3029c72aeee50e7bc4e01e3f59b - Cache
    openssl/1.1.1s#3eeebc156917046ee80533dbbb8f4671 - Cache
    xz_utils/5.4.5#a26a2d42ab9c3dabc151bbe1bf898e53 - Cache
    zlib/1.2.13#4e74ebf1361fe6fb60326f473f276eb5 - Cache
    zstd/1.5.5#b87dc3b185caa4b122979ac4ae8ef7e8 - Cache
Build requirements
    gperf/3.1#1d622ad9717e9348ed3685c9994ad0b9 - Cache
    meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache
    meson/1.2.3#aad1203ff72cd2dd1b43e5dfad9783a1 - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
    pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605 - Cache

======== Computing necessary packages ========
libtiff/4.4.0: Checking 11 compatible configurations
libtiff/4.4.0: Compatible configurations not found in cache, checking servers
libtiff/4.4.0: '819b8feaec86865697efa933f639b329da77f922': compiler.cppstd=98
libtiff/4.4.0: '8663731ea1b2e8ac697b40ba614256f32c915716': compiler.cppstd=gnu98
libtiff/4.4.0: 'c6e1ad5f70eddbd323934006ca46ee49787ed6df': compiler.cppstd=11
libtiff/4.4.0: '3c791d6891b58a7efc1371ac8162049f2f3fb5a6': compiler.cppstd=gnu11
libtiff/4.4.0: '3085626f98d15e606806db34db9770f8a9c2f6c8': compiler.cppstd=14
libtiff/4.4.0: '87551298a3ceb41ffbac828918f56857de4127d0': compiler.cppstd=gnu14
libtiff/4.4.0: '73966b0f10a98eed86a55bd07fc67226a44449ff': compiler.cppstd=17
libtiff/4.4.0: '1658d4834afbad2bacf89a7cf26e3b6973ddf58a': compiler.cppstd=20
libtiff/4.4.0: '381a8331fe26da741b0ef380905a13b86aa81f85': compiler.cppstd=gnu20
libtiff/4.4.0: 'b7d0a1b270a266e1e8e8d4dfaa295def1271a1ef': compiler.cppstd=23
libtiff/4.4.0: '56698af8d1341cfff6abdef1773c3dda4cc7628d': compiler.cppstd=gnu23
Requirements
    brotli/1.1.0#d56d7bb9ca722942aba17369cb5c0519:27c3eb48256dc5d2ec50ae887081dd85434e5755#509a4c154198ffa600cb7777d4531f04 - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:bd47875fc25b97398a4030f4060ef8ef3539584a#f608951e5a66ce510d2cd2bdd0ffd016 - Cache
    expat/2.6.0#2f92fb3cf504e9731aba6d20dcd641bf:10fd60dbb19c1c7b079fb35f1ca651920973f9ca#f858108140c417bda0df9f9bc3f0dbd5 - Cache
    fontconfig/2.13.93#5d592b22ecc0f9e5d0ef4d730501605c:5111f75fcbd38475061817da174417e895035a2c - Build
    freetype/2.13.2#dfa3d504cae4a08d5c72113bd6f28498:e330c50f2282b52b1e8c940d2a52e0feefd439c9 - Build
    jbig/20160605#2d29fa02aacd76902e0d2cbbc24631ef:7aa3306c64e5b5d75c91240c370520803ad5b6f0 - Build
    libdeflate/1.19#3ea74a4549efc14d4b1202dc4bfbf602:2ee39e692ca4177b4b689b15bc1f2cfdf8f83706 - Build
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:78a12b7eac927f6ca195df48d2dacb88e09c966c - Build
    libjpeg/9e#68269859e4325ddc3f995d1fd3fc9187:78a12b7eac927f6ca195df48d2dacb88e09c966c - Build
    libpng/1.6.39#dcb378460e3ed9d5d5b14c5b66e9599e:d3fc8860124b4408dd9fa2f6e434d69d80be9122 - Build
    libtiff/4.4.0#feb03470cd8556afca2d42ae45a7b1e6:824a4455a6c16d547796bbc0830b7f4b7299ba84 - Build
    libwebp/1.3.2#52f69c4a31c5cf033fdd9230d77a8e38:4a23900e07eb8f1d3305b7aa3139a424b81b87ba - Build
    libxml2/2.10.3#47e6e3029c72aeee50e7bc4e01e3f59b:c2d3e2f07e400e849932d32144183f81f2906c06 - Build
    openssl/1.1.1s#3eeebc156917046ee80533dbbb8f4671:8c669e839e24dfe64b8bdb23c9fe892a981b9dc7 - Build
    xz_utils/5.4.5#a26a2d42ab9c3dabc151bbe1bf898e53:2ee39e692ca4177b4b689b15bc1f2cfdf8f83706 - Build
    zlib/1.2.13#4e74ebf1361fe6fb60326f473f276eb5:78a12b7eac927f6ca195df48d2dacb88e09c966c - Build
    zstd/1.5.5#b87dc3b185caa4b122979ac4ae8ef7e8:76dad4e6c83dde347fd81bafee7e53584d62846e - Build
Build requirements
    gperf/3.1#1d622ad9717e9348ed3685c9994ad0b9:acb0de3fa200946ccb6fd230a468a074f200f1da - Build
    meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19:da39a3ee5e6b4b0d3255bfef95601890afd80709#97f4a23dd2d942f83e5344b1ca496ce7 - Cache
    meson/1.2.3#aad1203ff72cd2dd1b43e5dfad9783a1:da39a3ee5e6b4b0d3255bfef95601890afd80709#fa41634f4bb79e8b8ceae8ff1d3b0151 - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21:acb0de3fa200946ccb6fd230a468a074f200f1da - Build
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b:4f023e966ab960b2ab0d9183ab857706f25cc79f - Build
    pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605:4f023e966ab960b2ab0d9183ab857706f25cc79f - Build

======== Installing packages ========
brotli/1.1.0: Already installed! (1 of 23)
bzip2/1.0.8: Already installed! (2 of 23)
expat/2.6.0: Already installed! (3 of 23)

-------- Installing package gperf/3.1 (4 of 23) --------
gperf/3.1: Building from source
gperf/3.1: Package gperf/3.1:acb0de3fa200946ccb6fd230a468a074f200f1da
gperf/3.1: Copying sources to build folder
gperf/3.1: Building your package in /Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b
gperf/3.1: Calling generate()
gperf/3.1: Generators folder: /Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/build-release/conan
gperf/3.1: Generating aggregated env files
gperf/3.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
gperf/3.1: Calling build()
gperf/3.1: Apply patch (file): patches/0001-remove-register-keyword.patch
gperf/3.1: Calling:
 > "/Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/src/configure" --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
gperf/3.1: RUN: "/Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/src/configure" --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
checking whether make sets $(MAKE)... yes
configure: creating ./config.status
config.status: creating Makefile
=== configuring in lib (/Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/src/lib)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/'  '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --cache-file=/dev/null --srcdir=.
checking whether make sets $(MAKE)... yes
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/src/lib':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
configure: error: ./configure failed for lib

gperf/3.1: ERROR: 
Package 'acb0de3fa200946ccb6fd230a468a074f200f1da' build failed
gperf/3.1: WARN: Build folder /Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/src
ERROR: gperf/3.1: Error in build() method, line 83
    autotools.configure()
    ConanException: Error 1 while executing

Here's the config.log file for gperf:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --disable-option-checking --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --cache-file=/dev/null --srcdir=.

## --------- ##
## Platform. ##
## --------- ##

hostname = Tarlans-MacBook-Pro.local
uname -m = arm64
uname -r = 23.1.0
uname -s = Darwin
uname -v = Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000

/usr/bin/uname -p = arm
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000
Kernel configured for up to 10 processors.
10 processors are physically available.
10 processors are logically available.
Processor type: arm64e (ARM64E)
Processors active: 0 1 2 3 4 5 6 7 8 9
Primary memory available: 16.00 gigabytes
Default processor set: 726 tasks, 3117 threads, 10 processors
Load average: 2.22, Mach factor: 7.76
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /opt/homebrew/bin
PATH: /opt/homebrew/sbin
PATH: /usr/local/bin
PATH: /System/Cryptexes/App/usr/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
PATH: /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
PATH: /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
PATH: /Library/Apple/usr/bin
PATH: /usr/local/share/dotnet
PATH: ~/.dotnet/tools
PATH: ~/Documents/PDF_Signing/j2objc/dist
PATH: /opt/apache-maven-3.3.3/bin
PATH: /Users/tarlanismayilsoy/.rvm/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1857: checking whether make sets $(MAKE)
configure:1879: result: yes
configure:1936: checking for gcc
configure:1963: result: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
configure:2192: checking for C compiler version
configure:2201: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version >&5
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:2212: $? = 0
configure:2201: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v >&5
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:2212: $? = 0
configure:2201: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:2212: $? = 1
configure:2201: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:2212: $? = 1
configure:2232: checking whether the C compiler works
configure:2254: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -O3 -mios-version-min=15.0  -DNDEBUG  -mios-version-min=15.0 conftest.c  >&5
configure:2258: $? = 0
configure:2306: result: yes
configure:2309: checking for C compiler default output file name
configure:2311: result: a.out
configure:2317: checking for suffix of executables
configure:2324: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o conftest  -O3 -mios-version-min=15.0  -DNDEBUG  -mios-version-min=15.0 conftest.c  >&5
configure:2328: $? = 0
configure:2350: result: 
configure:2372: checking whether we are cross compiling
configure:2380: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o conftest  -O3 -mios-version-min=15.0  -DNDEBUG  -mios-version-min=15.0 conftest.c  >&5
configure:2384: $? = 0
configure:2391: ./conftest
./configure: line 2393: 10651 Killed: 9               ./conftest$ac_cv_exeext
configure:2395: $? = 137
configure:2402: error: in `/Users/tarlanismayilsoy/.conan2/p/b/gperf27f1a48b67b34/b/src/lib':
configure:2404: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=' -O3 -mios-version-min=15.0'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=' -DNDEBUG'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value=' -stdlib=libc++ -O3 -mios-version-min=15.0'
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=' -mios-version-min=15.0'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_ac_ct_CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang'
CFLAGS=' -O3 -mios-version-min=15.0'
CPP=''
CPPFLAGS=' -DNDEBUG'
CXX='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++'
CXXCPP=''
CXXFLAGS=' -stdlib=libc++ -O3 -mios-version-min=15.0'
DEFS=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EXEEXT=''
INSTALL=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
LDFLAGS=' -mios-version-min=15.0'
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SET_MAKE=''
SHELL='/bin/sh'
ac_ct_CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang'
ac_ct_CXX=''
bindir='${prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='${prefix}/include'
pdfdir='${docdir}'
prefix='/'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${prefix}/bin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 1

Solution

  • The issue was that the profiles were inverted. Changing the places of default-ios and default solved the problem. Thanks for the comments!

    Note: I also had to change the [generators] inside my conanfile.txt to make it work after fixing this error. The value was cmake_find_package and it was supposed to be XcodeToolchain.