Closed Buckskin closed 2 years ago
hard to say, can you build with -o boost:debug_level=1
or higher?
Hi - Thanks a ton. When I build with the debug_level I do see a bunch of compilation errors - they are all the same however:
error: 'mutex' in namespace 'std' does not name a type std::mutex m_mutex; ^~~~~
and:
error: 'mutex' is not a member of 'std'
std::lock_guard
(after a quick web search...) I wonder if I need to install a different MingW setup with a different threading model (like pthreads instead of win32?). Hmmm ...
Here is the more detailed log:
seems like it needs C++11, try settings cppstd=11
in your profile
seems like it needs C++11, try settings cppstd=11 in your profile
Same error. I will now try to install the most recent mingw-64 -- and make sure to select the posix threading model. Let's see ...
not sure if it's still accurate: https://stackoverflow.com/a/66601034 seems like they do not fully support C++11 in some modes (at least it was so in MinGW 5.3.0)
one workaround could be to disable threading, if you don't need it (BOOST_DISABLE_THREADS
):
https://www.boost.org/doc/libs/1_76_0/libs/config/doc/html/index.html#boost_config.configuring_boost_for_your_platform.user_settable_options
alternatively, you can build without boost::math
, if it's not needed (-o boost:without_math=True
option)
I will now try to install the most recent mingw-64 -- and make sure to select the posix threading model. Let's see ...
I tried the most recent mingw-64: x86_64-8.1.0-posix-seh-rt_v6-rev0.
conan profile show default
or conan profile show <profile>
if custom profile is in use)[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8.1
compiler.libcxx=libstdc++11
compiler.exception=seh
compiler.threads=posix
build_type=Release
[options]
[build_requires]
[env]
It solved the mutex errors but now I get a new error.
gcc.compile.c++ C:.conan\55fe32\1\boost\bin.v2\libs\fiber\build\gcc-8\rls\lnk-sttc\nm-on\thrd-mlt\vsblt-hdn\numa\windows\pin_thread.o libs\fiber\src\numa\windows\pin_thread.cpp: In function 'void boost::fibers::numa::pin_thread(uint32_t)': libs\fiber\src\numa\windows\pin_thread.cpp:26:42: error: invalid conversion from 'HANDLE' {aka 'void*'} to 'std::thread::native_handle_type' {aka 'long long unsigned int'} [-fpermissive] pin_thread( cpuid, ::GetCurrentThread() );
> alternatively, you can build without boost::math, if it's not needed (-o boost:without_math=True option)
Gives me this error:
`ERROR: There are invalid packages (packages that cannot exist for this configuration):
boost/1.77.0: Invalid ID: graph requires ['math', 'random', 'regex', 'serialization']: math is disabled
`
Is there a way to find a list of '-o boost' options? I am trying to learn how to set 'BOOST_DISABLE_THREADS'.
error: invalid conversion from 'HANDLE' {aka 'void*'} to 'std:🧵:native_handle_type' {aka 'long long unsigned int'}
This seems related but I am not sure how to set 'numa=on':
This seems related but I am not sure how to set 'numa=on':
Found it: '-o boost:numa=True'
But received the same error.
This seems related but I am not sure how to set 'numa=on': there is an option for it, it's called
numa
Is there a way to find a list of '-o boost' options? I am trying to learn how to set 'BOOST_DISABLE_THREADS'. you may use conan inspect:
$ conan inspect boost/1.77.0@ -a options
there is also super-useful (especially for testing) option called extra_b2_flags
which allows to propagate arbitrary b2 flags, e.g.:
-o boost:extra_b2_flags="numa=on"
or
-o boost:extra_b2_flags="defines=BOOST_DISABLE_THREADS"
Might be the same issue than https://github.com/conan-io/conan-center-index/issues/4764
Workaround: disable fiber (-o boost:without_fiber=True
) https://github.com/conan-io/conan-center-index/issues/4764#issuecomment-845807588
reading boostorg/fiber#172, it seems like setting numa=off
is the solution (the opposite)
at least, the same NUMA sources are used for Windows: https://github.com/boostorg/fiber/blob/develop/build/Jamfile.v2#L118
and these sources use Win32 API casting std::thread::native_handle_t
to HANDLE
: https://github.com/boostorg/fiber/blob/develop/src/numa/windows/pin_thread.cpp#L40
regardless of thread API (so I think setting threadapi
will have no effect).
reading boostorg/fiber#172, it seems like setting numa=off is the solution (the opposite) at least, the same NUMA sources are used for Windows: https://github.com/boostorg/fiber/blob/develop/build/Jamfile.v2#L118 and these sources use Win32 API casting std::thread::native_handle_t to HANDLE: https://github.com/boostorg/fiber/blob/develop/src/numa/windows/pin_thread.cpp#L40 regardless of thread API (so I think setting threadapi will have no effect).
Yes, it seems so. I have tried both numa=on and numa=off to no effect.
-o boost:extra_b2_flags="defines=BOOST_DISABLE_THREADS"
This moved the error. (I used 'define' instead of 'defines'). Now I get:
I then tried to disable date_time, but it complained that other features I need depend on it. I will try your other suggestions.
Workaround: disable fiber (-o boost:without_fiber=True) #4764 (comment)
SUCCESS! Thanks so much. However, now I get a linker error in the package that depends on this. I doubt it is related to the 'without_fiber=True' workaround, but just in case someone knows ... here is the linker error:
undefined reference to `_beginthreadex'
This seems to be related also to posix support. So, I went back and tried the 'without_fiber=True' workaround with the gcc MinGW compiler with win32 threading model, and landed back into the first mutex issue that was solved going to the posix mingw. Sigh. :-)
Hello again. Can you please tell me the protocol for closing an issue?
For this issue, the community has been very helpful and kind with their time. Should we close it? Although I am not out of the woods, a reasonable workaround was provided (-o boost:without_fiber=True). I cannot tell at this point whether my downstream issues are because of the workaround - but, I doubt they are. The next issue in my journey here is #7665 (same configuration).
By the way, my project end goal here is to use the fmi4cpp package that depends on these other packages I am trying to build. I am restricted to the GCC MinGW 64 tools.
Thanks again all!
Hello again. Can you please tell me the protocol for closing an issue?
there is no protocol except common sense. if you fill there is no problem in recipe, you may close the issue.
undefined reference to `_beginthreadex'
_beginthreadex
is a CRT function: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/beginthread-beginthreadex?view=msvc-160
Hello everyone, thanks again for the help. I want to update a new finding and summarize the solution here before I close this issue.
The update is: I needed to upgrade the compiler version because of another dependency in the ultimate library I am trying to build (fmi4cpp). The related issue is: #7665. When I did this, another issue in the boost library build emerged and I had to remove another feature using -o boost:without_stacktrace=True
.
Here is the working conan install command:
conan install .. --build=missing -o boost:without_fiber=True -o boost:without_stacktrace=True
Here is the working profile for gcc version 11.2.0 (MinGW-W64 x86_64-ucrt-posix-seh) installed at C:\winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r2\mingw64\bin.
conan profile show default
or conan profile show <profile>
if custom profile is in use)[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release
[options]
[conf]
[build_requires]
[env]
PATH=['C:/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r2/mingw64/bin']
CC=C:/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r2/mingw64/bin/gcc.exe
CXX=C:/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r2/mingw64/bin/gcc.exe
Hello - A configuration for boost/1.77.0 is not available, and when I try to build it I get a ConanException: Error 1 while executing b2.exe. Please help if possible. Thank you. I also tried the most recent gcc 8.1.0 - just in case - and received the same error.
Package and Environment Details (include every applicable attribute)
Conan profile (output of
conan profile show default
orconan profile show <profile>
if custom profile is in use)Steps to reproduce (Include if Applicable)
$ mkdir testdir && cd testdir $ type con > conanfile.txt [requires] boost/1.77.0
[generators] cmake $ mkdir build && cd build $ conan install .. $ conan install .. --build=boost
Logs (Include/Attach if Applicable)
Click to expand log
``` Microsoft Windows [Version 10.0.18363.1801] (c) 2019 Microsoft Corporation. All rights reserved. C:\windows\system32>cd\temp C:\temp>mkdir testdir && cd testdir C:\temp\testdir>type con > conanfile.txt [requires] boost/1.77.0 [generators] cmake C:\temp\testdir>mkdir build && cd build C:\temp\testdir\build>conan install .. Configuration: [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++11 compiler.version=7 os=Windows os_build=Windows [options] [build_requires] [env] boost/1.77.0: WARN: Package binary is corrupted, removing: 26dbaaaba8da289459e8e26b87c8d1b27c993041 conanfile.txt: Installing package Requirements boost/1.77.0 from 'conancenter' - Cache bzip2/1.0.8 from 'conancenter' - Cache zlib/1.2.11 from 'conancenter' - Cache Packages boost/1.77.0:26dbaaaba8da289459e8e26b87c8d1b27c993041 - Missing bzip2/1.0.8:456177cc52f814bf60d65d5b5889191eb5628935 - Cache zlib/1.2.11:42951bc9791ea38175dc6d678bd77956f88c4796 - Cache Installing (downloading, building) binaries... ERROR: Missing binary: boost/1.77.0:26dbaaaba8da289459e8e26b87c8d1b27c993041 boost/1.77.0: WARN: Can't find a 'boost/1.77.0' package for the specified settings, options and dependencies: - Settings: arch=x86_64, build_type=Release, compiler=gcc, compiler.libcxx=libstdc++11, compiler.version=7, os=Windows - Options: asio_no_deprecated=False, buildid=None, bzip2=True, debug_level=0, diagnostic_definitions=False, error_code_header_only=False, extra_b2_flags=None, filesystem_no_deprecated=False, header_only=False, i18n_backend=deprecated, i18n_backend_iconv=off, i18n_backend_icu=False, layout=system, lzma=False, magic_autolink=False, multithreading=True, namespace=boost, namespace_alias=False, numa=True, pch=True, python_executable=None, python_version=None, segmented_stacks=False, shared=False, system_no_deprecated=False, visibility=hidden, without_atomic=False, without_chrono=False, without_container=False, without_context=False, without_contract=False, without_coroutine=False, without_date_time=False, without_exception=False, without_fiber=False, without_filesystem=False, without_graph=False, without_graph_parallel=True, without_iostreams=False, without_json=False, without_locale=False, without_log=False, without_math=False, without_mpi=True, without_nowide=False, without_program_options=False, without_python=True, without_random=False, without_regex=False, without_serialization=False, without_stacktrace=False, without_system=False, without_test=False, without_thread=False, without_timer=False, without_type_erasure=False, without_wave=False, zlib=True, zstd=False, bzip2:build_executable=True, bzip2:shared=False, zlib:minizip=deprecated, zlib:shared=False - Dependencies: zlib/1.2.11, bzip2/1.0.8 - Requirements: bzip2/1.Y.Z, zlib/1.Y.Z - Package ID: 26dbaaaba8da289459e8e26b87c8d1b27c993041 ERROR: Missing prebuilt package for 'boost/1.77.0' Try to build from sources with '--build=boost' Use 'conan search