Bugzilla – Bug 318
system mutex APIs missing in mingw, linking errors
Last modified: 2008-09-08 07:39:20 UTC
I would rather just disable the real-time simulator feature on mingw... debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns317RealtimeEv entLock4LockEv': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:68: undefined r eference to `ns3::SystemMutex::Lock()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns317RealtimeEv entLock6UnlockEv': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:74: undefined r eference to `ns3::SystemMutex::Unlock()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImplC2Ev': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:78: undefined r eference to `ns3::SystemMutex::SystemMutex()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:98: undefined r eference to `ns3::SystemMutex::~SystemMutex()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImplC1Ev': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:78: undefined r eference to `ns3::SystemMutex::SystemMutex()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:98: undefined r eference to `ns3::SystemMutex::~SystemMutex()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImplD2Ev': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:111: undefined reference to `ns3::SystemMutex::~SystemMutex()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:111: undefined reference to `ns3::SystemMutex::~SystemMutex()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImplD1Ev': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:111: undefined reference to `ns3::SystemMutex::~SystemMutex()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:111: undefined reference to `ns3::SystemMutex::~SystemMutex()' debug\src\simulator\realtime-simulator-impl_1.o:P:/ns/ns-3-dev/build/../src/simu lator/realtime-simulator-impl.cc:111: more undefined references to `ns3::SystemM utex::~SystemMutex()' follow debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl12SetSchedulerENS_3PtrINS_9SchedulerEEE': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:145: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:155: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:155: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl15ProcessOneEventEv': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:202: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:232: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:232: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:307: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:313: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:313: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZNK3ns321RealtimeS imulatorImpl10IsFinishedEv': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:362: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:363: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:363: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl3RunEv': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:407: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:426: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:426: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:443: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:445: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:445: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl8ScheduleERKNS_8TimeUnitILi1EEERKNS_3PtrINS_9EventImplEEE': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:575: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:589: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:589: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl11ScheduleNowERKNS_3PtrINS_9EventImplEEE': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:601: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:608: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:608: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl15ScheduleDestroyERKNS_3PtrINS_9EventImplEEE': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:621: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:630: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:630: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZN3ns321RealtimeSi mulatorImpl6RemoveERKNS_7EventIdE': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:681: undefined reference to `ns3::CriticalSection::CriticalSection(ns3::SystemMutex&)' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:686: undefined reference to `ns3::CriticalSection::~CriticalSection()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:686: undefined reference to `ns3::CriticalSection::~CriticalSection()' debug\src\simulator\realtime-simulator-impl_1.o: In function `ZnwjPv': P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:(.text$_ZN3ns31 7RealtimeEventLockD1Ev[ns3::RealtimeEventLock::~RealtimeEventLock()]+0x4f): unde fined reference to `ns3::SystemMutex::~SystemMutex()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:(.text$_ZN3ns31 7RealtimeEventLockC1Ev[ns3::RealtimeEventLock::RealtimeEventLock()]+0x5a): undef ined reference to `ns3::SystemMutex::SystemMutex()' P:/ns/ns-3-dev/build/../src/simulator/realtime-simulator-impl.cc:(.text$_ZN3ns31 7RealtimeEventLockD0Ev[ns3::RealtimeEventLock::~RealtimeEventLock()]+0x4f): unde fined reference to `ns3::SystemMutex::~SystemMutex()' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizerC2Ev': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:32: undefined r eference to `ns3::SystemCondition::SystemCondition()' P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:67: undefined r eference to `ns3::SystemCondition::~SystemCondition()' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizerC1Ev': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:32: undefined r eference to `ns3::SystemCondition::SystemCondition()' P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:67: undefined r eference to `ns3::SystemCondition::~SystemCondition()' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizerD2Ev': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:73: undefined r eference to `ns3::SystemCondition::~SystemCondition()' P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:73: undefined r eference to `ns3::SystemCondition::~SystemCondition()' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizerD1Ev': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:73: undefined r eference to `ns3::SystemCondition::~SystemCondition()' P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:73: undefined r eference to `ns3::SystemCondition::~SystemCondition()' debug\src\simulator\wall-clock-synchronizer_1.o:P:/ns/ns-3-dev/build/../src/simu lator/wall-clock-synchronizer.cc:73: more undefined references to `ns3::SystemCo ndition::~SystemCondition()' follow debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizer8DoSignalEv': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:269: undefined reference to `ns3::SystemCondition::SetCondition(bool)' P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:270: undefined reference to `ns3::SystemCondition::Signal()' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizer14DoSetConditionEb': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:277: undefined reference to `ns3::SystemCondition::SetCondition(bool)' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizer8SpinWaitEy': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:313: undefined reference to `ns3::SystemCondition::GetCondition()' debug\src\simulator\wall-clock-synchronizer_1.o: In function `ZN3ns321WallClockS ynchronizer9SleepWaitEy': P:/ns/ns-3-dev/build/../src/simulator/wall-clock-synchronizer.cc:345: undefined reference to `ns3::SystemCondition::TimedWait(unsigned long long)' collect2: ld returned 1 exit status Build failed -> task failed (err #129): [bld://P:\ns\ns-3-dev\libns3.dll]
> I would rather just disable the real-time simulator feature on mingw... This isn't due to the real-time simulator, it is due to the fact that the threading primitives checked in several months ago are not being compiled since the platform is "win32" not "unix." The real-time simulator just uses them. If this is turned on, then I believe MinGW will break since there are no pthreads. I think the real question is, "should MinGW be turned off." Perhaps our windows story should be that we can user virtual machines ...
(In reply to comment #1) > > I would rather just disable the real-time simulator feature on mingw... > > This isn't due to the real-time simulator, it is due to the fact that the > threading primitives checked in several months ago are not being compiled since > the platform is "win32" not "unix." The real-time simulator just uses them. > > If this is turned on, then I believe MinGW will break since there are no > pthreads. > > I think the real question is, "should MinGW be turned off." Perhaps our > windows story should be that we can user virtual machines ... > I think our Windows story should be that we continue to make the core simulator work with Windows, but features that require a lot of work to support or are unreasonable are either unsupported or supported by a Windows maintainer. As you point out, there are free virtualization options nowadays for Windows users. Historically, I have been surprised by the number of ns-2 Cygwin users; hence, I would be reluctant to drop Cygwin/mingw altogether unless/until we get feedback that most of those users are happy moving to virtual machines.
(In reply to comment #2) > (In reply to comment #1) > > > I would rather just disable the real-time simulator feature on mingw... > > > > This isn't due to the real-time simulator, it is due to the fact that the > > threading primitives checked in several months ago are not being compiled since > > the platform is "win32" not "unix." The real-time simulator just uses them. > > > > If this is turned on, then I believe MinGW will break since there are no > > pthreads. > > > > I think the real question is, "should MinGW be turned off." Perhaps our > > windows story should be that we can user virtual machines ... > > > > I think our Windows story should be that we continue to make the core simulator > work with Windows, and to be clear, I don't view that real-time simulator has to be considered as part of the core simulator in this case (although technically it is part of src/simulator), since it is a specialized scheduler for use in emulation and packet-emitting modes that are not going to be easy to support in Windows anyways.
> > I think our Windows story should be that we continue to make > > the core simulator work with Windows, > > and to be clear, I don't view that real-time simulator has to > be considered as part of the core simulator in this case > (although technically it is part of src/simulator), since it > is a specialized scheduler for use in emulation and packet- > emitting modes that are not going to be easy to support in > Windows anyways. While I agree with this (and I turned off the real-time simulator build in the case where the underlying primitives are not available) the question now is what exactly do we mean by core simulator. For example, the real-time simulator works fine on cygwin, but not on MinGw. What this seems to mean is that we need to come up with a product matrix defining what is supported on what kind of machine and teach waf to respect it. We need to publish this matrix so that, for example, folks that need to do emulation or packet-emitting modes should use cygwin and not MinGW.
(In reply to comment #4) > > > I think our Windows story should be that we continue to make > > > the core simulator work with Windows, > > > > and to be clear, I don't view that real-time simulator has to > > be considered as part of the core simulator in this case > > (although technically it is part of src/simulator), since it > > is a specialized scheduler for use in emulation and packet- > > emitting modes that are not going to be easy to support in > > Windows anyways. > > While I agree with this (and I turned off the real-time simulator build in the > case where the underlying primitives are not available) the question now is > what exactly do we mean by core simulator. For example, the real-time > simulator works fine on cygwin, but not on MinGw. > > What this seems to mean is that we need to come up with a product matrix > defining what is supported on what kind of machine and teach waf to respect it. > We need to publish this matrix so that, for example, folks that need to do > emulation or packet-emitting modes should use cygwin and not MinGW. Yes I totally agree the time has come for this type of documentation. However, I hope to not burden Gustavo and waf too much in dealing with the various combinations, and we will need to also get the regression scripts to cover the valid ones and avoid the invalid ones.
Re-titling for more accurate description. Actually I would be more in favor of excluding features based on missing header files or libraries rather than on a black list of platforms. This is the perfect example why. Normally people don't have pthread.h in mingw. However, there is an open source pthread implementation out there [1] that makes it easy to install a pthread library and header. Black lists are often the wrong solution, configuration tests are better. [1] http://sourceware.org/pthreads-win32/
(In reply to comment #6) > Re-titling for more accurate description. > > Actually I would be more in favor of excluding features based on missing header > files or libraries rather than on a black list of platforms. I committed this change now. I'll revert if someone objects. With this commit plus Mathieu's NSC disabling patch (bug #316) makes the whole thing compile and run unit tests in mingw.