As mentioned on a separate thread (https://sourceforge.net/tracker/index.php?func=detail&aid=3294997&group_id=23725&atid=379483), I was having some problems building xtune_aff, on OSX Mountain Lion. I was looking through the code, and saw there was an untested and deactivated Mac OS X implementation for setting processor affinity, in ATL_thread_start.c.
So I thought I'd try and get that to work, basically. I attach a patch of every source code file I edited.. `make check` and `make ptcheck` pass without error, but `xtune_aff` shows no speed improvements when using processor affinity code. Maybe there's no speedup because the Mac-specific is only implemented in ATL_thread_start, and not other ATL_thread_... files.
Changes in the patch:-
1) #include <mach/thread_policy.h>
I put this in atlas_threads.h, but it would probably be better off in ATL_thread_start.c, which is the only file which I saw used that API.
2) Debugged a couple lines in the "unchecked special OSX code" section of ATL_thread_start.c
Point of reference (as well as the link in the source code): https://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html
3) In Make.lib, created a rule for creating a threaded lapack dynamic library (libptlapack.dylib).
4) In CONFIG/src/probe_aff.c, I commented out the line that outputs "#define ATL_NOAFFINITY 1" to atlas_taffinity.h. Perhaps a Mac-specific preprocessor clause around this would be safer...
That's all. Hope it might be of use...