Modify

Ticket #6918 (closed Bugs: fixed)

Opened 2 years ago

Last modified 8 weeks ago

Boost Chrono compilation failure on HP uX due to undefined pthread_getcpuclockid

Reported by: Claudio Bantaloukas <rockdreamer@…> 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

6918.patch Download (514 bytes) - added by viboes 22 months ago.
config.hpp.patch Download (439 bytes) - added by artem.goncharov@… 15 months ago.
this patch helped me to get it complied and working with GCC on HP-UX

Change History

comment:1 Changed 2 years ago by Claudio Bantaloukas <rockdreamer@…>

I have already tried adding #include <pthread.h> as per ticket #6666

comment:2 follow-up: ↓ 5 Changed 23 months ago by viboes

Could you tell me which defines to use to check for HP compiler/pthread library used?

comment:3 follow-up: ↓ 6 Changed 23 months ago by viboes

BTW,

could you try defining BOOST_CHRONO_THREAD_DISABLED?

comment:4 Changed 23 months ago by viboes

  • Status changed from new to assigned

comment:5 in reply to: ↑ 2 Changed 23 months ago by Claudio Bantaloukas <rockdreamer@…>

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 in reply to: ↑ 3 Changed 23 months ago by Claudio Bantaloukas <rockdreamer@…>

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 Changed 22 months ago by viboes

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.

Changed 22 months ago by viboes

comment:8 Changed 22 months ago by viboes

Could you tell me if the attached patch solves the issue?

comment:9 Changed 22 months ago by viboes

  • Milestone changed from To Be Determined to Boost 1.51.0

Committed in trunk revision [79324].

Last edited 15 months ago by viboes (previous) (diff)

comment:10 Changed 22 months ago by viboes

  • Status changed from assigned to closed
  • Resolution set to fixed

Committed revision [79371].

Last edited 15 months ago by viboes (previous) (diff)

comment:11 follow-up: ↓ 12 Changed 15 months ago by 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
Last edited 15 months ago by viboes (previous) (diff)

Changed 15 months ago by artem.goncharov@…

this patch helped me to get it complied and working with GCC on HP-UX

comment:12 in reply to: ↑ 11 Changed 15 months ago by viboes

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?

Last edited 15 months ago by viboes (previous) (diff)

comment:13 Changed 15 months ago by artem.goncharov@…

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.

comment:14 follow-up: ↓ 15 Changed 5 months ago by 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 ?

comment:15 in reply to: ↑ 14 Changed 5 months ago by viboes

  • Status changed from closed to reopened
  • Resolution fixed deleted

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:16 Changed 5 months ago by viboes

Does the pacth of #9379 fixes this issue?

comment:17 Changed 3 months ago by viboes

  • Milestone changed from Boost 1.51.0 to Boost 1.56.0

comment:18 Changed 8 weeks ago by viboes

  • Status changed from reopened to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.