classification
Title: Bogus usage of floatclock in timemodule
Type: compile error Stage:
Components: Build Versions: Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Link Mauve, python-dev, vstinner
Priority: normal Keywords:

Created on 2014-10-13 18:34 by Link Mauve, last changed 2016-07-08 15:55 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
pyconfig.h Link Mauve, 2014-10-14 09:43
Messages (7)
msg229260 - (view) Author: (Link Mauve) Date: 2014-10-13 18:34
In Modules/timemodule.c, py_process_time() still uses floatclock() even when HAVE_CLOCK isn’t defined.
msg229280 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-14 08:38
What is your platform?

time.process_time() supports many functions:

 - GetProcessTimes() (Windows only)
 - clock_gettime(CLOCK_PROF)
 - clock_gettime(CLOCK_PROCESS_CPUTIME_ID)
 - getrusage(RUSAGE_SELF)
 - times()
 - clock()

On POSIX, clock() is always tried as a fallback. Does your platform support at least one of these functions?
msg229281 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-14 08:38
See also the PEP 418:
http://legacy.python.org/dev/peps/pep-0418/#time-process-time
msg229283 - (view) Author: (Link Mauve) Date: 2014-10-14 09:29
I’m building against the Newlib libc, for the Wii, and it seems the issue leading to all of those functions not working is:
(.text.clock+0x18): undefined reference to `_times_r'

Threading is disabled, and reentrant functions as well, which could explain that.

But still, when pyconfig.h doesn’t define any HAVE_ macro to get the system time, I would expect py_process_time() to return None or something instead of failing to build.
msg229284 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-14 09:42
Please attach your pyconfig.h file.
msg269990 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-07-08 15:23
Sorry but the Wii console is not supported. You have to maintain your fork/patch.

Python 3 don't support platforms without clock().
msg269993 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-08 15:55
New changeset 1452520dfe7b by Victor Stinner in branch 'default':
Issue #22624: Python 3 requires clock() to build
https://hg.python.org/cpython/rev/1452520dfe7b
History
Date User Action Args
2016-07-08 15:55:55python-devsetnosy: + python-dev
messages: + msg269993
2016-07-08 15:23:05vstinnersetstatus: open -> closed
resolution: wont fix
messages: + msg269990
2014-10-14 09:43:38Link Mauvesetfiles: + pyconfig.h
2014-10-14 09:42:13vstinnersetmessages: + msg229284
2014-10-14 09:29:33Link Mauvesetmessages: + msg229283
2014-10-14 08:38:27vstinnersetmessages: + msg229281
2014-10-14 08:38:03vstinnersetmessages: + msg229280
2014-10-14 00:01:53pitrousetnosy: + vstinner
2014-10-13 18:34:55Link Mauvecreate