conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
950 stars 1.73k forks source link

[package] boost/1.80.0: cross compilation with MinGW fails #14880

Closed Enhex closed 1 year ago

Enhex commented 1 year ago

Description

it seems that a recent change to the Boost recipe broke MinGW compilation.

it used to work fine until few days ago for me. today I downloaded a new version of the Boost recipe using conan install -u, and I'm getting g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? errors.

It seems that it uses the regular g++ compiler instead of the MinGW one, ignoring the cross-compile host profile.

Package and Environment Details

Conan profile

-pr:b=default

[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=12.2
compiler.libcxx=libstdc++11
build_type=Release
[options]
[conf]
[build_requires]
[env]

-pr:h=linux_to_win64

[settings]
os=Windows
arch=x86_64
compiler=gcc
compiler.version=12.2
compiler.libcxx=libstdc++11
build_type=Release
[options]
[conf]
[build_requires]
[env]
CONAN_CMAKE_FIND_ROOT_PATH=/usr/x86_64-w64-mingw32 # Adjust this path  # Optional, for CMake to find things in that folder
CONAN_CMAKE_SYSROOT=/usr/x86_64-w64-mingw32 # Adjust this path  # Optional, if we want to define sysroot
CHOST=x86_64-w64-mingw32
AR=x86_64-w64-mingw32-ar
AS=x86_64-w64-mingw32-as
RANLIB=x86_64-w64-mingw32-ranlib
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-g++
STRIP=x86_64-w64-mingw32-strip
RC=x86_64-w64-mingw32-windres

Steps to reproduce

conan install boost/1.80.0@ -pr:h=linux_to_win64 -pr:b=default --build=outdated -u

Logs

Click to expand log ``` Configuration (profile_host): [settings] arch=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++11 compiler.version=12.2 os=Windows [options] [build_requires] [env] AR=x86_64-w64-mingw32-ar AS=x86_64-w64-mingw32-as CC=x86_64-w64-mingw32-gcc CHOST=x86_64-w64-mingw32 CONAN_CMAKE_FIND_ROOT_PATH=/usr/x86_64-w64-mingw32 # Adjust this path # Optional, for CMake to find things in that folder CONAN_CMAKE_SYSROOT=/usr/x86_64-w64-mingw32 # Adjust this path # Optional, if we want to define sysroot CXX=x86_64-w64-mingw32-g++ RANLIB=x86_64-w64-mingw32-ranlib RC=x86_64-w64-mingw32-windres STRIP=x86_64-w64-mingw32-strip Configuration (profile_build): [settings] arch=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++11 compiler.version=12.2 os=Linux [options] [build_requires] [env] bzip2/1.0.8: WARN: Can't update, no package in remote bzip2/1.0.8: Package is up to date zlib/1.2.13: WARN: Can't update, no package in remote zlib/1.2.13: Package is up to date b2/4.9.2: Package is up to date Installing package: boost/1.80.0 Requirements boost/1.80.0 from 'conancenter' - Cache bzip2/1.0.8 from 'conancenter' - Cache zlib/1.2.13 from 'conancenter' - Cache Packages boost/1.80.0:6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2 - Build bzip2/1.0.8:96b5dc9e94773bf79ec47f298dd00c4df54e6bad - Cache zlib/1.2.13:41cffd99b7d2f80972a6fdb1ee7dea0da331a019 - Cache Build requirements b2/4.9.2 from 'conancenter' - Cache Build requirements packages b2/4.9.2:4db1be536558d833e52e862fd84d64d75c2b3656 - Cache Cross-build from 'Linux:x86_64' to 'Windows:x86_64' Installing (downloading, building) binaries... b2/4.9.2: Already installed! bzip2/1.0.8: Already installed! zlib/1.2.13: Already installed! boost/1.80.0: Applying build-requirement: b2/4.9.2 boost/1.80.0: Building your package in /home/desktop/.conan/data/boost/1.80.0/_/_/build/6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2 boost/1.80.0: Generator txt created conanbuildinfo.txt boost/1.80.0: Calling generate() boost/1.80.0: Aggregating env generators boost/1.80.0: Calling build() boost/1.80.0: WARN: replace_in_file didn't find pattern '$(>) > $(<)' in '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/libs/stacktrace/build/Jamfile.v2' file. boost/1.80.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.80.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.80.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.80.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.80.0: WARN: replace_in_file didn't find pattern ' @numa' in '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/libs/fiber/build/Jamfile.v2' file. boost/1.80.0: WARN: Patching user-config.jam boost/1.80.0: WARN: using zlib : 1.2.13 : "/home/desktop/.conan/data/zlib/1.2.13/_/_/package/41cffd99b7d2f80972a6fdb1ee7dea0da331a019/include" "/home/desktop/.conan/data/zlib/1.2.13/_/_/package/41cffd99b7d2f80972a6fdb1ee7dea0da331a019/lib" z ; using bzip2 : 1.0.8 : "/home/desktop/.conan/data/bzip2/1.0.8/_/_/package/96b5dc9e94773bf79ec47f298dd00c4df54e6bad/include" "/home/desktop/.conan/data/bzip2/1.0.8/_/_/package/96b5dc9e94773bf79ec47f298dd00c4df54e6bad/lib" bz2 ; using "gcc" : : /usr/local/bin/g++ : ; boost/1.80.0: Cross building, detecting compiler... boost/1.80.0: Cross building flags: [] boost/1.80.0: WARN: b2 -q numa=on target-os=windows architecture=x86 address-model=64 binary-format=pe abi=ms --layout=system --user-config=/home/desktop/.conan/data/boost/1.80.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=off --disable-iconv 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-wave toolset=gcc define=_GLIBCXX_USE_CXX11_ABI=1 pch=on linkflags="" cxxflags="-fPIC" install --prefix=/home/desktop/.conan/data/boost/1.80.0/_/_/package/6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2 -j32 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/desktop/.conan/data/boost/1.80.0/_/_/build/6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2/build-release" notice: found boost-build.jam at /home/desktop/.conan/data/boost/1.80.0/_/_/source/src/boost-build.jam notice: loading B2 from /home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel/bootstrap.jam notice: Searching '/etc' '/home/desktop' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/util' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/build' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/tools' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/contrib' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/.' for site-config configuration file 'site-config.jam'. notice: Configuration file 'site-config.jam' not found in '/etc' '/home/desktop' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/util' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/build' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/tools' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/contrib' '/home/desktop/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/.'. notice: Loading explicitly specified user configuration file: /home/desktop/.conan/data/boost/1.80.0/_/_/source/src/tools/build/user-config.jam notice: Searching '/home/desktop/.conan/data/boost/1.80.0/_/_/source/src/tools/build' for user-config configuration file 'user-config.jam'. notice: Loading user-config configuration file 'user-config.jam' from '/home/desktop/.conan/data/boost/1.80.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/local/bin/g++' for gcc, condition gcc-12 notice: using gcc libraries :: gcc-12 :: /usr/local/bin /usr/local/lib /usr/local/lib32 /usr/local/lib64 notice: using gcc archiver :: gcc-12 :: ar warning: toolset gcc initialization: can not find tool windres warning: initialized from /home/desktop/.conan/data/boost/1.80.0/_/_/source/src/tools/build/user-config.jam:5 notice: using rc compiler :: gcc-12 :: 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 enabled Performing configuration checks - default address-model : none [1] - default architecture : none [1] - compiler supports SSE2 : no [2] - compiler supports SSE4.1 : no [2] - has synchronization.lib : no [2] - has std::atomic_ref : no [2] - has statx : no [2] - has statx syscall : no [2] - has BCrypt API : no [2] - is Windows CE : no [2] - has init_priority attribute : no [2] - has stat::st_blksize : no [2] - has stat::st_mtim : no [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) : no [2] - has POSIX *at APIs : no [2] - cxx11_auto_declarations : no [2] - cxx11_constexpr : no [2] - cxx11_defaulted_functions : no [2] - cxx11_final : no [2] - cxx11_hdr_mutex : no [2] - cxx11_hdr_tuple : no [2] - cxx11_lambdas : no [2] - cxx11_noexcept : no [2] - cxx11_nullptr : no [2] - cxx11_rvalue_references : no [2] - cxx11_template_aliases : no [2] - cxx11_thread_local : no [2] - cxx11_variadic_templates : no [2] - cxx11_auto_declarations : no [3] - cxx11_constexpr : no [3] - cxx11_defaulted_functions : no [3] - cxx11_final : no [3] - cxx11_hdr_mutex : no [3] - cxx11_hdr_tuple : no [3] - cxx11_lambdas : no [3] - cxx11_noexcept : no [3] - cxx11_nullptr : no [3] - cxx11_rvalue_references : no [3] - cxx11_template_aliases : no [3] - cxx11_thread_local : no [3] - cxx11_variadic_templates : no [3] - has_icu builds : no [2] - zlib : no [4] - bzip2 : no [4] warning: Boost.Json was explicitly requested, but will not be built, because it requires C++11. note: To enable C++11 support, use the 'cxxstd=11' command line argument. - cxx11_decltype : no [2] - cxx11_basic_alignas : no [2] - cxx11_decltype : no [3] - cxx11_basic_alignas : no [3] - native atomic int32 supported : no [2] - has message compiler : no [2] - native syslog supported : no [2] - pthread supports robust mutexes : no [2] - compiler supports SSSE3 : no [2] - compiler supports AVX2 : no [2] - gcc visibility : no [2] - sfinae_expr : no [2] - cxx11_unified_initialization_syntax : no [2] - cxx11_hdr_initializer_list : no [2] - cxx11_hdr_chrono : no [2] - cxx11_numeric_limits : no [2] - cxx11_hdr_array : no [2] - cxx11_hdr_atomic : no [2] - cxx11_hdr_type_traits : no [2] - cxx11_allocator : no [2] - cxx11_explicit_conversion_operators : no [2] - gcc visibility : no [5] - cxx11_noexcept : no [5] - cxx11_rvalue_references : no [5] - sfinae_expr : no [5] - cxx11_auto_declarations : no [5] - cxx11_lambdas : no [5] - cxx11_unified_initialization_syntax : no [5] - cxx11_hdr_tuple : no [5] - cxx11_hdr_initializer_list : no [5] - cxx11_hdr_chrono : no [5] - cxx11_thread_local : no [5] - cxx11_constexpr : no [5] - cxx11_nullptr : no [5] - cxx11_numeric_limits : no [5] - cxx11_decltype : no [5] - cxx11_hdr_array : no [5] - cxx11_hdr_atomic : no [5] - cxx11_hdr_type_traits : no [5] - cxx11_allocator : no [5] - cxx11_explicit_conversion_operators : no [5] - cxx11_static_assert : no [2] - std::fstream is moveable and swappable : no [2] - Has Large File Support : no [2] - Has attribute init_priority : no [2] - cxx11_static_assert : no [3] - std::fstream is moveable and swappable : no [3] - Has Large File Support : no [3] - Has attribute init_priority : no [3] - libbacktrace builds : no [2] - libbacktrace builds : no [3] - addr2line builds : no [2] - addr2line builds : no [3] - WinDbg builds : no [2] - WinDbg builds : no [3] - WinDbgCached builds : no [2] - WinDbgCached builds : no [3] - BOOST_COMP_GNUC >= 4.3.0 : no [2] - cxx11_hdr_thread : no [2] - cxx11_hdr_regex : no [2] - cxx11_hdr_thread : no [3] - cxx11_hdr_regex : no [3] [1] gcc-12/trgt-os-wndws [2] gcc-12/rls/abi-ms/adrs-mdl-64/archt-x86/bnry-frmt-pe/bst.l-off/bst.l-off/lnk-sttc/nm-on/pythn-3.10/trgt-os-wndws/thrdp-wn32/thrd-mlt/vsblt-hdn [3] gcc-12/rls/abi-ms/adrs-mdl-64/archt-x86/bnry-frmt-pe/bst.l-off/bst.l-off/bld-no/lnk-sttc/nm-on/pythn-3.10/trgt-os-wndws/thrdp-wn32/thrd-mlt/vsblt-hdn [4] lnk-sttc [5] gcc-12/rls/abi-ms/adrs-mdl-64/archt-x86/bnry-frmt-pe/bst.l-off/bst.l-off/bld-no/lnk-sttc/nm-on/pch-off/pythn-3.10/trgt-os-wndws/thrdp-wn32/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 - wave : building g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? g++: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? ...failed updating 15 targets... boost/1.80.0: boost/1.80.0: ERROR: Package '6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2' build failed boost/1.80.0: WARN: Build folder /home/desktop/.conan/data/boost/1.80.0/_/_/build/6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2/build-release ERROR: boost/1.80.0: Error in build() method, line 850 self.run(full_command) ConanException: Error 1 while executing b2 -q numa=on target-os=windows architecture=x86 address-model=64 binary-format=pe abi=ms --layout=system --user-config=/home/desktop/.conan/data/boost/1.80.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=off --disable-iconv 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-wave toolset=gcc define=_GLIBCXX_USE_CXX11_ABI=1 pch=on linkflags="" cxxflags="-fPIC" install --prefix=/home/desktop/.conan/data/boost/1.80.0/_/_/package/6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2 -j32 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/desktop/.conan/data/boost/1.80.0/_/_/build/6ddff8f30ac0b6e6747a9e6a8f3ab8e074837dd2/build-release" ```
SpaceIm commented 1 year ago

It's not really a conan-center issue, but a lack of backward compatibility of conan new helpers. See https://github.com/conan-io/conan-center-index/issues/14767 & https://github.com/conan-io/conan-center-index/issues/14781

Enhex commented 1 year ago

thanks, adding this to the linux_to_win64 profile fixed the problem:

# for conan v2 recipes
[buildenv]
CHOST=$target_host
CC=$target_host-$cc_compiler
CXX=$target_host-$cxx_compiler

the documentation should be updated, otherwise it sets up people to failure.

SpaceIm commented 1 year ago

Do not hesitate to give your opinion in https://github.com/conan-io/conan-center-index/issues/14781