Bug 691 - times function unsupported on mingw
times function unsupported on mingw
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
All All
: P5 normal
Assigned To: ns-bugs
:
Depends on:
Blocks: 705
  Show dependency treegraph
 
Reported: 2009-09-28 10:52 UTC by Mathieu Lacage
Modified: 2009-10-30 12:44 UTC (History)
1 user (show)

See Also:


Attachments
patch form gustavo (8.22 KB, patch)
2009-10-20 05:46 UTC, Mathieu Lacage
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Lacage 2009-09-28 10:52:57 UTC
The code in test.cc which calls 'times' cannot work on mingw. It would make sense move this kind of functionality to a system-independent class or, if we run short on time, remove the time capability from test.cc.

I would advocate the latter given the current timeframe.
Comment 1 Craig Dowell 2009-09-28 21:01:01 UTC
MinGW is not a supported platform.

That said, the MinGW issue keeps coming up periodically and I know Gustavo likes it a lot.  I think we should decide if MinGW is supported or not; and if it is not, stop filing bugs.  If it is, put it on the supported platform list.  The situation as it is doesn't seem reasonable to me.  If it is not supported we should not file bugs if it doesn't work.

I don't like Cygwin much either, so one other thing to consider is if the situation has changed enough over the past three years such that a Windows solution can just be virtualization.
Comment 2 Mathieu Lacage 2009-09-29 02:37:09 UTC
I don't like mingw much either but given how trivial it would be to remove the offending code, I believe that it makes no sense to not do it. 

The main reason I care about mingw is that it is at least useful is keeping us honest about writing portable code which is a good thing. In this case, if we wish to depend on os-dependent functions such as 'times' from an os-independent piece of code, we should wrap it in an os-independent shim layer. Mingw is just something which reveals an underlying problem, it is not the problem in and of itself.
Comment 3 Mathieu Lacage 2009-10-20 05:46:39 UTC
Created attachment 635 [details]
patch form gustavo
Comment 4 Craig Dowell 2009-10-20 13:09:18 UTC
Manna from Europe.  I went to do this last night and threw my computer out the window when I saw that the windows wall clock wasn't implemented.

Thanks, Gustavo!

Fixed changeset 04cc3ffe0202
Comment 5 Craig Dowell 2009-10-20 15:40:52 UTC
Not fixed.  Backed out.

There are warnings that break the build on fc-10.

The build works with this change on mingw, but test.py fails:

'.' is not recognized as an internal or external command,
operable program or batch file.

and

Traceback (most recent call last):
  File "./test.py", line 1296, in <module>
    sys.exit(main(sys.argv))
  File "./test.py", line 1293, in main
    return run_tests()
  File "./test.py", line 891, in run_tests
    if 'SC_NPROCESSORS_ONLN'in os.sysconf_names:
AttributeError: 'module' object has no attribute 'sysconf_names'
Comment 6 Mathieu Lacage 2009-10-21 10:28:41 UTC
(In reply to comment #5)
> The build works with this change on mingw, but test.py fails:

test.py needs to at least use os.path.* and, more specifically, os.path.join wherever you concatenate paths.
So, the previous patch is good: it is merely not enough to enable tests to pass on mingw.
Comment 7 Craig Dowell 2009-10-21 14:02:05 UTC
Not quite. 

The patch returns doubles which I don't like very much, but the fundamental problem is a cast from double to unsigned long long which generates warnings and breaks the build on FC-10 machines.

The patch needs to be fixed; and test.py needs to be fixed.  Then MinGW needs to be tested thoroughly.