DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD Package System (pkgsrc)

NetBSD Package System (pkgsrc) Installation and upgrading of packages on NetBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th July 2015
bashrules's Avatar
bashrules bashrules is offline
Aspiring Unix Greybeard
 
Join Date: Mar 2010
Location: Here
Posts: 80
Default CPUFLAGS

How do I pass cpu flags to pkgsrc, say, something like -march=corei7?

Man mk.conf suggests to use "CPUFLAGS", but it's not implemented in pkgsrc:

Code:
$ grep -R CPUFLAGS /usr/pkgsrc/mk/
$
A hack would be to add them to CFLAGS, e.g.

Code:
CFLAGS+=-march=corei7
but some packages mess around with CFLAGS and remove my -march, e.g. xv

Code:
$ grep -R corei7 /tmp/pkgsrc/graphics/xv/work/ 
Binary file /tmp/pkgsrc/graphics/xv/work/.gcc/bin/gcc matches
Binary file /tmp/pkgsrc/graphics/xv/work/.gcc/bin/cc matches
Binary file /tmp/pkgsrc/graphics/xv/work/.gcc/bin/cpp matches
Binary file /tmp/pkgsrc/graphics/xv/work/.gcc/bin/g++ matches
Binary file /tmp/pkgsrc/graphics/xv/work/.gcc/bin/c++ matches
Reply With Quote
  #2   (View Single Post)  
Old 14th July 2015
gsvelto gsvelto is offline
New User
 
Join Date: Oct 2014
Posts: 3
Default

One way to do it is to install the devel/cpuflags package from pkgsrc:

ftp://ftp.netbsd.org/pub/pkgsrc/curr...gs/README.html

Then you will have to add this line to your /etc/mk.conf file:

.sinclude "/usr/pkg/share/mk/cpuflags.mk"

This will set cpu flags for your CPU automatically, however it will not be able to do so for packages that replace CFLAGS entirely.
Reply With Quote
  #3   (View Single Post)  
Old 18th August 2015
bashrules's Avatar
bashrules bashrules is offline
Aspiring Unix Greybeard
 
Join Date: Mar 2010
Location: Here
Posts: 80
Default

Apparently, cpuflags.mk is just doing what I'm doing as well, adding -march=XXX to the mk.conf's CFLAGS variable.
Reply With Quote
Reply

Tags
cpuflags, optimization, pkgsrc, source

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:04 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick