• conan入门(二十七):因profile [env]字段废弃导致的boost/1.81.0 在aarch64-linux-gnu下交叉编译失败


    今天在尝试用conan 1.60.0使用aarch64-linux-gnu编译器交叉编译boost/1.81.0时报错了:

    conan install boost/1.81.0@ -pr:h aarch64-linux-gnu.jinja -pr:b default --build boost
    
    • 1

    输出如下:

    Configuration (profile_host):
    [settings]
    arch=armv8
    arch_build=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=7
    os=Linux
    os_build=Linux
    [options]
    [build_requires]
    [env]
    AR=aarch64-linux-gnu-ar
    AS=aarch64-linux-gnu-as
    CC=aarch64-linux-gnu-gcc
    CHOST=aarch64-linux-gnu
    CONAN_CMAKE_GENERATOR=Unix Makefiles
    CONAN_CMAKE_TOOLCHAIN_FILE=/home/gyd/.conan/profiles/../cmake/aarch64-linux-gnu.toolchain.cmake
    CROSS_COMPILER_PREFIX=/opt/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu
    CXX=aarch64-linux-gnu-g++
    LD=aarch64-linux-gnu-ld
    RANLIB=aarch64-linux-gnu-ranlib
    STRIP=aarch64-linux-gnu-strip
    Configuration (profile_build):
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    os_build=Linux
    [options]
    [build_requires]
    [env]
    
    boost/1.81.0: Forced build from source
    Installing package: boost/1.81.0
    Requirements
        boost/1.81.0 from 'pub' - Cache
        bzip2/1.0.8 from 'pub' - Cache
        libbacktrace/cci.20210118 from 'pub' - Cache
        zlib/1.2.13 from 'pub' - Cache
    Packages
        boost/1.81.0:3aac81ffa04cca0028f0506d5a46ab398161b6d4 - Build
        bzip2/1.0.8:75c0a8a066a2422a4e85cba63decf52760f1010c - Cache
        libbacktrace/cci.20210118:8fd38d381db52e2495321ce060b9f457656f6c8f - Cache
        zlib/1.2.13:8fd38d381db52e2495321ce060b9f457656f6c8f - Cache
    Build requirements
        b2/4.9.6 from 'conancenter' - Cache
    Build requirements packages
        b2/4.9.6:4db1be536558d833e52e862fd84d64d75c2b3656 - Cache
    
    Cross-build from 'Linux:x86_64' to 'Linux:armv8'
    Installing (downloading, building) binaries...
    b2/4.9.6: Already installed!
    bzip2/1.0.8: Already installed!
    libbacktrace/cci.20210118: Already installed!
    zlib/1.2.13: Already installed!
    boost/1.81.0: Applying build-requirement: b2/4.9.6
    boost/1.81.0: WARN: Build folder is dirty, removing it: /home/gyd/.conan/data/boost/1.81.0/_/_/build/3aac81ffa04cca0028f0506d5a46ab398161b6d4
    boost/1.81.0: Building your package in /home/gyd/.conan/data/boost/1.81.0/_/_/build/3aac81ffa04cca0028f0506d5a46ab398161b6d4
    boost/1.81.0: Generator txt created conanbuildinfo.txt
    boost/1.81.0: Calling generate()
    boost/1.81.0: Aggregating env generators
    boost/1.81.0: Calling build()
    boost/1.81.0: WARN: replace_in_file didn't find pattern '$(>) > $(<)' in '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/libs/stacktrace/build/Jamfile.v2' file.
    boost/1.81.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
    boost/1.81.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
    boost/1.81.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build/src/tools/gcc.jam' file.
    boost/1.81.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build/src/tools/gcc.jam' file.
    boost/1.81.0: WARN: replace_in_file didn't find pattern '    @numa' in '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/libs/fiber/build/Jamfile.v2' file.
    boost/1.81.0: WARN: Patching user-config.jam
    boost/1.81.0: WARN: 
    using zlib : 1.2.13 : "/home/gyd/.conan/data/zlib/1.2.13/_/_/package/8fd38d381db52e2495321ce060b9f457656f6c8f/include" "/home/gyd/.conan/data/zlib/1.2.13/_/_/package/8fd38d381db52e2495321ce060b9f457656f6c8f/lib" z ;
    using bzip2 : 1.0.8 : "/home/gyd/.conan/data/bzip2/1.0.8/_/_/package/75c0a8a066a2422a4e85cba63decf52760f1010c/include" "/home/gyd/.conan/data/bzip2/1.0.8/_/_/package/75c0a8a066a2422a4e85cba63decf52760f1010c/lib" bz2 ;
    using "gcc" :  :  "/usr/bin/g++" : 
    "-I/home/gyd/.conan/data/libbacktrace/cci.20210118/_/_/package/8fd38d381db52e2495321ce060b9f457656f6c8f/include" "-L/home/gyd/.conan/data/libbacktrace/cci.20210118/_/_/package/8fd38d381db52e2495321ce060b9f457656f6c8f/lib"  ;
    boost/1.81.0: Cross building, detecting compiler...
    boost/1.81.0: Cross building flags: []
    boost/1.81.0: WARN: b2 -q numa=on target-os=linux architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=gcc define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sLIBBACKTRACE_PATH=/home/gyd/.conan/data/libbacktrace/cci.20210118/_/_/package/8fd38d381db52e2495321ce060b9f457656f6c8f linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/gyd/.conan/data/boost/1.81.0/_/_/package/3aac81ffa04cca0028f0506d5a46ab398161b6d4 -j4 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/gyd/.conan/data/boost/1.81.0/_/_/build/3aac81ffa04cca0028f0506d5a46ab398161b6d4/build-release"
    notice: found boost-build.jam at /home/gyd/.conan/data/boost/1.81.0/_/_/source/src/boost-build.jam
    notice: loading B2 from /home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel/bootstrap.jam
    notice: Searching '/etc' '/home/gyd' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/util' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/build' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/tools' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/contrib' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/.' for site-config configuration file 'site-config.jam'.
    notice: Configuration file 'site-config.jam' not found in '/etc' '/home/gyd' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/util' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/build' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/tools' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/contrib' '/home/gyd/.conan/data/b2/4.9.6/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/.'.
    notice: Loading explicitly specified user configuration file:
        /home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build/user-config.jam
    notice: Searching '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build' for user-config configuration file 'user-config.jam'.
    notice: Loading user-config configuration file 'user-config.jam' from '/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build'.
    notice: [zlib] Using pre-installed library
    notice: [zlib] Condition
    notice: [bzip2] Using pre-installed library
    notice: [bzip2] Condition
    notice: will use '/usr/bin/g++' for gcc, condition gcc-11
    notice: using gcc libraries :: gcc-11 :: /usr/bin /usr/lib /usr/lib32 /usr/lib64
    notice: using gcc archiver :: gcc-11 :: /usr/bin/ar
    warning: toolset gcc initialization: can not find tool windres
    warning: initialized from /home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build/user-config.jam:5
    notice: using rc compiler :: gcc-11 :: /usr/bin/as
    notice: [zlib] zlib is already configured
    notice: [bzip2] bzip is already configured
    notice: iostreams: not using lzma compression 
    notice: iostreams: not using zstd compression 
    notice: [python-cfg] Configuring python...
    notice: [python-cfg] Checking interpreter command "python"...
    notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
    notice: [python-cfg] ...requested configuration matched!
    notice: [python-cfg] Details of this Python configuration:
    notice: [python-cfg]   interpreter command: "python"
    notice: [python-cfg]   include path: "/usr/include/python3.10"
    notice: [python-cfg]   library path: "/usr/lib/python3.10/config" "/usr/lib"
    notice: [python-cfg] Checking for NumPy...
    notice: [python-cfg] running command 'python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
    notice: [python-cfg] NumPy disabled. Reason:
    notice: [python-cfg]   python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())" aborted with 
    notice: [python-cfg]   Traceback (most recent call last):
      File "", line 1, in 
    ModuleNotFoundError: No module named 'numpy'
    Performing configuration checks
    
        - default address-model    : 64-bit [1]
        - default architecture     : x86 [1]
        - has std::atomic_ref      : no [2]
        - has statx                : yes [2]
        - has init_priority attribute : yes [2]
        - has stat::st_blksize     : yes [2]
        - has stat::st_mtim        : yes [2]
        - has stat::st_mtimensec   : no [2]
        - has stat::st_mtimespec   : no [2]
        - has stat::st_birthtim    : no [2]
        - has stat::st_birthtimensec : no [2]
        - has stat::st_birthtimespec : no [2]
        - has fdopendir(O_NOFOLLOW) : yes [2]
        - has POSIX *at APIs       : yes [2]
        - cxx11_auto_declarations  : yes [2]
        - cxx11_constexpr          : yes [2]
        - cxx11_defaulted_functions : yes [2]
        - cxx11_final              : yes [2]
        - cxx11_hdr_mutex          : yes [2]
        - cxx11_hdr_tuple          : yes [2]
        - cxx11_lambdas            : yes [2]
        - cxx11_noexcept           : yes [2]
        - cxx11_nullptr            : yes [2]
        - cxx11_rvalue_references  : yes [2]
        - cxx11_template_aliases   : yes [2]
        - cxx11_thread_local       : yes [2]
        - cxx11_variadic_templates : yes [2]
        - has_icu builds           : no [2]
        - zlib                     : yes [3]
        - bzip2                    : no [3]
        - cxx11_decltype           : yes [2]
        - cxx11_basic_alignas      : yes [2]
        - iconv (libc)             : yes [2]
        - cxx11_defaulted_moves    : yes [2]
        - cxx11_hdr_functional     : yes [2]
        - cxx11_hdr_type_traits    : yes [2]
        - cxx11_override           : yes [2]
        - cxx11_range_based_for    : yes [2]
        - cxx11_scoped_enums       : yes [2]
        - cxx11_smart_ptr          : yes [2]
        - cxx11_static_assert      : yes [2]
        - native atomic int32 supported : yes [2]
        - native syslog supported  : yes [2]
        - pthread supports robust mutexes : yes [2]
        - lockfree boost::atomic_flag : yes [2]
        - gcc visibility           : yes [2]
        - sfinae_expr              : yes [2]
        - cxx11_unified_initialization_syntax : yes [2]
        - cxx11_hdr_initializer_list : yes [2]
        - cxx11_hdr_chrono         : yes [2]
        - cxx11_numeric_limits     : yes [2]
        - cxx11_hdr_array          : yes [2]
        - cxx11_hdr_atomic         : yes [2]
        - cxx11_allocator          : yes [2]
        - cxx11_explicit_conversion_operators : yes [2]
        - long double support      : yes [2]
        - std::fstream is moveable and swappable : yes [2]
        - Has Large File Support   : yes [2]
        - Has attribute init_priority : yes [2]
        - libbacktrace builds      : yes [2]
        - addr2line builds         : yes [2]
        - WinDbg builds            : no [2]
        - WinDbg builds            : no [4]
        - WinDbgCached builds      : no [2]
        - WinDbgCached builds      : no [4]
        - BOOST_COMP_GNUC >= 4.3.0 : yes [2]
        - cxx11_hdr_thread         : yes [2]
        - cxx11_hdr_regex          : yes [2]
    
    [1] gcc-11
    [2] gcc-11/rls/abi-apcs/archt-arm/bst.l-lbc/bst.l-on/bst.l-off/lnk-sttc/nm-on/pythn-3.10/thrdp-pthrd/thrd-mlt/vsblt-hdn
    [3] lnk-sttc
    [4] gcc-11/rls/abi-apcs/archt-arm/bst.l-lbc/bst.l-on/bst.l-off/bld-no/lnk-sttc/nm-on/pythn-3.10/thrdp-pthrd/thrd-mlt/vsblt-hdn
    
    Component configuration:
    
        - atomic                   : building
        - chrono                   : building
        - container                : building
        - context                  : building
        - contract                 : building
        - coroutine                : building
        - date_time                : building
        - exception                : building
        - fiber                    : building
        - filesystem               : building
        - graph                    : building
        - graph_parallel           : not building
        - headers                  : not building
        - iostreams                : building
        - json                     : building
        - locale                   : building
        - log                      : building
        - math                     : building
        - mpi                      : not building
        - nowide                   : building
        - program_options          : building
        - python                   : not building
        - random                   : building
        - regex                    : building
        - serialization            : building
        - stacktrace               : building
        - system                   : building
        - test                     : building
        - thread                   : building
        - timer                    : building
        - type_erasure             : building
        - url                      : building
        - wave                     : building
    
    make_arm64_aapcs_elf_gas.S: Assembler messages:
    make_arm64_aapcs_elf_gas.S:61: Error: too many memory references for `and'
    make_arm64_aapcs_elf_gas.S:64: Error: too many memory references for `sub'
    make_arm64_aapcs_elf_gas.S:68: Error: too many memory references for `str'
    make_arm64_aapcs_elf_gas.S:72: Error: no such instruction: `adr x1,finish'
    make_arm64_aapcs_elf_gas.S:73: Error: too many memory references for `str'
    make_arm64_aapcs_elf_gas.S:75: Error: unsupported syntax for `ret'
    make_arm64_aapcs_elf_gas.S:79: Error: expecting operand after ','; got nothing
    make_arm64_aapcs_elf_gas.S:81: Error: no such instruction: `bl _exit'
    ...failed updating 1 target...
    boost/1.81.0: 
    boost/1.81.0: ERROR: Package '3aac81ffa04cca0028f0506d5a46ab398161b6d4' build failed
    boost/1.81.0: WARN: Build folder /home/gyd/.conan/data/boost/1.81.0/_/_/build/3aac81ffa04cca0028f0506d5a46ab398161b6d4/build-release
    ERROR: boost/1.81.0: Error in build() method, line 887
    	self.run(full_command)
    	ConanException: Error 1 while executing b2 -q numa=on target-os=linux architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/home/gyd/.conan/data/boost/1.81.0/_/_/source/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=gcc define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sLIBBACKTRACE_PATH=/home/gyd/.conan/data/libbacktrace/cci.20210118/_/_/package/8fd38d381db52e2495321ce060b9f457656f6c8f linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/gyd/.conan/data/boost/1.81.0/_/_/package/3aac81ffa04cca0028f0506d5a46ab398161b6d4 -j4 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/gyd/.conan/data/boost/1.81.0/_/_/build/3aac81ffa04cca0028f0506d5a46ab398161b6d4/build-release"
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249

    从后面这段可以看出是编译器在编译arm64汇编代码时出错了
    在这里插入图片描述
    如果编译器设置正确应该不会出现这个错误,于是从输出日志再往上找我又找到了这段
    在这里插入图片描述
    果然是使用本机编译器g++而不是交叉编译aarch64-linux-gnu-g++

    boost是由b2执行编译的,使用哪个编译器由环境变量CC来决定,CC定义在profile,所以问题应该出在profile.

    如下是执行aarch64-linux-gnu交叉编译使用的profile,
    aarch64-linux-gnu.jinja

    include(default)
    target_host=aarch64-linux-gnu
    [settings]
    arch=armv8
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=5.4
    os=Linux
    [options]
    [env]
    CHOST=$target_host
    CC=$target_host-gcc
    CXX=$target_host-g++
    AR=$target_host-ar
    AS=$target_host-as
    RANLIB=$target_host-ranlib
    LD=$target_host-ld
    STRIP=$target_host-strip
    #########################################################################################
    # 指定./conan/cmake/aarch64-linux-gnu.toolchain.cmake 为cmake 工具链文件             #
    #########################################################################################
    {% set toolchain = os.path.join(profile_dir, "..","cmake","aarch64-linux-gnu.toolchain.cmake") %}
    CONAN_CMAKE_TOOLCHAIN_FILE={{ toolchain }}
    CONAN_CMAKE_GENERATOR="Unix Makefiles"
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25

    这个profile是我一年前写的,当时可以正确执行交叉编译,当然了,那个时候使用的conan 版本是1.45.0,一年多过去了,conan的版本迭代很快,目前我使用的是conan 1.x的接近最新版本1.60.0(1.x下当前最新版本是1.60.2),
    会不会是因为版本更新来带的兼容性问题呢?
    打开conan官方文档profile相关的页面 https://docs.conan.io/1/reference/profiles.html
    第一眼就看到了这个
    在这里插入图片描述
    原来profile中的[env]字段名被废弃了,改为了[buildenv],
    再看[buildenv]的说明:从1.35.0开始新增加了这个字段,用于替换[env]
    在这里插入图片描述

    立即把上面aarch64-linux-gnu.jinja profile中的[env]改为[buildenv]再如下执行boost交叉编译通过

    conan install boost/1.81.0@ -pr:h aarch64-linux-gnu.jinja -pr:b default --build boost
    
    • 1

    conan系列文章

    《conan入门(一):conan 及 JFrog Artifactory 安装》
    《conan入门(二):conan 服务配置-密码管理及策略》
    《conan入门(三):上传预编译的库(artifact)》
    《conan入门(四):conan 引用第三方库示例》
    《conan入门(五):conan 交叉编译引用第三方库示例》
    《conan入门(六):conanfile.txt conanfile.py的区别》
    《conan入门(七):将自己的项目生成conan包》
    《conan入门(八):交叉编译自己的conan包项目》
    《conan入门(九):NDK交叉编译自己的conan包项目塈profile的定义》
    《conan入门(十):Windows下Android NDK交叉编译Boost》
    《conan入门(十一):Linux下Android NDK交叉编译Boost》
    《conan入门(十二):Windows NDK 编译 boost报错:CMake was unable to find a build program … MinGW Makefile》
    《conan入门(十三):conan info 命令的基本用法》
    《conan入门(十四):conan new 命令的新特性–模板功能(–template)》
    《conan入门(十五):AttributeError: ‘CMake‘ object has no attribute ‘definitions‘》
    《conan入门(十六):profile template功能实现不同平台下profile的统一》
    《conan入门(十七):支持android NDK (armv7,armv8,x86,x86_64)交叉编译的统一profile jinja2模板》
    《conan入门(十八):Cannot recognize the Windows subsystem, install MSYS2/cygwin or specify a build_require》
    《conan入门(十九):封装第三方开源库cpp_redis示例》
    《conan入门(二十):封装只包含头文件(header_only)的库示例》
    《conan入门(二十一):解决MinGW编译Openssl的编译错误:crypto/dso/dso_win32.c》
    《conan入门(二十二):编译 openssl要求python 3.7以上版本》
    《conan入门(二十三):Windows下MinGW编译libcurl》
    《conan入门(二十四):通过CONAN_DISABLE_CHECK_COMPILER禁用编译器检查》
    《conan入门(二十五):imports将包安装到本地项目或其他指定位置》
    《conan入门(二十六):使用make编译makefile》
    《conan入门(二十七):因profile [env]字段废弃导致的boost/1.81.0 在aarch64-linux-gnu下交叉编译失败》
    《conan入门(二十八):解决conan 1.60.0下 arch64-linux-gnu交叉编译openssl/3.1.2报错问题》
    《conan入门(二十九):对第三方库mnn进行Conan封装塈conans.CMake和conan.tools.cmake.CMake的区别》
    《conan入门(三十):对腾讯ncnn进行Conan封装》
    《conan入门(三十一):在命令行(shell)中从profile中读取配置参数》
    《conan 入门(三十二):package_info中配置禁用CMakeDeps生成使用项目自己生成的config.cmake》
    《conan 入门(三十三):requirements()指定header的可见性(transitive_headers)》
    《conan 入门(三十四):conan 2.x实现对只有Makefile的项目(erpcgen)的封装示例》
    《conan 入门(三十五):在conanfile.py中获取C++编译器完整路径的方法》
    《conan入门(三十六):在set_version方法中从pom.xml中读取版本号实现动态版本定义》
    《conan 入门(三十七):conan 2.x通过定义环境变量(environment)执行make编译只有Makefile的项目(erpcgen)》
    《conan 入门(三十八):conan二进制包的兼容性及自定义package_id的方式》
    《conan入门(三十九):conan 2.x 引用第三方库示例》

  • 相关阅读:
    1.9 关于小红书账号定位,这里有一整套定位方案【玩赚小红书】
    总结js中常见的层次选择器
    城市天气预报查询易语言代码
    图像预处理工具_CogPolarUnwrapTool
    从0到1实现python基于RPC协议的接口自动化测试
    【Vue3 源码解析】v-model 和 emit
    JavaScript (上篇)
    合并文件解决HiveServer2内存溢出方案
    pcsx2模拟器怎么设置流畅?
    基于JavaSwing开发远程控制系统 课程设计 大作业源码 毕业设计
  • 原文地址:https://blog.csdn.net/10km/article/details/133158133