thread no defined - issue
Hi all, one single (windows) user in my project community (http://www.soundjack.eu) has the following problem: #ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine. Does anybody know what he can do in order to fix this issue ? Thanks in advance, best Alex
On 6/09/2016 07:14, Alexander Carôt wrote:
one single (windows) user in my project community (http://www.soundjack.eu) has the following problem:
#ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif
This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine.
I haven't tried checking older versions of Boost to see if it's different, but AFAICT in 1.60 this symbol is only defined when using pthreads, which would not normally be the case on Windows unless you're using Cygwin (or possibly mingw). They could try defining BOOST_THREAD_POSIX to force use of pthreads if you require this for some reason, but this would have to be defined when compiling Boost itself, any libraries that use Boost, and for the application. If at all possible you should make your code work with both pthreads and Win32 threads.
Le 06/09/2016 à 01:40, Gavin Lambert a écrit :
On 6/09/2016 07:14, Alexander Carôt wrote:
one single (windows) user in my project community (http://www.soundjack.eu) has the following problem:
#ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif
This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine.
I haven't tried checking older versions of Boost to see if it's different, but AFAICT in 1.60 this symbol is only defined when using pthreads, which would not normally be the case on Windows unless you're using Cygwin (or possibly mingw).
They could try defining BOOST_THREAD_POSIX to force use of pthreads if you require this for some reason, but this would have to be defined when compiling Boost itself, any libraries that use Boost, and for the application.
If at all possible you should make your code work with both pthreads and Win32 threads.
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine. If some one can spend some time trying to create a port to Win/cygwin/... I'll be open to take in account the patch. Best, Vicente P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform.
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine.
Yes, this is correct - however, do we understand correctly ? I am talking of a compiled binary that works on any machine except for one user. Does this change the view on the problem or does it remain the same ?
P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform.
I prefer using OSX but since my main user base is on Windows I have to work with it as well. For that reason I have Win10 in a virtual machine, which works extremely well. I am not sure if I can fulfill this role but we can give it a try if you are fine with this. Best Alex -- http://www.carot.de Email : Alexander@Carot.de Tel.: +49 (0)177 5719797
Gesendet: Dienstag, 06. September 2016 um 19:00 Uhr Von: "Vicente J. Botet Escriba"
An: boost-users@lists.boost.org Betreff: Re: [Boost-users] thread no defined - issue Le 06/09/2016 à 01:40, Gavin Lambert a écrit :
On 6/09/2016 07:14, Alexander Carôt wrote:
one single (windows) user in my project community (http://www.soundjack.eu) has the following problem:
#ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif
This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine.
I haven't tried checking older versions of Boost to see if it's different, but AFAICT in 1.60 this symbol is only defined when using pthreads, which would not normally be the case on Windows unless you're using Cygwin (or possibly mingw).
They could try defining BOOST_THREAD_POSIX to force use of pthreads if you require this for some reason, but this would have to be defined when compiling Boost itself, any libraries that use Boost, and for the application.
If at all possible you should make your code work with both pthreads and Win32 threads.
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine.
If some one can spend some time trying to create a port to Win/cygwin/... I'll be open to take in account the patch.
Best, Vicente
P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Le 09/09/2016 à 16:05, "Alexander Carôt" a écrit :
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine. Yes, this is correct - however, do we understand correctly ? I am talking of a compiled binary that works on any machine except for one user. Does this change the view on the problem or does it remain the same ?
I forgot that we can compile with pthreads on windows. At least the comments on the Jamfile says that. " # For the library variant that is not native on the build platform # an additional tag is applied: # boost_thread_pthread for the pthread variant on windows, and # boost_thread_win32 for the win32 variant (likely when built on cygwin). # # To request the pthread variant on windows, from boost root you would # say e.g: # bjam msvc-8.0 --with-thread install threadapi=pthread " How have you built boost and how your user has build boost? Which compile time flags are you using in your application and which is using your user? Are you defining BOOST_THREAD_POSIX
P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform.
I prefer using OSX but since my main user base is on Windows I have to work with it as well. For that reason I have Win10 in a virtual machine, which works extremely well.
I am not sure if I can fulfill this role but we can give it a try if you are fine with this.
You can start by following the Windows specific bugs (or whatever bug as well) and pushing some PR for them. Once I have an idea of what kind of work you can do, I can request to give you the needed rights to commit your self any change and become a co-maintainer. Best, Vicente
Best
Alex
-- http://www.carot.de Email : Alexander@Carot.de Tel.: +49 (0)177 5719797
Gesendet: Dienstag, 06. September 2016 um 19:00 Uhr Von: "Vicente J. Botet Escriba"
An: boost-users@lists.boost.org Betreff: Re: [Boost-users] thread no defined - issue Le 06/09/2016 à 01:40, Gavin Lambert a écrit :
one single (windows) user in my project community (http://www.soundjack.eu) has the following problem:
#ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif
This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine. I haven't tried checking older versions of Boost to see if it's different, but AFAICT in 1.60 this symbol is only defined when using
On 6/09/2016 07:14, Alexander Carôt wrote: pthreads, which would not normally be the case on Windows unless you're using Cygwin (or possibly mingw).
They could try defining BOOST_THREAD_POSIX to force use of pthreads if you require this for some reason, but this would have to be defined when compiling Boost itself, any libraries that use Boost, and for the application.
If at all possible you should make your code work with both pthreads and Win32 threads.
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine.
If some one can spend some time trying to create a port to Win/cygwin/... I'll be open to take in account the patch.
Best, Vicente
P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
# For the library variant that is not native on the build platform # an additional tag is applied: # boost_thread_pthread for the pthread variant on windows, and # boost_thread_win32 for the win32 variant (likely when built on cygwin). # # To request the pthread variant on windows, from boost root you would # say e.g: # bjam msvc-8.0 --with-thread install threadapi=pthread
How have you built boost and how your user has build boost? Which compile time flags are you using in your application and which is using your user? Are you defining BOOST_THREAD_POSIX
No, not at all: I am neither compiling boost with additional flags nor am I defining anything in my sources. The user simply runs a binary, which tells that threads are not available and hence does not work at all. So - maybe this is where the problem starts: Should I explicitely compile boost with thread-support (or even pthread-support) ?
You can start by following the Windows specific bugs (or whatever bug as well) and pushing some PR for them. Once I have an idea of what kind of work you can do, I can request to give you the needed rights to commit your self any change and become a co-maintainer.
Perfect - right now I cannot estimate the time I have to work on it so this is a good way to figure it out. Best Alex
Gesendet: Dienstag, 06. September 2016 um 19:00 Uhr Von: "Vicente J. Botet Escriba"
An: boost-users@lists.boost.org Betreff: Re: [Boost-users] thread no defined - issue Le 06/09/2016 à 01:40, Gavin Lambert a écrit :
one single (windows) user in my project community (http://www.soundjack.eu) has the following problem:
#ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif
This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine. I haven't tried checking older versions of Boost to see if it's different, but AFAICT in 1.60 this symbol is only defined when using
On 6/09/2016 07:14, Alexander Carôt wrote: pthreads, which would not normally be the case on Windows unless you're using Cygwin (or possibly mingw).
They could try defining BOOST_THREAD_POSIX to force use of pthreads if you require this for some reason, but this would have to be defined when compiling Boost itself, any libraries that use Boost, and for the application.
If at all possible you should make your code work with both pthreads and Win32 threads.
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine.
If some one can spend some time trying to create a port to Win/cygwin/... I'll be open to take in account the patch.
Best, Vicente
P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Le 10/09/2016 à 10:39, "Alexander Carôt" a écrit :
# For the library variant that is not native on the build platform # an additional tag is applied: # boost_thread_pthread for the pthread variant on windows, and # boost_thread_win32 for the win32 variant (likely when built on cygwin). # # To request the pthread variant on windows, from boost root you would # say e.g: # bjam msvc-8.0 --with-thread install threadapi=pthread
How have you built boost and how your user has build boost? Which compile time flags are you using in your application and which is using your user? Are you defining BOOST_THREAD_POSIX No, not at all: I am neither compiling boost with additional flags nor am I defining anything in my sources.
The user simply runs a binary, which tells that threads are not available and hence does not work at all.
So - maybe this is where the problem starts: Should I explicitely compile boost with thread-support (or even pthread-support) ? Compile it using
bjam <your compiler> --with-thread install threadapi=pthread and define in your application BOOST_THREAD_POSIX if you don't use bham. Let me know how it works?
You can start by following the Windows specific bugs (or whatever bug as well) and pushing some PR for them. Once I have an idea of what kind of work you can do, I can request to give you the needed rights to commit your self any change and become a co-maintainer. Perfect - right now I cannot estimate the time I have to work on it so this is a good way to figure it out.
Great.
Best
Alex
Gesendet: Dienstag, 06. September 2016 um 19:00 Uhr Von: "Vicente J. Botet Escriba"
An: boost-users@lists.boost.org Betreff: Re: [Boost-users] thread no defined - issue Le 06/09/2016 à 01:40, Gavin Lambert a écrit :
one single (windows) user in my project community (http://www.soundjack.eu) has the following problem:
#ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif
This statement is true but only for him – on any other machine (Win, Linux and OSX) is works fine. I haven't tried checking older versions of Boost to see if it's different, but AFAICT in 1.60 this symbol is only defined when using
On 6/09/2016 07:14, Alexander Carôt wrote: pthreads, which would not normally be the case on Windows unless you're using Cygwin (or possibly mingw).
They could try defining BOOST_THREAD_POSIX to force use of pthreads if you require this for some reason, but this would have to be defined when compiling Boost itself, any libraries that use Boost, and for the application.
If at all possible you should make your code work with both pthreads and Win32 threads.
AFAIK Boost.Thread don't use the pthread API on Windows. This will imply a lot of changes that I can not test now as I don't have a Windows machine.
If some one can spend some time trying to create a port to Win/cygwin/... I'll be open to take in account the patch.
Best, Vicente
P.S. I will need an experimented Windows guy that help me as co-maintainer for the Windows platform. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On 10/09/2016 20:39, "Alexander Carôt" wrote:
How have you built boost and how your user has build boost? Which compile time flags are you using in your application and which is using your user? Are you defining BOOST_THREAD_POSIX
No, not at all: I am neither compiling boost with additional flags noram I defining anything in my sources.
The user simply runs a binary, which tells that threads are not available and hence does not work at all.
The code that you highlighted is based on a preprocessor symbol, so it is impossible for this to trigger on one machine and not another unless they are recompiling the sources rather than using a pre-built binary.
So - maybe this is where the problem starts: Should I explicitely compile boost with thread-support (or even pthread-support) ?
Boost should be compiled with thread support by default. This thread support might be native Windows rather than pthreads. Ideally, you should not care which of these are used, and should stick to the common Boost.Thread APIs that work on both. So probably the code that you highlighted is checking the wrong thing, since it's looking for something pthreads-specific. As I said before, the best thing to do is to change your code so that it's not pthreads-specific by removing use of native/pthreads APIs -- or failing that (if there's some reason you absolutely must use the native API for something), use a better method to identify whether pthreads or Windows threads are used and do the appropriate native thing in each case. Always forcing use of pthreads is another option, but it's a less-good option. You might be able to get away with it for an application, but it's a very bad idea if you're making a library or something the user is expected to compile themselves.
Hello Gavin, thanks for your replay and sorry for the delay. In the meantime I figured that I was on a wrong track. The code: #ifndef BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE cout << "THREAD IS NOT DEFINED" << endl; #endif is triggered on any windows machine - also on the ones where everything is running perfectly fine. So probably the problem with this single user is maybe even not thread related - let's see ... Thanks for your help, which made me realize this. Best Alex -- http://www.carot.de Email : Alexander@Carot.de Tel.: +49 (0)177 5719797
Gesendet: Donnerstag, 15. September 2016 um 05:34 Uhr Von: "Gavin Lambert"
An: boost-users@lists.boost.org Betreff: Re: [Boost-users] thread no defined - issue On 10/09/2016 20:39, "Alexander Carôt" wrote:
How have you built boost and how your user has build boost? Which compile time flags are you using in your application and which is using your user? Are you defining BOOST_THREAD_POSIX
No, not at all: I am neither compiling boost with additional flags noram I defining anything in my sources.
The user simply runs a binary, which tells that threads are not available and hence does not work at all.
The code that you highlighted is based on a preprocessor symbol, so it is impossible for this to trigger on one machine and not another unless they are recompiling the sources rather than using a pre-built binary.
So - maybe this is where the problem starts: Should I explicitely compile boost with thread-support (or even pthread-support) ?
Boost should be compiled with thread support by default. This thread support might be native Windows rather than pthreads. Ideally, you should not care which of these are used, and should stick to the common Boost.Thread APIs that work on both.
So probably the code that you highlighted is checking the wrong thing, since it's looking for something pthreads-specific.
As I said before, the best thing to do is to change your code so that it's not pthreads-specific by removing use of native/pthreads APIs -- or failing that (if there's some reason you absolutely must use the native API for something), use a better method to identify whether pthreads or Windows threads are used and do the appropriate native thing in each case.
Always forcing use of pthreads is another option, but it's a less-good option. You might be able to get away with it for an application, but it's a very bad idea if you're making a library or something the user is expected to compile themselves.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (4)
-
"Alexander Carôt"
-
Alexander Carôt
-
Gavin Lambert
-
Vicente J. Botet Escriba