[Slackbuilds-users] sse2 optimisation
Rob McGee
rob0 at slackbuilds.org
Sat Jun 26 17:40:42 UTC 2010
On Sat, Jun 26, 2010 at 11:49:43AM -0500, Patrick J. Volkerding
wrote:
> On 06/26/2010 07:58 AM, David Spencer wrote:
>> I'm doing a SlackBuild for Luminance HDR. Its compiler flags
>> assume that SSE2 instructions are available. That's a bad
>> assumption, but it's easy to make it configurable with a
>> variable SSE2=yes|no and a note in the README.
>>
>> So, here's my question. Should the SlackBuild's default be
>> SSE2=yes, or SSE2=no? There are three obvious choices.
>
> What about something like this?
>
> if grep -wq sse2 /proc/cpuinfo ; then
> SSE2=yes
> else
> SSE2=no
> fi
>
> Just a thought.
But that comes out wrong if being built for a different machine,
which could easily be the case. Perhaps augment it with a check of
the variable:
if [ -z "$SSE2" ] ; then true
elif grep -wq sse2 /proc/cpuinfo ; then ...
--
Rob McGee - /dev/rob0 - rob0 at slackbuilds.org
More information about the SlackBuilds-users
mailing list