Bug 691 - times function unsupported on mingw
: times function unsupported on mingw
Status: RESOLVED FIXED
: ns-3
simulation core
: ns-3-dev
: All All
: P5 normal
Assigned To:
:
:
:
: 705
  Show dependency treegraph
 
Reported: 2009-09-28 10:52 EDT by
Modified: 2009-10-30 12:44 EDT (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-09-28 10:52:57 EDT
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 From 2009-09-28 21:01:01 EDT -------
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 From 2009-09-29 02:37:09 EDT -------
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 From 2009-10-20 05:46:39 EDT -------
Created an attachment (id=635) [details]
patch form gustavo
------- Comment #4 From 2009-10-20 13:09:18 EDT -------
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 From 2009-10-20 15:40:52 EDT -------
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 From 2009-10-21 10:28:41 EDT -------
(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 From 2009-10-21 14:02:05 EDT -------
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.