On 2/1/2012 11:46 AM, Paul H. Hargrove wrote:
> So, in short: when building w/ this compiler, hwloc needs to behave as
> if the system lacks ffs().
> Making that happen is non-trivial because there are no preprocessor
> symbols defined by gccfss that would allow compile-time #if checks to
> distinguish gccfss from "vanilla" gcc. The only difference is in the
> string value of __VERSION__, which one could check at configure time.
Attached is a patch, relative to the svn trunk, which fixes this problem
in my testing.
As I outlined above, the approach is two-fold:
1) Add configure-time logic to ID the buggy compiler
2) Restructure include/private/misc.h to include a HWLOC_HAVE_BROKEN_FFS
Two things I'd like to note about the approach:
+ The configure-time logic is NOT trying to determine the version
number, as I don't have a way (yet?) to pinpoint which version(s) work
correctly, and the Oracle Forums thread on the subject doesn't say. So,
it is conservatively assuming all "gccfss" versions are broken.
+ The misc.h changes are intentionally "generic" so one could add other
configure time checks to define HWLOC_HAVE_BROKEN_FFS based on problems
we've not yet discovered.
Paul H. Hargrove PHHargrove_at_[hidden]
Future Technologies Group
HPC Research Department Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory Fax: +1-510-486-6900