Closed Kojoley closed 6 years ago
Please, could you provide the result of the pre-processor (option -E)?
The zip file contains pthread code.
# 1 "..\\..\\../boost/thread/pthread/thread_data.hpp" 1
I guess that we don't deduce that the platform is WIN32 correctly on MSYS2. Please, could you try with
../../../b2.exe -j2 toolset=gcc threadapi=win32 test_thread
Be sure that BOOST_THREAD_PLATFORM_WIN32 is defined in file boost/thread/thread_only.hpp
#if defined(BOOST_THREAD_PLATFORM_WIN32)
#include <boost/thread/win32/thread_data.hpp>
#elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
#include <boost/thread/pthread/thread_data.hpp>
#else
#error "Boost threads unavailable on this platform"
#endif
Please, could you try with
../../../b2.exe -j2 toolset=gcc threadapi=win32 test_thread
The result of this output is in the topic, but if you insist...
MSYS /c/Working/Repositories/boost/libs/thread/test
$ ../../../b2.exe -j2 toolset=gcc threadapi=win32 test_thread
Performing configuration checks
- default address-model : 64-bit
- default architecture : x86
- symlinks supported : yes
...patience...
...patience...
...found 3100 targets...
...updating 82 targets...
gcc.compile.c++ ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\chrono.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\winrt_init.o
gcc.compile.c++ ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\thread_clock.o
gcc.compile.c++ ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\process_cpu_clocks.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_thread.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\tss_dll.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\tss_pe.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\future.o
gcc.compile.c++ ..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\error_code.o
gcc.link.dll ..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\libboost_system-gcc64-mt-d-x64-1_67.dll.a
gcc.link.dll ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\libboost_chrono-gcc64-mt-d-x64-1_67.dll.a
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\thread.o
..\..\..\libs\thread\src\win32\thread.cpp: In function 'void boost::{anonymous}::create_current_thread_tls_key()':
..\..\..\libs\thread\src\win32\thread.cpp:84:37: error: 'tss_cleanup_implemented' was not declared in this scope
tss_cleanup_implemented(); // if anyone uses TSS, we need the cleanup linked in
^
..\..\..\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::start_thread_noexcept()':
..\..\..\libs\thread\src\win32\thread.cpp:322:127: error: 'struct boost::detail::thread_data_base' has no member named 'id'
uintptr_t const new_thread=_beginthreadex(0,0,&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
^~
..\..\..\libs\thread\src\win32\thread.cpp:323:13: error: in argument to unary !
if(!new_thread)
^~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp:327:48: error: 'intrusive_ptr_add_ref' was not declared in this scope
intrusive_ptr_add_ref(thread_info.get());
^
..\..\..\libs\thread\src\win32\thread.cpp:328:45: error: 'boost::detail::win32' has not been declared
thread_info->thread_handle=(detail::win32::handle)(new_thread);
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::start_thread_noexcept(const attributes&)':
..\..\..\libs\thread\src\win32\thread.cpp:342:117: error: 'struct boost::detail::thread_data_base' has no member named 'id'
CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_info->id);
^~
..\..\..\libs\thread\src\win32\thread.cpp:343:11: error: in argument to unary !
if(!new_thread)
^~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp:347:46: error: 'intrusive_ptr_add_ref' was not declared in this scope
intrusive_ptr_add_ref(thread_info.get());
^
..\..\..\libs\thread\src\win32\thread.cpp:348:43: error: 'boost::detail::win32' has not been declared
thread_info->thread_handle=(detail::win32::handle)(new_thread);
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In constructor 'boost::{anonymous}::externally_launched_thread::externally_launched_thread()':
..\..\..\libs\thread\src\win32\thread.cpp:365:19: error: 'count' was not declared in this scope
++count;
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:365:19: note: suggested alternative:
In file included from /usr/lib/gcc/x86_64-pc-msys/6.4.0/include/c++/algorithm:62:0,
from ..\..\../boost/smart_ptr/shared_ptr.hpp:39,
from ..\..\../boost/shared_ptr.hpp:17,
from ..\..\../boost/date_time/time_clock.hpp:17,
from ..\..\../boost/thread/thread_time.hpp:9,
from ..\..\../boost/thread/lock_types.hpp:18,
from ..\..\../boost/thread/pthread/thread_data.hpp:12,
from ..\..\../boost/thread/thread_only.hpp:17,
from ..\..\..\libs\thread\src\win32\thread.cpp:11:
/usr/lib/gcc/x86_64-pc-msys/6.4.0/include/c++/bits/stl_algo.h:3961:5: note: 'std::count'
count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:367:17: error: 'interruption_enabled' was not declared in this scope
interruption_enabled=false;
^~~~~~~~~~~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp:367:17: note: suggested alternative:
In file included from ..\..\../boost/thread/thread_only.hpp:22:0,
from ..\..\..\libs\thread\src\win32\thread.cpp:11:
..\..\../boost/thread/detail/thread.hpp:592:32: note: 'boost::this_thread::interruption_enabled'
bool BOOST_THREAD_DECL interruption_enabled() BOOST_NOEXCEPT;
^~~~~~~~~~~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: At global scope:
..\..\..\libs\thread\src\win32\thread.cpp:414:16: error: redefinition of 'boost::thread::id boost::thread::get_id() const'
thread::id thread::get_id() const BOOST_NOEXCEPT
^~~~~~
In file included from ..\..\../boost/thread/thread_only.hpp:22:0,
from ..\..\..\libs\thread\src\win32\thread.cpp:11:
..\..\../boost/thread/detail/thread.hpp:716:23: note: 'boost::thread::id boost::thread::get_id() const' previously defined here
inline thread::id thread::get_id() const BOOST_NOEXCEPT
^~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::join_noexcept()':
..\..\..\libs\thread\src\win32\thread.cpp:442:13: error: 'interruptible_wait' is not a member of 'boost::this_thread'
this_thread::interruptible_wait(this->native_handle(), detail::internal_platform_timepoint::getMax());
^~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::do_try_join_until_noexcept(const internal_platform_timepoint&, bool&)':
..\..\..\libs\thread\src\win32\thread.cpp:457:15: error: 'interruptible_wait' is not a member of 'boost::this_thread'
if(!this_thread::interruptible_wait(this->native_handle(), timeout))
^~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::interrupt()':
..\..\..\libs\thread\src\win32\thread.cpp:488:32: error: 'struct boost::detail::thread_data_base' has no member named 'interrupt'
local_thread_info->interrupt();
^~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::interruption_requested() const':
..\..\..\libs\thread\src\win32\thread.cpp:495:44: error: 'winapi' has not been declared
return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0);
^~~~~~
..\..\..\libs\thread\src\win32\thread.cpp:495:93: error: 'struct boost::detail::thread_data_base' has no member named 'interruption_handle'; did you mean 'interrupt_enabled'?
return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0);
^~~~~~~~~~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()':
..\..\..\libs\thread\src\win32\thread.cpp:502:17: error: 'boost::detail::win32' has not been declared
detail::win32::system_info info;
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:503:17: error: 'boost::detail::win32' has not been declared
detail::win32::get_system_info(&info);
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:503:41: error: 'info' was not declared in this scope
detail::win32::get_system_info(&info);
^~~~
..\..\..\libs\thread\src\win32\thread.cpp: In member function '__pthread_t* boost::thread::native_handle()':
..\..\..\libs\thread\src\win32\thread.cpp:541:28: error: 'boost::detail::win32' has not been declared
return detail::win32::invalid_handle_value;
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:547:25: error: 'boost::detail::win32' has not been declared
return (detail::win32::handle)local_thread_info->thread_handle;
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:547:39: error: expected ';' before 'local_thread_info'
return (detail::win32::handle)local_thread_info->thread_handle;
^~~~~~~~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp: At global scope:
..\..\..\libs\thread\src\win32\thread.cpp:608:41: error: 'boost::detail::win32' has not been declared
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:608:111: error: expected primary-expression before 'const'
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^~~~~
..\..\..\libs\thread\src\win32\thread.cpp:608:125: error: expression list treated as compound expression in initializer [-fpermissive]
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^
..\..\..\libs\thread\src\win32\thread.cpp:972:1: error: expected '}' at end of input
}
^
..\..\..\libs\thread\src\win32\thread.cpp:972:1: error: expected '}' at end of input
In file included from ..\..\../boost/smart_ptr/shared_ptr.hpp:28:0,
from ..\..\../boost/shared_ptr.hpp:17,
from ..\..\../boost/date_time/time_clock.hpp:17,
from ..\..\../boost/thread/thread_time.hpp:9,
from ..\..\../boost/thread/lock_types.hpp:18,
from ..\..\../boost/thread/pthread/thread_data.hpp:12,
from ..\..\../boost/thread/thread_only.hpp:17,
from ..\..\..\libs\thread\src\win32\thread.cpp:11:
..\..\../boost/smart_ptr/detail/shared_count.hpp: In instantiation of 'boost::detail::shared_count::shared_count(P, D) [with P = boost::detail::thread_data_base*; D = bool]':
..\..\../boost/smart_ptr/shared_ptr.hpp:388:76: required from 'boost::shared_ptr<T>::shared_ptr(Y*, D) [with Y = boost::detail::thread_data_base; D = bool; T = boost::detail::thread_data_base]'
..\..\..\libs\thread\src\win32\thread.cpp:255:96: required from here
..\..\../boost/smart_ptr/detail/shared_count.hpp:185:14: error: 'd' cannot be used as a function
d(p); // delete p
~^~~
In file included from ..\..\../boost/smart_ptr/detail/shared_count.hpp:30:0,
from ..\..\../boost/smart_ptr/shared_ptr.hpp:28,
from ..\..\../boost/shared_ptr.hpp:17,
from ..\..\../boost/date_time/time_clock.hpp:17,
from ..\..\../boost/thread/thread_time.hpp:9,
from ..\..\../boost/thread/lock_types.hpp:18,
from ..\..\../boost/thread/pthread/thread_data.hpp:12,
from ..\..\../boost/thread/thread_only.hpp:17,
from ..\..\..\libs\thread\src\win32\thread.cpp:11:
..\..\../boost/smart_ptr/detail/sp_counted_impl.hpp: In instantiation of 'void boost::detail::sp_counted_impl_pd<P, D>::dispose() [with P = boost::detail::thread_data_base*; D = bool]':
..\..\..\libs\thread\src\win32\thread.cpp:972:1: required from here
..\..\../boost/smart_ptr/detail/sp_counted_impl.hpp:172:9: error: expression cannot be used as a function
del( ptr );
^~~
..\..\..\libs\thread\src\win32\thread.cpp:402:35: warning: 'boost::detail::thread_data_base* boost::{anonymous}::get_or_make_current_thread_data()' defined but not used [-Wunused-function]
detail::thread_data_base* get_or_make_current_thread_data()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..\..\..\libs\thread\src\win32\thread.cpp:91:14: warning: 'void boost::{anonymous}::cleanup_tls_key()' defined but not used [-Wunused-function]
void cleanup_tls_key()
^~~~~~~~~~~~~~~
"g++" -O0 -fno-inline -Wall -pedantic -g -mthreads -m64 -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_USES_CHRONO -DBOOST_USE_WINDOWS_H -DWIN32_LEAN_AND_MEAN -I"..\..\.." -c -o "..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\thread.o" "..\..\..\libs\thread\src\win32\thread.cpp"
...failed gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\thread.o...
...skipped <p..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>libboost_thread-gcc64-mt-d-x64-1_67.dll.a for lack of <p..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>win32\thread.o...
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\compiler_log_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\debug.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\execution_monitor.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\decorator.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\plain_report_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\progress_monitor.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\framework.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\results_collector.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_framework_init_observer.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\results_reporter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_tools.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_tree.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\unit_test_log.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\unit_test_main.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\unit_test_monitor.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\junit_log_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\xml_log_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\unit_test_parameters.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\xml_report_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\timer\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\auto_timers_construction.o
gcc.compile.c++ ..\..\..\bin.v2\libs\timer\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\cpu_timer.o
gcc.link.dll ..\..\..\bin.v2\libs\timer\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\libboost_timer-gcc64-mt-d-x64-1_67.dll.a
gcc.link.dll ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\libboost_unit_test_framework-gcc64-mt-d-x64-1_67.dll.a
...skipped <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>test_thread.exe for lack of <p..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>libboost_thread-gcc64-mt-d-x64-1_67.dll.a...
...skipped <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>test_thread.run for lack of <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>test_thread.exe...
...failed updating 1 target...
...skipped 4 targets...
...updated 76 targets...
I requested to add threadapi=win32
which was not the case for the first report.
Could you try
#include <boost/config.hpp>
and check that one of defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
are defined.
The concerned code in in boost/thread/detail/platform.hpp
// fetch compiler and platform configuration
#include <boost/config.hpp>
// insist on threading support being available:
#include <boost/config/requires_threads.hpp>
// choose platform
#if defined(linux) || defined(__linux) || defined(__linux__)
# define BOOST_THREAD_LINUX
//# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(100000)
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
# define BOOST_THREAD_BSD
#elif defined(sun) || defined(__sun)
# define BOOST_THREAD_SOLARIS
#elif defined(__sgi)
# define BOOST_THREAD_IRIX
#elif defined(__hpux)
# define BOOST_THREAD_HPUX
#elif defined(__CYGWIN__)
# define BOOST_THREAD_CYGWIN
#elif (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(BOOST_DISABLE_WIN32)
# define BOOST_THREAD_WIN32
I'm not an expert on Windows, but Boost/Config is viewing it as cygwin. Is this what you expect?
# 1 "..\\..\\../boost/config/detail/select_platform_config.hpp" 1
# 54 "..\\..\\../boost/config.hpp" 2
# 1 "..\\..\\../boost/config/platform/cygwin.hpp" 1
# 46 "..\\..\\../boost/config/platform/cygwin.hpp"
# 1 "..\\..\\../boost/config/detail/posix_features.hpp" 1
# 47 "..\\..\\../boost/config/platform/cygwin.hpp" 2
cygwin is not considered as a WIN32 platform in Boost.Thread, as it has BOOST_HAS_PTHREADS, isn't it?
#if defined(BOOST_THREAD_POSIX)
# define BOOST_THREAD_PLATFORM_PTHREAD
#else
# if defined(BOOST_THREAD_WIN32)
# define BOOST_THREAD_PLATFORM_WIN32
# elif defined(BOOST_HAS_PTHREADS)
# define BOOST_THREAD_PLATFORM_PTHREAD
# else
# error "Sorry, no boost threads are available for this platform."
# endif
#endif
It seems we have that the build system is detecting threadapi=win32 and Boost.Thread consider that it has a pthread.
Could you try threadapi=pthread
and verbose -d2
../../../b2.exe -j2 toolset=gcc threadapi=pthread test_thread
Maybe you can try also to add in file thread/build/Jamfile.v2
after
rule usage-requirements ( properties * )
{
local result ;
if <threadapi>pthread in $(properties)
{
result += <define>BOOST_THREAD_POSIX ;
if <target-os>windows in $(properties)
{
result += [ win32_pthread_paths $(properties) ] ;
# TODO: What is for static linking? Is the <library> also needed
# in that case?
}
}
the following
if <threadapi>win32 in $(properties)
{
result += <define>BOOST_THREAD_WIN32 ;
}
I requested to add
threadapi=win32
which was not the case for the first report.
Is not it default? Look at the path gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_thread.o
Could you try
#include <boost/config.hpp>
#include <boost/config.hpp>
#include <iostream>
int main()
{
std::cout << "BOOST_PLATFORM: " << BOOST_PLATFORM << std::endl;
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
std::cout << "WIN32: Yes" << std::endl;
#else
std::cout << "WIN32: No" << std::endl;
#endif
#if defined(BOOST_WINDOWS)
std::cout << "BOOST_WINDOWS: Yes" << std::endl;
#else
std::cout << "BOOST_WINDOWS: No" << std::endl;
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
std::cout << "MINGW: Yes" << std::endl;
#else
std::cout << "MINGW: No" << std::endl;
#endif
#if defined(__CYGWIN__)
std::cout << "CYGWIN: Yes" << std::endl;
#else
std::cout << "CYGWIN: No" << std::endl;
#endif
return 1;
}
BOOST_PLATFORM: Cygwin
WIN32: No
BOOST_WINDOWS: No
MINGW: No
CYGWIN: Yes
I'm not an expert on Windows, but Boost/Config is viewing it as cygwin. Is this what you expect?
It is a good question. Actually I was expecting a MinGW, but it looks like by default it is treats itself like a Cygwin (with MSYSTEM=MSYS) https://github.com/msys2/msys2/wiki/How-does-MSYS2-differ-from-Cygwin
cygwin is not considered as a WIN32 platform in Boost.Thread, as it has BOOST_HAS_PTHREADS, isn't it? Could you try threadapi=pthread
MSYS /c/Working/Repositories/boost/libs/thread/test
$ ../../../b2.exe -j2 toolset=gcc threadapi=pthread test_thread
Performing configuration checks
- default address-model : 64-bit (cached)
- default architecture : x86 (cached)
- symlinks supported : yes (cached)
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
- lockfree boost::atomic_flag : yes
...patience...
...found 2281 targets...
...updating 49 targets...
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\compiler_log_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\winrt_init.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\debug.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\decorator.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\execution_monitor.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\plain_report_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\progress_monitor.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\results_collector.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\framework.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_framework_init_observer.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\results_reporter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_tools.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_tree.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\unit_test_log.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\unit_test_main.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\unit_test_monitor.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\junit_log_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\xml_log_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\xml_report_formatter.o
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\unit_test_parameters.o
gcc.compile.c++ ..\..\..\bin.v2\libs\timer\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\auto_timers_construction.o
gcc.compile.c++ ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\chrono.o
gcc.compile.c++ ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\thread_clock.o
gcc.compile.c++ ..\..\..\bin.v2\libs\timer\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\cpu_timer.o
gcc.compile.c++ ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\process_cpu_clocks.o
gcc.compile.c++ ..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\error_code.o
gcc.link.dll ..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_system-gcc64-mt-d-x64-1_67.dll.a
gcc.link.dll ..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_chrono-gcc64-mt-d-x64-1_67.dll.a
gcc.link.dll ..\..\..\bin.v2\libs\timer\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_timer-gcc64-mt-d-x64-1_67.dll.a
gcc.link.dll ..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_unit_test_framework-gcc64-mt-d-x64-1_67.dll.a
gcc.link ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.exe
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `interruption_point_thread(boost::mutex*, bool*)':
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:83: undefined reference to `boost::this_thread::interruption_point()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:83:(.text+0x1cab): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::this_thread::interruption_point()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `do_test_thread_interrupts_at_interruption_point()':
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:93: undefined reference to `boost::thread::interrupt()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:93:(.text+0x1d50): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::thread::interrupt()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `disabled_interruption_point_thread(boost::mutex*, bool*)':
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:107: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:107:(.text+0x2452): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::this_thread::disable_interruption::disable_interruption()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:108: undefined reference to `boost::this_thread::interruption_point()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:108:(.text+0x2457): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::this_thread::interruption_point()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:107: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:107:(.text+0x246a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::this_thread::disable_interruption::~disable_interruption()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:107: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:107:(.text+0x2487): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::this_thread::disable_interruption::~disable_interruption()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `do_test_thread_no_interrupt_if_interrupts_disabled_at_interruption_point()':
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:118: undefined reference to `boost::thread::interrupt()'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:118:(.text+0x2514): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::thread::interrupt()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `do_test_timed_join()':
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:182: undefined reference to `boost::thread::joinable() const'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:182:(.text+0x33aa): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::thread::joinable() const'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:187: undefined reference to `boost::thread::joinable() const'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:187:(.text+0x37a5): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::thread::joinable() const'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:199: undefined reference to `boost::thread::joinable() const'
/c/Working/Repositories/boost/libs/thread/test/test_thread.cpp:199:(.text+0x3bc0): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `boost::thread::joinable() const'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::detail::interruption_checker::interruption_checker(__pthread_mutex_t**, __pthread_cond_t**)':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/pthread/thread_data.hpp:199: undefined reference to `boost::detail::get_current_thread_data()'
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/pthread/thread_data.hpp:199:(.text$_ZN5boost6detail20interruption_checkerC1EPP17__pthread_mutex_tPP16__pthread_cond_t[_ZN5boost6detail20interruption_checkerC1EPP17__pthread_mutex_tPP16__pthread_cond_t]+0x1b): additional relocation overflows omitted from the output
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::thread::start_thread()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:179: undefined reference to `boost::thread::start_thread_noexcept()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::thread::~thread()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:254: undefined reference to `boost::thread::detach()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::thread::get_id() const':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:719: undefined reference to `boost::thread::native_handle()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::thread::join()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:743: undefined reference to `boost::thread::join_noexcept()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::thread::do_try_join_until(boost::detail::mono_platform_timepoint const&)':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:753: undefined reference to `boost::thread::do_try_join_until_noexcept(boost::detail::mono_platform_timepoint const&, bool&)'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::condition_variable::wait(boost::unique_lock<boost::mutex>&)':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/pthread/condition_variable.hpp:94: undefined reference to `boost::this_thread::interruption_point()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::condition_variable::do_wait_until(boost::unique_lock<boost::mutex>&, boost::detail::mono_platform_timepoint const&)':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/pthread/condition_variable.hpp:137: undefined reference to `boost::this_thread::interruption_point()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `bool boost::condition_variable_any::do_wait_until<boost::unique_lock<boost::mutex> >(boost::unique_lock<boost::mutex>&, boost::detail::mono_platform_timepoint const&)':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/pthread/condition_variable.hpp:485: undefined reference to `boost::this_thread::interruption_point()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::detail::thread_data<void (*)()>::~thread_data()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:91: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(boost::thread::id), boost::_bi::list1<boost::_bi::value<boost::thread::id> > > >::~thread_data()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:91: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(boost::mutex*, bool*), boost::_bi::list2<boost::_bi::value<boost::mutex*>, boost::_bi::value<bool*> > > >::~thread_data()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:91: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::detail::thread_data<boost::reference_wrapper<non_copyable_functor> >::~thread_data()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:125: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o: In function `boost::detail::thread_data<boost::reference_wrapper<long_running_thread> >::~thread_data()':
/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:125: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o:/c/Working/Repositories/boost/libs/thread/test/..\..\../boost/thread/detail/thread.hpp:91: more undefined references to `boost::detail::thread_data_base::~thread_data_base()' follow
..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o:test_thread.cpp:(.rdata$.refptr._ZTVN5boost6detail16thread_data_baseE[.refptr._ZTVN5boost6detail16thread_data_baseE]+0x0): undefined reference to `vtable for boost::detail::thread_data_base'
collect2: error: ld returned 1 exit status
"g++" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/chrono/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/system/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/test/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/timer/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/chrono/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/system/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/test/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/timer/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -o "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.exe" -Wl,--start-group "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o" "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\winrt_init.o" "..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_unit_test_framework-gcc64-mt-d-x64-1_67.dll.a" "..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_system-gcc64-mt-d-x64-1_67.dll.a" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g -mthreads -m64
...failed gcc.link ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.exe...
...skipped <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi>test_thread.run for lack of <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi>test_thread.exe...
...failed updating 1 target...
...skipped 2 targets...
...updated 46 targets...
Maybe you can try also to add in file thread/build/Jamfile.v2 after
rule usage-requirements ( properties * ) { local result ; if <threadapi>pthread in $(properties) { result += <define>BOOST_THREAD_POSIX ; if <target-os>windows in $(properties) { result += [ win32_pthread_paths $(properties) ] ; # TODO: What is for static linking? Is the <library> also needed # in that case? } }
the following
if <threadapi>win32 in $(properties) { result += <define>BOOST_THREAD_WIN32 ; }
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\test\test_thread_lib.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_thread.o In file included from ..\..\../boost/thread/win32/thread_data.hpp:11:0, from ..\..\../boost/thread/thread_only.hpp:15, from test_thread.cpp:13: ..\..\../boost/thread/win32/thread_primitives.hpp:51:38: error: expected initializer before 'ticks_type' typedef unsigned __int64 ticks_type; ^~~~~~~~~~ ..\..\../boost/thread/win32/thread_primitives.hpp:75:52: error: typedef 'boost::detail::win32::detail::ticks_type' is initialized (use declt ype instead) namespace detail { typedef ticks_type (__stdcall *gettickcount64_t)(); } ^ ..\..\../boost/thread/win32/thread_primitives.hpp:75:52: error: expected primary-expression before '__attribute__' namespace detail { typedef ticks_type (__stdcall *gettickcount64_t)(); } ^ In file included from ..\..\../boost/thread/win32/thread_data.hpp:11:0, from ..\..\../boost/thread/thread_only.hpp:15, from test_thread.cpp:13: ..\..\../boost/thread/win32/thread_primitives.hpp:90:20: error: 'ticks_type' does not name a type inline ticks_type __stdcall GetTickCount64emulation() ^~~~~~~~~~ ..\..\../boost/thread/win32/thread_primitives.hpp:140:28: error: 'gettickcount64_t' in namespace 'boost::detail::win32::detail' does not nam e a type inline detail::gettickcount64_t GetTickCount64_() ^~~~~~~~~~~~~~~~
"g++" -O0 -fno-inline -Wall -pedantic -g -mthreads -m64 -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -pedantic -DBOO ST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THR EAD_THROW_IF_PRECONDITION_NOT_SATISFIED -DBOOST_THREAD_USE_LIB=1 -DBOOST_THREAD_WIN32 -DBOOST_TIMER_STATIC_LINK=1 -I"..\..\.." -c -o "..\.. \..\bin.v2\libs\thread\test\test_thread_lib.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_thread.o" "test_thread.cpp"
...failed gcc.compile.c++ ......\bin.v2\libs\thread\test\test_thread_lib.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\test_thr ead.o...
gcc.compile.c++ ......\bin.v2\libs\thread\test\test_thread_lib.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\winrt_init.o
gcc.compile.c++ ......\bin.v2\libs\thread\test\test_thread_lib.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\tss_null.o
gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\thread.o
......\libs\thread\src\win32\thread.cpp: In function 'void boost::{anonymous}::create_current_thread_tls_key()':
......\libs\thread\src\win32\thread.cpp:84:37: error: 'tss_cleanup_implemented' was not declared in this scope
tss_cleanup_implemented(); // if anyone uses TSS, we need the cleanup linked in
^
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::start_thread_noexcept()':
......\libs\thread\src\win32\thread.cpp:322:127: error: 'struct boost::detail::thread_data_base' has no member named 'id'
uintptr_t const new_thread=_beginthreadex(0,0,&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
^~
......\libs\thread\src\win32\thread.cpp:323:13: error: in argument to unary !
if(!new_thread)
^~~~~~
......\libs\thread\src\win32\thread.cpp:327:48: error: 'intrusive_ptr_add_ref' was not declared in this scope
intrusive_ptr_add_ref(thread_info.get());
^
......\libs\thread\src\win32\thread.cpp:328:45: error: 'boost::detail::win32' has not been declared
thread_info->thread_handle=(detail::win32::handle)(new_thread);
^~~~~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::start_thread_noexcept(const attributes&)':
......\libs\thread\src\win32\thread.cpp:342:117: error: 'struct boost::detail::thread_data_base' has no member named 'id'
CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_info->id);
^~
......\libs\thread\src\win32\thread.cpp:343:11: error: in argument to unary !
if(!new_thread)
^~~~~~
......\libs\thread\src\win32\thread.cpp:347:46: error: 'intrusive_ptr_add_ref' was not declared in this scope
intrusive_ptr_add_ref(thread_info.get());
^
......\libs\thread\src\win32\thread.cpp:348:43: error: 'boost::detail::win32' has not been declared
thread_info->thread_handle=(detail::win32::handle)(new_thread);
^~~~~
......\libs\thread\src\win32\thread.cpp: In constructor 'boost::{anonymous}::externally_launched_thread::externally_launched_thread()':
......\libs\thread\src\win32\thread.cpp:365:19: error: 'count' was not declared in this scope
++count;
^~~~~
......\libs\thread\src\win32\thread.cpp:365:19: note: suggested alternative:
In file included from /usr/lib/gcc/x86_64-pc-msys/6.4.0/include/c++/algorithm:62:0,
from ....../boost/smart_ptr/shared_ptr.hpp:39,
from ....../boost/shared_ptr.hpp:17,
from ....../boost/date_time/time_clock.hpp:17,
from ....../boost/thread/thread_time.hpp:9,
from ....../boost/thread/lock_types.hpp:18,
from ....../boost/thread/pthread/thread_data.hpp:12,
from ....../boost/thread/thread_only.hpp:17,
from ......\libs\thread\src\win32\thread.cpp:11:
/usr/lib/gcc/x86_64-pc-msys/6.4.0/include/c++/bits/stl_algo.h:3961:5: note: 'std::count'
count(_InputIterator first, _InputIterator __last, const _Tp& value)
^~~~~
......\libs\thread\src\win32\thread.cpp:367:17: error: 'interruption_enabled' was not declared in this scope
interruption_enabled=false;
^~~~~~~~
......\libs\thread\src\win32\thread.cpp:367:17: note: suggested alternative:
In file included from ....../boost/thread/thread_only.hpp:22:0,
from ......\libs\thread\src\win32\thread.cpp:11:
....../boost/thread/detail/thread.hpp:592:32: note: 'boost::this_thread::interruption_enabled'
bool BOOST_THREAD_DECL interruption_enabled() BOOST_NOEXCEPT;
^~~~~~~~
......\libs\thread\src\win32\thread.cpp: At global scope:
......\libs\thread\src\win32\thread.cpp:414:16: error: redefinition of 'boost::thread::id boost::thread::get_id() const'
thread::id thread::get_id() const BOOST_NOEXCEPT
^~
In file included from ....../boost/thread/thread_only.hpp:22:0,
from ......\libs\thread\src\win32\thread.cpp:11:
....../boost/thread/detail/thread.hpp:716:23: note: 'boost::thread::id boost::thread::get_id() const' previously defined here
inline thread::id thread::get_id() const BOOST_NOEXCEPT
^~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::join_noexcept()':
......\libs\thread\src\win32\thread.cpp:442:13: error: 'interruptible_wait' is not a member of 'boost::this_thread'
this_thread::interruptible_wait(this->native_handle(), detail::internal_platform_timepoint::getMax());
^~~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::do_try_join_until_noexcept(const internal_platform_timepo int&, bool&)':
......\libs\thread\src\win32\thread.cpp:457:15: error: 'interruptible_wait' is not a member of 'boost::this_thread'
if(!this_thread::interruptible_wait(this->native_handle(), timeout))
^~~
......\libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::interrupt()':
......\libs\thread\src\win32\thread.cpp:488:32: error: 'struct boost::detail::thread_data_base' has no member named 'interrupt'
local_thread_info->interrupt();
^~~~~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::interruption_requested() const':
......\libs\thread\src\win32\thread.cpp:495:44: error: 'winapi' has not been declared
return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0);
^~
......\libs\thread\src\win32\thread.cpp:495:93: error: 'struct boost::detail::thread_data_base' has no member named 'interruption_handle'; did you mean 'interrupt_enabled'?
return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0);
^~~~~~~
......\libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()':
......\libs\thread\src\win32\thread.cpp:502:17: error: 'boost::detail::win32' has not been declared
detail::win32::system_info info;
^~~~~
......\libs\thread\src\win32\thread.cpp:503:17: error: 'boost::detail::win32' has not been declared
detail::win32::get_system_info(&info);
^~~~~
......\libs\thread\src\win32\thread.cpp:503:41: error: 'info' was not declared in this scope
detail::win32::get_system_info(&info);
^~~~
......\libs\thread\src\win32\thread.cpp: In member function '__pthread_t boost::thread::native_handle()':
......\libs\thread\src\win32\thread.cpp:541:28: error: 'boost::detail::win32' has not been declared
return detail::win32::invalid_handle_value;
^~~~~
......\libs\thread\src\win32\thread.cpp:547:25: error: 'boost::detail::win32' has not been declared
return (detail::win32::handle)local_thread_info->thread_handle;
^~~~~
......\libs\thread\src\win32\thread.cpp:547:39: error: expected ';' before 'local_thread_info'
return (detail::win32::handle)local_thread_info->thread_handle;
^~~~~
......\libs\thread\src\win32\thread.cpp: At global scope:
......\libs\thread\src\win32\thread.cpp:608:41: error: 'boost::detail::win32' has not been declared
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^~~~~
......\libs\thread\src\win32\thread.cpp:608:111: error: expected primary-expression before 'const'
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^~~~~
......\libs\thread\src\win32\thread.cpp:608:125: error: expression list treated as compound expression in initializer [-fpermissive]
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^
......\libs\thread\src\win32\thread.cpp:972:1: error: expected '}' at end of input
}
^
......\libs\thread\src\win32\thread.cpp:972:1: error: expected '}' at end of input
In file included from ....../boost/smart_ptr/shared_ptr.hpp:28:0,
from ....../boost/shared_ptr.hpp:17,
from ....../boost/date_time/time_clock.hpp:17,
from ....../boost/thread/thread_time.hpp:9,
from ....../boost/thread/lock_types.hpp:18,
from ....../boost/thread/pthread/thread_data.hpp:12,
from ....../boost/thread/thread_only.hpp:17,
from ......\libs\thread\src\win32\thread.cpp:11:
....../boost/smart_ptr/detail/shared_count.hpp: In instantiation of 'boost::detail::shared_count::shared_count(P, D) [with P = boost::deta il::thread_data_base; D = bool]':
....../boost/smart_ptr/shared_ptr.hpp:388:76: required from 'boost::shared_ptr~~~~~~
......\libs\thread\src\win32\thread.cpp:91:14: warning: 'void boost::{anonymous}::cleanup_tls_key()' defined but not used [-Wunused-functi on]
void cleanup_tls_key()
^~~~~~~
"g++" -O0 -fno-inline -Wall -pedantic -g -mthreads -m64 -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -pedantic -DBOO ST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_USES_CHRONO -DBOOST_USE_WINDOW S_H -DWIN32_LEAN_AND_MEAN -I"..\..\.." -c -o "..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\t hread.o" "..\..\..\libs\thread\src\win32\thread.cpp"
...failed gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi\win32\thread.o...
...skipped <p......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>libboost_thread-gcc64-mt-d-x64-1_67.dll.a for lack of <p......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>win32\thread.o...
...skipped <p......\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>test_thread.exe for lack of <p......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>libboost_thread-gcc64-mt-d-x64-1_67.dll.a...
...skipped <p......\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>test_thread.run for lack of <p......\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-win32\threading-multi>test_thread.exe...
gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threading-multi\win32\tss_dll.o
gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threading-multi\win32\tss_pe.o
gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threading-multi\future.o
gcc.compile.c++ ......\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threading-multi\compiler_log_formatter.o
gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threading-multi\win32\thread.o
......\libs\thread\src\win32\thread.cpp: In function 'void boost::{anonymous}::create_current_thread_tls_key()':
......\libs\thread\src\win32\thread.cpp:84:37: error: 'tss_cleanup_implemented' was not declared in this scope
tss_cleanup_implemented(); // if anyone uses TSS, we need the cleanup linked in
^
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::start_thread_noexcept()':
......\libs\thread\src\win32\thread.cpp:322:127: error: 'struct boost::detail::thread_data_base' has no member named 'id'
uintptr_t const new_thread=_beginthreadex(0,0,&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
^~
......\libs\thread\src\win32\thread.cpp:323:13: error: in argument to unary !
if(!new_thread)
^~~~~~
......\libs\thread\src\win32\thread.cpp:327:48: error: 'intrusive_ptr_add_ref' was not declared in this scope
intrusive_ptr_add_ref(thread_info.get());
^
......\libs\thread\src\win32\thread.cpp:328:45: error: 'boost::detail::win32' has not been declared
thread_info->thread_handle=(detail::win32::handle)(new_thread);
^~~~~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::start_thread_noexcept(const attributes&)':
......\libs\thread\src\win32\thread.cpp:342:117: error: 'struct boost::detail::thread_data_base' has no member named 'id'
CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_info->id);
^~
......\libs\thread\src\win32\thread.cpp:343:11: error: in argument to unary !
if(!new_thread)
^~~~~~
......\libs\thread\src\win32\thread.cpp:347:46: error: 'intrusive_ptr_add_ref' was not declared in this scope
intrusive_ptr_add_ref(thread_info.get());
^
......\libs\thread\src\win32\thread.cpp:348:43: error: 'boost::detail::win32' has not been declared
thread_info->thread_handle=(detail::win32::handle)(new_thread);
^~~~~
......\libs\thread\src\win32\thread.cpp: In constructor 'boost::{anonymous}::externally_launched_thread::externally_launched_thread()':
......\libs\thread\src\win32\thread.cpp:365:19: error: 'count' was not declared in this scope
++count;
^~~~~
......\libs\thread\src\win32\thread.cpp:365:19: note: suggested alternative:
In file included from /usr/lib/gcc/x86_64-pc-msys/6.4.0/include/c++/algorithm:62:0,
from ....../boost/smart_ptr/shared_ptr.hpp:39,
from ....../boost/shared_ptr.hpp:17,
from ....../boost/date_time/time_clock.hpp:17,
from ....../boost/thread/thread_time.hpp:9,
from ....../boost/thread/lock_types.hpp:18,
from ....../boost/thread/pthread/thread_data.hpp:12,
from ....../boost/thread/thread_only.hpp:17,
from ......\libs\thread\src\win32\thread.cpp:11:
/usr/lib/gcc/x86_64-pc-msys/6.4.0/include/c++/bits/stl_algo.h:3961:5: note: 'std::count'
count(_InputIterator first, _InputIterator __last, const _Tp& value)
^~~~~
......\libs\thread\src\win32\thread.cpp:367:17: error: 'interruption_enabled' was not declared in this scope
interruption_enabled=false;
^~~~~~~~
......\libs\thread\src\win32\thread.cpp:367:17: note: suggested alternative:
In file included from ....../boost/thread/thread_only.hpp:22:0,
from ......\libs\thread\src\win32\thread.cpp:11:
....../boost/thread/detail/thread.hpp:592:32: note: 'boost::this_thread::interruption_enabled'
bool BOOST_THREAD_DECL interruption_enabled() BOOST_NOEXCEPT;
^~~~~~~~
......\libs\thread\src\win32\thread.cpp: At global scope:
......\libs\thread\src\win32\thread.cpp:414:16: error: redefinition of 'boost::thread::id boost::thread::get_id() const'
thread::id thread::get_id() const BOOST_NOEXCEPT
^~
In file included from ....../boost/thread/thread_only.hpp:22:0,
from ......\libs\thread\src\win32\thread.cpp:11:
....../boost/thread/detail/thread.hpp:716:23: note: 'boost::thread::id boost::thread::get_id() const' previously defined here
inline thread::id thread::get_id() const BOOST_NOEXCEPT
^~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::join_noexcept()':
......\libs\thread\src\win32\thread.cpp:442:13: error: 'interruptible_wait' is not a member of 'boost::this_thread'
this_thread::interruptible_wait(this->native_handle(), detail::internal_platform_timepoint::getMax());
^~~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::do_try_join_until_noexcept(const internal_platform_timepo int&, bool&)':
......\libs\thread\src\win32\thread.cpp:457:15: error: 'interruptible_wait' is not a member of 'boost::this_thread'
if(!this_thread::interruptible_wait(this->native_handle(), timeout))
^~~
......\libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::interrupt()':
......\libs\thread\src\win32\thread.cpp:488:32: error: 'struct boost::detail::thread_data_base' has no member named 'interrupt'
local_thread_info->interrupt();
^~~~~
......\libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::interruption_requested() const':
......\libs\thread\src\win32\thread.cpp:495:44: error: 'winapi' has not been declared
return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0);
^~
......\libs\thread\src\win32\thread.cpp:495:93: error: 'struct boost::detail::thread_data_base' has no member named 'interruption_handle'; did you mean 'interrupt_enabled'?
return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0);
^~~~~~~
......\libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()':
......\libs\thread\src\win32\thread.cpp:502:17: error: 'boost::detail::win32' has not been declared
detail::win32::system_info info;
^~~~~
......\libs\thread\src\win32\thread.cpp:503:17: error: 'boost::detail::win32' has not been declared
detail::win32::get_system_info(&info);
^~~~~
......\libs\thread\src\win32\thread.cpp:503:41: error: 'info' was not declared in this scope
detail::win32::get_system_info(&info);
^~~~
......\libs\thread\src\win32\thread.cpp: In member function '__pthread_t boost::thread::native_handle()':
......\libs\thread\src\win32\thread.cpp:541:28: error: 'boost::detail::win32' has not been declared
return detail::win32::invalid_handle_value;
^~~~~
......\libs\thread\src\win32\thread.cpp:547:25: error: 'boost::detail::win32' has not been declared
return (detail::win32::handle)local_thread_info->thread_handle;
^~~~~
......\libs\thread\src\win32\thread.cpp:547:39: error: expected ';' before 'local_thread_info'
return (detail::win32::handle)local_thread_info->thread_handle;
^~~~~
......\libs\thread\src\win32\thread.cpp: At global scope:
......\libs\thread\src\win32\thread.cpp:608:41: error: 'boost::detail::win32' has not been declared
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^~~~~
......\libs\thread\src\win32\thread.cpp:608:111: error: expected primary-expression before 'const'
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^~~~~
......\libs\thread\src\win32\thread.cpp:608:125: error: expression list treated as compound expression in initializer [-fpermissive]
bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout)
^
......\libs\thread\src\win32\thread.cpp:972:1: error: expected '}' at end of input
}
^
......\libs\thread\src\win32\thread.cpp:972:1: error: expected '}' at end of input
In file included from ....../boost/smart_ptr/shared_ptr.hpp:28:0,
from ....../boost/shared_ptr.hpp:17,
from ....../boost/date_time/time_clock.hpp:17,
from ....../boost/thread/thread_time.hpp:9,
from ....../boost/thread/lock_types.hpp:18,
from ....../boost/thread/pthread/thread_data.hpp:12,
from ....../boost/thread/thread_only.hpp:17,
from ......\libs\thread\src\win32\thread.cpp:11:
....../boost/smart_ptr/detail/shared_count.hpp: In instantiation of 'boost::detail::shared_count::shared_count(P, D) [with P = boost::deta il::thread_data_base; D = bool]':
....../boost/smart_ptr/shared_ptr.hpp:388:76: required from 'boost::shared_ptr~~~~~~
......\libs\thread\src\win32\thread.cpp:91:14: warning: 'void boost::{anonymous}::cleanup_tls_key()' defined but not used [-Wunused-functi on]
void cleanup_tls_key()
^~~~~~~
"g++" -O0 -fno-inline -Wall -pedantic -g -mthreads -m64 -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -pedantic -DBOO ST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_USES_CHRONO -DBOOST_USE_ WINDOWS_H -DWIN32_LEAN_AND_MEAN -I"..\..\.." -c -o "..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threa ding-multi\win32\thread.o" "..\..\..\libs\thread\src\win32\thread.cpp"
...failed gcc.compile.c++ ......\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\link-static\threadapi-win32\threading-multi\win32\thread.o..
Ok, it seems that pthread compiles well, but there is a link issue. It is like if test_thread.o
was compiled without BOOST_THREAD_PROVIDES_INTERRUPTIONS
defined. Could you remove evreything in ..\..\..\bin.v2\libs\thread
and retry again?
With win32 there are a lot of issues.
I see yet
from ..\..\../boost/thread/pthread/thread_data.hpp:12,
and
typedef unsigned __int64 ticks_type;
I don't remember which one of pthread or win32 what the default api for cygwin. Since I have no PC Windows I've forgotten this platform a lot, but I believe it should be pthread.
Could you check which int64 type is available on this platform, and replace __int64 wit it?
Could you provide again the post-processing -E
?
Note that https://github.com/boostorg/thread/pull/211 will remove change the line
typedef unsigned __int64 ticks_type;
Maybe it is worth concentrating first on threadapi=pthread
.
Could you add also after
rule requirements ( properties * )
{
local result ;
if <threadapi>pthread in $(properties)
{
result += <define>BOOST_THREAD_POSIX ;
if <target-os>windows in $(properties)
{
local paths = [ win32_pthread_paths $(properties) ] ;
if $(paths)
{
result += $(paths) ;
}
else
{
result = <build>no ;
}
}
result += <define>BOOST_THREAD_DONT_USE_CHRONO ;
if ! [ configure.builds has_atomic_flag_lockfree
: $(properties) : "lockfree boost::atomic_flag" ] {
result += <library>/boost/atomic//boost_atomic ;
}
} else {
the following
if <threadapi>win32 in $(properties)
{
result += <define>BOOST_THREAD_WIN32 ;
}
This could explain the link incoherency.
Could you remove evreything in ......\bin.v2\libs\thread and retry again?
I've deleted the whole bin.v2
Could you provide again the post-processing
-E
?
Could you check which int64 type is available on this platform, and replace __int64 wit it?
It is not a buildin, but this compiles:
#include <windows.h>
int main()
{
__int64 a = 0;
return a;
}
IIUC it is a define /usr/include/w32api/_mingw.h:#define __int64 long long
Have you added twice in the Jamfile?
if <threadapi>win32 in $(properties)
{
result += <define>BOOST_THREAD_WIN32 ;
}
No. How it could affect threadapi=pthread
?
No way. This is for the possible win32 issue.
Please, could you remove the bin_v2 folder again and send me complete log of
../../../b2.exe -j2 toolset=gcc threadapi=pthread test_thread -d2
I would like to be sure we don't use different -D.
It is weird. the executable is not linking with boost_thread
"g++" -Wl,-rpath
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/chrono/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/system/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/test/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/timer/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/chrono/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/system/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/test/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link
-Wl,"/C:/Working/Repositories/boost/bin.v2/libs/timer/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi"
-o "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.exe"
-Wl,--start-group "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\test_thread.o"
"..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\build-no\threadapi-pthread\threading-multi\winrt_init.o"
"..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_unit_test_framework-gcc64-mt-d-x64-1_67.dll.a"
"..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_system-gcc64-mt-d-x64-1_67.dll.a"
-Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g -mthreads -m64
Here is is mine on MacOs and clang
"/Users/viboes/clang/clang+llvm-5.0.0-x86_64-apple-darwin/bin/clang++"
-o "../../../bin.v2/libs/thread/test/test_thread.test/clang-darwin-5.0.0_1z/debug/threadapi-pthread/threading-multi/test_thread"
"../../../bin.v2/libs/thread/test/test_thread.test/clang-darwin-5.0.0_1z/debug/threadapi-pthread/threading-multi/test_thread.o"
"../../../bin.v2/libs/thread/test/test_thread.test/clang-darwin-5.0.0_1z/debug/threadapi-pthread/threading-multi/winrt_init.o"
"../../../bin.v2/libs/thread/build/clang-darwin-5.0.0_1z/debug/threadapi-pthread/threading-multi/libboost_thread.dylib"
"../../../bin.v2/libs/chrono/build/clang-darwin-5.0.0_1z/debug/threading-multi/libboost_chrono.dylib"
"../../../bin.v2/libs/test/build/clang-darwin-5.0.0_1z/debug/threading-multi/libboost_unit_test_framework.dylib"
"../../../bin.v2/libs/system/build/clang-darwin-5.0.0_1z/debug/threading-multi/libboost_system.dylib"
-fPIC -m64 -g -std=c++1z -stdlib=libc++ -L/Users/viboes/clang/clang+llvm-5.0.0-x86_64-apple-darwin/lib
It is weird. the executable is not linking with boost_thread
Maybe because of that?
if <target-os>windows in $(properties)
{
local paths = [ win32_pthread_paths $(properties) ] ;
if $(paths)
{
result += $(paths) ;
}
else
{
result = <build>no ;
}
}
After adding this to user-config.jam
:
PTW32_INCLUDE = "G:\\msys64\\usr\\include" ;
PTW32_LIB = "G:\\msys64\\usr\\lib" ;
and changing that
if <toolset>gcc in $(properties)
{
libname = lib$(libname)GC2.a ;
}
to this
if <toolset>gcc in $(properties)
{
libname = lib$(libname)GC2.a lib$(libname).a ;
}
I have got the following
$ ../../../b2.exe -j2 toolset=gcc threadapi=pthread test_thread
Performing configuration checks
- default address-model : 64-bit (cached)
- default architecture : x86 (cached)
- symlinks supported : yes (cached)
- lockfree boost::atomic_flag : yes (cached)
...patience...
...patience...
...found 4372 targets...
...updating 11 targets...
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\future.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\pthread\once.o
gcc.compile.c++ ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\pthread\thread.o
gcc.link.dll ..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_thread_pthread-gcc64-mt-d-x64-1_67.dll.a
gcc.link ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_thread.exe
/usr/lib/../lib/libmsys-2.0.a(libcmain.o): In function `main':
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x94): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
"g++" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/chrono/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/system/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/test/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/thread/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/timer/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/chrono/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/system/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/test/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/thread/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -Wl,-rpath-link -Wl,"/C:/Working/Repositories/boost/bin.v2/libs/timer/build/gcc-gnu-6.4.0/debug/threadapi-pthread/threading-multi" -o "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_thread.exe" -Wl,--start-group "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_thread.o" "..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\winrt_init.o" "..\..\..\bin.v2\libs\thread\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_thread_pthread-gcc64-mt-d-x64-1_67.dll.a" "..\..\..\bin.v2\libs\chrono\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_chrono-gcc64-mt-d-x64-1_67.dll.a" "..\..\..\bin.v2\libs\test\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_unit_test_framework-gcc64-mt-d-x64-1_67.dll.a" "..\..\..\bin.v2\libs\system\build\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\libboost_system-gcc64-mt-d-x64-1_67.dll.a" "G:\msys64\usr\lib\libpthread.a" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g -mthreads -m64
...failed gcc.link ..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi\test_thread.exe...
...skipped <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi>test_thread.run for lack of <p..\..\..\bin.v2\libs\thread\test\test_thread.test\gcc-gnu-6.4.0\debug\threadapi-pthread\threading-multi>test_thread.exe...
...failed updating 1 target...
...skipped 2 targets...
...updated 8 targets...
I suspect is because we are linking winrt_init.o
, but I'm not sure .
rule thread-run ( sources )
{
sources = $(sources) winrt_init.cpp ;
It seems that the original authors Boost.Config and Boost.Predef considered cygwin a WINDOWS platform. That seems to be in contradiction to use threadapi=pthread
:(
In winrt_init.cpp
we have
#include <boost/predef/platform.h>
#if BOOST_PLAT_WINDOWS_RUNTIME
//...
We need some help from Boost.Config or Boost.Predef to know exactly which platform we are running on in this case.
I don't remember where you are with threadapi=win32
or letting the build system deduce the threadapi
property.
I suspect is because we are linking
winrt_init.o
, but I'm not sure .
Indeed. After removing winrt_init.cpp
it compiles and test passes.
I don't remember where you are with
threadapi=win32
The last post was with threadapi=pthread
as you can see from the command line ($ ../../../b2.exe -j2 toolset=gcc threadapi=pthread test_thread
)
Boost.Build does not bother with threading library on cygwin/msys and always links -mthreads
https://github.com/boostorg/build/blob/0d5e76ebf27bd2b0b7f3aa1a5c573dd37ab8ea5a/src/tools/gcc.jam#L378, should not it be:
threading-flags <target-os>cygwin,<threadapi>win32 : -mthreads ;
threading-flags <target-os>cygwin,<threadapi>pthread : -pthreads ;
and Boost.Thread win32_pthread_paths
for <target-os>cygwin
should not return <build>no
if there is no PTW32_INCLUDE
/PTW32_LIB
?
I am actually not interested in MSYS/Cygwin, if it is not important platform for you we can both stop wasting the time on this.
It is not important for me now. If you are not interested neither, we will wait until someone else has the patience to help to setup this correctly. Please, be free to close the issue if you don't want it to be fixed.
Microsoft Windows [Version 6.1.7601] gcc (GCC) 6.4.0
Run from Boost.Thread test folder: