[103464] trunk/dports/math/atlas/Portfile

Ryan Schmidt ryandesign at macports.org
Wed Feb 27 00:11:34 PST 2013


On Feb 27, 2013, at 01:53, Vincent Habchi  wrote:

> On 27 févr. 2013, at 06:25, Ryan Schmidt wrote:
> 
>> The build machine is not necessarily the same as the machine that will end up running the code, especially since we have buildbots that make binary packages.
> 
> True, but there is no PPC buildbot AFAIK,

Correct.

> and that’s the only case of mono-processor Apple machines; even the first x86 machines were CoreDuo based, if I’m not mistaken.

I think there was a Core Solo Mac mini (?), but definitely not a large portion of the user base today.

> We already have debated about Atlas – personally, I think the best solution would be to disable binary download altogether, since the code is so closely tied to the underlying hardware. It doesn’t make sense to use code built for another CPU because it can be under- or over-optimized.

Feel free to do that if you feel that's the best solution. Just add this line:

archive_sites


>> This should be selectable by variant. There should be two mutually-conflicting variants, and which one is default should be selected based on your check above. The buildbots are multiprocessor so they will build the multiprocessor version; if a user has a single CPU then they'll build that on their own machine.
> 
> The threaded version of Atlas won’t build on mono-processor machines because OpenMP denies the creating of threads and Atlas raises an assertion. So the choice if somehow forced. Besides, on multicore machines, both serial and threaded version are built…

OK.

Then the remaining objections I have are:

>>> +pre-fetch {
>>> +    # If we run on a mono-processor machine (PPC), then disable threading
>>> +
>>> +    if {![catch {sysctl hw.logicalcpu} result] && $result == 1} {
>>> +    configure.args-append    -t 0
>>> +    ui_msg "Building sequential only version of atlas."
>>> +    }
>>> +}

The ui_msg should be deleted, and appending to configure.args should either happen in the global part of the portfile (not in a phase), or should happen in the pre-configure phase; any other time (including pre-fetch) is not reliable as the user might run the phases separately.

It also might be nice to set a global variable to indicate single- or multi-processor, instead of running sysctl multiple times.



More information about the macports-dev mailing list