Bugzilla – Bug 1518
Patch to enable ns-3.15 to build on FreeBSD-9
Last modified: 2013-05-01 00:33:07 EDT
Created attachment 1459 [details] Fixes for FreeBSD9 The attached patch is needed to compile ns-3.15 on FreeBSD-9. The patch removes #ifdef'd workarounds for limitations of older versions of FreeBSD that are no longer needed with the latest version of FreeBSD.
A better patch (to support older FreeBSDs) may be to add the math.h that was recently added to ns-3-dev/src/core/model/math.h: #ifndef MATH_H #define MATH_H #include <cmath> #ifdef __FreeBSD__ #if __FreeBSD_version <= 704101 || \ (__FreeBSD_version >= 800000 && __FreeBSD_version < 802502) || \ (__FreeBSD_version >= 900000 && __FreeBSD_version < 900027) #define log2(x) (std::log(x) / M_LN2) #endif /* __FreeBSD_version */ #endif /* __FreeBSD__ */ #endif /* MATH_H */
(In reply to comment #1) > A better patch (to support older FreeBSDs) may be to add the math.h that was > recently added to ns-3-dev/src/core/model/math.h: Just to clarify, if the patch is just to enable people to work around this issue without changing ns-3.15, we can link this in the wiki (I just did this). However, we could consider a maintenance release to include this patch (and a couple of other things since ns-3.15 was released), in which case the below patch would be preferred: > > > #ifndef MATH_H > #define MATH_H > > #include <cmath> > > #ifdef __FreeBSD__ > > #if __FreeBSD_version <= 704101 || \ > (__FreeBSD_version >= 800000 && __FreeBSD_version < 802502) || \ > (__FreeBSD_version >= 900000 && __FreeBSD_version < 900027) > #define log2(x) (std::log(x) / M_LN2) > #endif /* __FreeBSD_version */ > > #endif /* __FreeBSD__ */ > > #endif /* MATH_H */
(In reply to comment #2) > (In reply to comment #1) > > A better patch (to support older FreeBSDs) may be to add the math.h that was > > recently added to ns-3-dev/src/core/model/math.h: > > Just to clarify, if the patch is just to enable people to work around this > issue without changing ns-3.15, we can link this in the wiki (I just did this). > However, we could consider a maintenance release to include this patch (and a > couple of other things since ns-3.15 was released), in which case the below > patch would be preferred: And presumably remove the #ifdefs for FreeBSD in the other files? I can test on FreeBSD 8.3 and 9.1-RC, if you send me a complete patch. Colin
This has been fixed in 2012, as mentioned in the comments above; I just confirmed that FreeBSD 9 builds ns-3.17 release candidate.