Boost C++ Libraries: Ticket #5543: Thread clock compatibility problems on Android https://svn.boost.org/trac10/ticket/5543 <p> There are compatibility problems of chrono library on Android (Android 2.2, NDK-r5b, chrono v0.71, rev <a class="missing ticket">#71693</a>): </p> <p> 1) Sources with boost::chrono::thread_clock does not compile, since _POSIX_THREAD_CPUTIME is not defined on Android. My workaround is to hack chrono/config.hpp: # if 1 <em>defined(_POSIX_THREAD_CPUTIME) # define BOOST_CHRONO_HAS_THREAD_CLOCK # define BOOST_CHRONO_THREAD_CLOCK_IS_MONOTONIC true # endif </em></p> <p> 2) ::clock_gettime() fails when called with clock ID got from pthread_getcpuclockid. My workaround is to call ::clock_gettime( CLOCK_THREAD_CPUTIME_ID, &amp;ts ) in chrono/detail/inlined/posix/thread_clock.hpp. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5543 Trac 1.4.3 Libor Bus <libor.bus@…> Sat, 14 May 2011 18:59:52 GMT <link>https://svn.boost.org/trac10/ticket/5543#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5543#comment:1</guid> <description> <p> See discussion at: <a class="ext-link" href="http://boost.2283326.n4.nabble.com/chrono-Thread-clock-compatibility-problems-on-Android-td3520310.html"><span class="icon">​</span>http://boost.2283326.n4.nabble.com/chrono-Thread-clock-compatibility-problems-on-Android-td3520310.html</a> </p> </description> <category>Ticket</category> </item> <item> <author>Peter Schueller <ps@…></author> <pubDate>Mon, 16 May 2011 23:43:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5543#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5543#comment:2</guid> <description> <p> did this perhaps break something in the trunk? </p> <p> Starting sometime after revision 71950 I can no longer build the trunk, I get </p> <pre class="wiki"> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -pthread -fPIC -Wextra -Wno-long-long -pedantic -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DNDEBUG -I"." -c -o "bin.v2/libs/chrono/build/gcc-4.4.5/release/threading-multi/thread_clock.o" "libs/chrono/src/thread_clock.cpp" In file included from ./boost/chrono/detail/inlined/thread_clock.hpp:39, from libs/chrono/src/thread_clock.cpp:18: ./boost/chrono/detail/inlined/posix/thread_clock.hpp: In static member function ‘static boost::chrono::time_point&lt;boost::chrono::thread_clock, boost::chrono::duration&lt;long int, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; boost::chrono::thread_clock::now()’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:26: error: ‘ts’ was not declared in this scope ./boost/chrono/detail/inlined/posix/thread_clock.hpp:47: error: ‘ts’ was not declared in this scope ./boost/chrono/detail/inlined/posix/thread_clock.hpp: In static member function ‘static boost::chrono::time_point&lt;boost::chrono::thread_clock, boost::chrono::duration&lt;long int, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; boost::chrono::thread_clock::now(boost::system::error_code&amp;)’: ./boost/chrono/detail/inlined/posix/thread_clock.hpp:54: error: ‘ts’ was not declared in this scope ./boost/chrono/detail/inlined/posix/thread_clock.hpp:86: error: ‘ts’ was not declared in this scope </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 28 May 2011 07:07:48 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/5543#comment:3 https://svn.boost.org/trac10/ticket/5543#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.47.0</span> </li> </ul> <p> Solution merged to release branch: Committed revision 72239. </p> Ticket