Boost C++ Libraries: Ticket #6918: Boost Chrono compilation failure on HP uX due to undefined pthread_getcpuclockid https://svn.boost.org/trac10/ticket/6918 <p> I'm getting the following </p> <pre class="wiki">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, &amp;clock_id); ^ "./boost/chrono/detail/inlined/posix/thread_clock.hpp", line 60: error #2020: identifier "pthread_getcpuclockid" is undefined pthread_getcpuclockid(pth, &amp;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... </pre><p> Compiler version is aCC: HP C/aC++ B3910B A.06.20 [May 13 2008] </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6918 Trac 1.4.3 Claudio Bantaloukas <rockdreamer@…> Fri, 18 May 2012 14:24:41 GMT <link>https://svn.boost.org/trac10/ticket/6918#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:1</guid> <description> <p> I have already tried adding #include &lt;pthread.h&gt; as per ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6666" title="#6666: Bugs: thread_clock.hpp needs pthread.h (closed: fixed)">#6666</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 28 May 2012 17:01:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6918#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:2</guid> <description> <p> Could you tell me which defines to use to check for HP compiler/pthread library used? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 03 Jun 2012 14:02:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6918#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:3</guid> <description> <p> BTW, </p> <p> could you try defining BOOST_CHRONO_THREAD_DISABLED? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 03 Jun 2012 14:04:47 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/6918#comment:4 https://svn.boost.org/trac10/ticket/6918#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Claudio Bantaloukas <rockdreamer@…> Mon, 04 Jun 2012 13:19:37 GMT <link>https://svn.boost.org/trac10/ticket/6918#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6918#comment:2" title="Comment 2">viboes</a>: </p> <blockquote class="citation"> <p> Could you tell me which defines to use to check for HP compiler/pthread library used? </p> </blockquote> <p> sure, the compiler macro according to <a class="ext-link" href="http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers#HP_aC.2B.2B"><span class="icon">​</span>predef</a> is <code> __HP_aCC </code> and the OS macro is <code> __hpux </code> </p> <p> Testing for this combination should be equivalent for testing for HP-UX phtread implementation presence </p> <p> Do note that I am currently compiling in gcc emulation mode so <code> __GNUC__ </code> 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. </p> </description> <category>Ticket</category> </item> <item> <author>Claudio Bantaloukas <rockdreamer@…></author> <pubDate>Mon, 04 Jun 2012 13:32:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6918#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6918#comment:3" title="Comment 3">viboes</a>: </p> <blockquote class="citation"> <p> BTW, </p> <p> could you try defining BOOST_CHRONO_THREAD_DISABLED? </p> </blockquote> <p> sure, I added cxxflags=-DBOOST_CHRONO_THREAD_DISABLED to the bjam invocation and chrono and timer were built without errors. </p> <p> What feature am I missing when this macro is defined? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 30 Jun 2012 17:22:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6918#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:7</guid> <description> <p> 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. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 07 Jul 2012 09:49:22 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6918 https://svn.boost.org/trac10/ticket/6918 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">6918.patch</span> </li> </ul> Ticket viboes Sat, 07 Jul 2012 09:53:18 GMT <link>https://svn.boost.org/trac10/ticket/6918#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:8</guid> <description> <p> Could you tell me if the attached patch solves the issue? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 07 Jul 2012 10:14:16 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/6918#comment:9 https://svn.boost.org/trac10/ticket/6918#comment:9 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> <p> Committed in trunk revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/79324" title="Chrono: apply patch 6918">[79324]</a>. </p> Ticket viboes Sun, 08 Jul 2012 20:48:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6918#comment:10 https://svn.boost.org/trac10/ticket/6918#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/79371" title="Chrono: merge from trunk">[79371]</a>. </p> Ticket artem.goncharov@… Thu, 31 Jan 2013 13:10:09 GMT <link>https://svn.boost.org/trac10/ticket/6918#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:11</guid> <description> <p> I'm not able to compile boost 1.52 with gcc (tried 4.6.3, 4.7.2) with the same error </p> <pre class="wiki">./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&amp;)’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:60:45: error: ‘pthread_getcpuclockid’ was not declared in this scope </pre> </description> <category>Ticket</category> </item> <item> <author>artem.goncharov@…</author> <pubDate>Thu, 31 Jan 2013 15:10:50 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6918 https://svn.boost.org/trac10/ticket/6918 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">config.hpp.patch</span> </li> </ul> <p> this patch helped me to get it complied and working with GCC on HP-UX </p> Ticket viboes Thu, 31 Jan 2013 17:51:37 GMT <link>https://svn.boost.org/trac10/ticket/6918#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:12</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6918#comment:11" title="Comment 11">artem.goncharov@…</a>: </p> <blockquote class="citation"> <p> I'm not able to compile boost 1.52 with gcc (tried 4.6.3, 4.7.2) with the same error </p> <pre class="wiki">./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&amp;)’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:60:45: error: ‘pthread_getcpuclockid’ was not declared in this scope </pre></blockquote> <p> With which platform are you getting these errors? Which PThread library are you using? Which defines could be checked to identify it? </p> </description> <category>Ticket</category> </item> <item> <author>artem.goncharov@…</author> <pubDate>Thu, 31 Jan 2013 17:59:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6918#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:13</guid> <description> <p> 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. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 22 Nov 2013 15:16:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6918#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:14</guid> <description> <p> I'm facing the same issue as described above; </p> <p> boost 1.55 platform: hp-ux 1131 compiler: gcc 4.6.3 </p> <p> The described "config patch" works fine ! Was the fix reported 10 months ago lost, and not merged into the trunk ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 22 Nov 2013 17:06:10 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/6918#comment:15 https://svn.boost.org/trac10/ticket/6918#comment:15 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6918#comment:14" title="Comment 14">anonymous</a>: </p> <blockquote class="citation"> <p> I'm facing the same issue as described above; </p> <p> boost 1.55 platform: hp-ux 1131 compiler: gcc 4.6.3 </p> <p> The described "config patch" works fine ! Was the fix reported 10 months ago lost, and not merged into the trunk ? </p> </blockquote> <p> 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. </p> Ticket viboes Sat, 23 Nov 2013 18:14:40 GMT <link>https://svn.boost.org/trac10/ticket/6918#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6918#comment:16</guid> <description> <p> Does the pacth of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9379" title="#9379: Bugs: 'boost::chrono::steady_clock' has not been declared&#34; on boost 1.55, ... (closed: wontfix)">#9379</a> fixes this issue? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 21 Jan 2014 18:10:42 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/6918#comment:17 https://svn.boost.org/trac10/ticket/6918#comment:17 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.51.0</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> <p> <a class="ext-link" href="https://github.com/boostorg/chrono/commit/21b5ff53d1cb1c165355f3f3c210d74bba57700e"><span class="icon">​</span>https://github.com/boostorg/chrono/commit/21b5ff53d1cb1c165355f3f3c210d74bba57700e</a> </p> Ticket viboes Sun, 23 Feb 2014 13:41:01 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6918#comment:18 https://svn.boost.org/trac10/ticket/6918#comment:18 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged to master <a class="ext-link" href="https://github.com/boostorg/chrono/commit/143260daeb2703961448a0928d199747ca34dfca"><span class="icon">​</span>https://github.com/boostorg/chrono/commit/143260daeb2703961448a0928d199747ca34dfca</a> </p> Ticket