[Nix-dev] CPU optimized packages

Shea Levy shea at shealevy.com
Thu Feb 7 15:33:44 CET 2013


Hi Danny,

Unfortunately, there's not a good answer to this because -march=native 
is inherently impure. Is there any reason you can't tell users "Find out 
what -march=native means on your system and then fill in 
nixpkgs.config.extra_cflags with the result?" or some such (Note that 
config.extra_cflags doesn't currently exist AFAIK, but could)?

~Shea

On 02/07/2013 07:36 AM, Danny Wilson wrote:
> With help of the gentoo wiki ( 
> http://en.gentoo-wiki.com/wiki/Hardware_CFLAGS )
> I found this produces a nice GCC option list:
>
> echo "" | gcc -O3 -march=native -mtune=native -v -E - 2>&1 |grep cc1 
> |sed -r 's/.*? - -(.*)$/-\1/'
>
>
>
>> Danny Wilson <mailto:danny at prime.vc>
>> 7 februari 2013 12:37
>> I'd like some packages to be optimized for my server CPU. GCC has
>> -march=native for this, but that would not generate a cpu specific nixos
>> hash.
>>
>> Is there a nix expression available which adds something like this:
>> gcc -march=native -Q --help=target |grep enabled
>>
>> to CFLAGS and correctly hashing it?
>>
>>
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>> ------------------------------------------------------------------------
>
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20130207/a7cee9d6/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20130207/a7cee9d6/attachment.jpg 


More information about the nix-dev mailing list