Opened 10 years ago
Closed 9 years ago
#6918 closed Bugs (fixed)
Boost Chrono compilation failure on HP uX due to undefined pthread_getcpuclockid
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Boost 1.56.0 | Component: | chrono |
Version: | Boost 1.49.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I'm getting the following
acc.compile.c++ bin.v2/libs/chrono/build/acc/release/address-model-64/link-static/threading-multi/thread_clock.o "./boost/chrono/detail/inlined/posix/thread_clock.hpp", line 34: error #2020: identifier "pthread_getcpuclockid" is undefined pthread_getcpuclockid(pth, &clock_id); ^ "./boost/chrono/detail/inlined/posix/thread_clock.hpp", line 60: error #2020: identifier "pthread_getcpuclockid" is undefined pthread_getcpuclockid(pth, &clock_id); ^ 2 errors detected in the compilation of "libs/chrono/src/thread_clock.cpp". aCC -AA -c -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -O3 +DD64 -mt -I"." -I"/home/ebaxct02/hudson/workspace/tff-sdk-trunk-hpux-64bit/build/src/zlib" -I"/home/ebaxct02/hudson/workspace/tff-sdk-trunk-hpux-64bit/src/bzip2" -I"/home/ebaxct02/hudson/workspace/tff-sdk-trunk-hpux-64bit/src/zlib" -o "bin.v2/libs/chrono/build/acc/release/address-model-64/link-static/threading-multi/thread_clock.o" "libs/chrono/src/thread_clock.cpp" ...failed acc.compile.c++ bin.v2/libs/chrono/build/acc/release/address-model-64/link-static/threading-multi/thread_clock.o...
Compiler version is aCC: HP C/aC++ B3910B A.06.20 [May 13 2008]
Attachments (2)
Change History (20)
comment:1 by , 10 years ago
follow-up: 5 comment:2 by , 10 years ago
Could you tell me which defines to use to check for HP compiler/pthread library used?
comment:4 by , 10 years ago
Status: | new → assigned |
---|
comment:5 by , 10 years ago
Replying to viboes:
Could you tell me which defines to use to check for HP compiler/pthread library used?
sure, the compiler macro according to predef is __HP_aCC
and the OS macro is __hpux
Testing for this combination should be equivalent for testing for HP-UX phtread implementation presence
Do note that I am currently compiling in gcc emulation mode so __GNUC__
is also defined. I know there's gcc for hp.ux but I'm unsure if it uses hp-ux pthread implementation or something else.
comment:6 by , 10 years ago
Replying to viboes:
BTW,
could you try defining BOOST_CHRONO_THREAD_DISABLED?
sure, I added cxxflags=-DBOOST_CHRONO_THREAD_DISABLED to the bjam invocation and chrono and timer were built without errors.
What feature am I missing when this macro is defined?
comment:7 by , 10 years ago
Boost.Chrono try to see if there are thread clocks using some compiler flags. For what you mention, it seams that there is no support for thread clocks on use pthread library. When you define BOOST_CHRONO_THREAD_DISABLED this inspection is disabled.
by , 10 years ago
Attachment: | 6918.patch added |
---|
comment:9 by , 10 years ago
Milestone: | To Be Determined → Boost 1.51.0 |
---|
Committed in trunk revision [79324].
comment:10 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed revision [79371].
follow-up: 12 comment:11 by , 10 years ago
I'm not able to compile boost 1.52 with gcc (tried 4.6.3, 4.7.2) with the same error
./boost/chrono/detail/inlined/posix/thread_clock.hpp: In static member function ‘static boost::chrono::thread_clock::time_point boost::chrono::thread_clock::now()’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:34:45: error: ‘pthread_getcpuclockid’ was not declared in this scope ./boost/chrono/detail/inlined/posix/thread_clock.hpp: In static member function ‘static boost::chrono::thread_clock::time_point boost::chrono::thread_clock::now(boost::system::error_code&)’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:60:45: error: ‘pthread_getcpuclockid’ was not declared in this scope
by , 10 years ago
Attachment: | config.hpp.patch added |
---|
this patch helped me to get it complied and working with GCC on HP-UX
comment:12 by , 10 years ago
Replying to artem.goncharov@…:
I'm not able to compile boost 1.52 with gcc (tried 4.6.3, 4.7.2) with the same error
./boost/chrono/detail/inlined/posix/thread_clock.hpp: In static member function ‘static boost::chrono::thread_clock::time_point boost::chrono::thread_clock::now()’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:34:45: error: ‘pthread_getcpuclockid’ was not declared in this scope ./boost/chrono/detail/inlined/posix/thread_clock.hpp: In static member function ‘static boost::chrono::thread_clock::time_point boost::chrono::thread_clock::now(boost::system::error_code&)’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:60:45: error: ‘pthread_getcpuclockid’ was not declared in this scope
With which platform are you getting these errors? Which PThread library are you using? Which defines could be checked to identify it?
comment:13 by , 10 years ago
GCC on the HPUX. As mentioned in the patch - the initial problem is not aCC compiler problem, but the platform itself. I have extended initial patch to disable macroses also for GCC/hpux, but might be, that it is necessary to apply fix in case of hpux platform in general.
follow-up: 15 comment:14 by , 9 years ago
I'm facing the same issue as described above;
boost 1.55 platform: hp-ux 1131 compiler: gcc 4.6.3
The described "config patch" works fine ! Was the fix reported 10 months ago lost, and not merged into the trunk ?
comment:15 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Replying to anonymous:
I'm facing the same issue as described above;
boost 1.55 platform: hp-ux 1131 compiler: gcc 4.6.3
The described "config patch" works fine ! Was the fix reported 10 months ago lost, and not merged into the trunk ?
I don't use to read the tickets that are already closed. artem.goncharov should had reported it by reopening the ticket or creating an additional one so that I could take care of it.
comment:17 by , 9 years ago
Milestone: | Boost 1.51.0 → Boost 1.56.0 |
---|
comment:18 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I have already tried adding #include <pthread.h> as per ticket #6666