[MacPorts] #24778: please add mcpu (march is only for x86)
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.9.0 Component: base | Version: 1.8.2 Keywords: gcc, optimization | Port: ------------------------------------------+--------------------------------- Hello, I saw that there was a ticket here before that proposed adding mcpu, but the author couldn't really say what was the difference between mcpu and march, so let me state why mcpu is needed: On any architecture other than x86/x86-64 (and it seems ARM too), march, which means to generate code that will run only on the CPU specified, will not work. For the same function, you need mcpu, march=G5 will not work. mcpu on x86/x86-64 is basically mtune, which means generate code that is not architecture specific. Basically:[[BR]] x86/x86-64 PowerPC[[BR]] march=mcpu[[BR]] mcpu=mtune[[BR]] I also propose that a general purpose dumping ground for compiler flags and linker flags a la Gentoo's /etc/make.conf CFLAGS and LDFLAGS be implemented, so that I don't have to file a ticket every time I find that macports.conf doesn't let you specify a certain compiler flag. -- Ticket URL: <http://trac.macports.org/ticket/24778> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.9.0 Component: base | Version: 1.8.2 Keywords: gcc, optimization | Port: ------------------------------------------+--------------------------------- Comment(by randomshinichi4869@…): Sorry, it should be portconfigure.tcl. Also, please tell me configure.optflags can accept multiple arguments - or do I have to file a bug on that too? -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Changes (by jmr@…): * keywords: gcc, optimization => * version: 1.8.2 => * milestone: MacPorts 1.9.0 => Comment: As per the ticket guidelines linked from the New Ticket page, please don't set the Milestone field. -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by randomshinichi4869@…): I was about to change it but then I saw you already did... -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by ryandesign@…): Replying to [ticket:24778 randomshinichi4869@…]:
I also propose that a general purpose dumping ground for compiler flags and linker flags a la Gentoo's /etc/make.conf CFLAGS and LDFLAGS be implemented, so that I don't have to file a ticket every time I find that macports.conf doesn't let you specify a certain compiler flag.
I'm not terribly thrilled about giving the user the ability to specify any random compiler flag. This just increases our support burden when things go wrong as it's yet another way the user's configuration could vary. We are not Gentoo, we don't necessarily have the same kind of power users, we don't have to copy what they do... -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by afb@…): Well, you could have MacPorts translate those config settings for you ? The names are probably "weird" then, but one '''could''' use `configure.march`and `configure.mtune` on the PowerPC too. And automagically translate it to `-march` or `-mtune` ? -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by afb@…): Make that (configure.march) into -march or -mcpu (typo above) -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by afb@…): http://trac.macports.org/ticket/2193 http://trac.macports.org/changeset/33599 {{{ # We could have m32/m64/march/mtune be global configurable at some point. # We could have debug/optimizations be global configurable at some point. }}} -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by randomshinichi4869@…): Well, the problem here is that there is march for x86, but nothing equivalent for PowerPC, which needs mcpu for the same thing. A configure.march that issues -mcpu or -march depending on architecture would be nice, as long as you put a comment after it saying that it does that. In any case, the message that says it could be global configurable seems to have been there for ages - there simply isn't any excuse, seeing as there's already a march option. Anyway, I managed to cram -mcpu=G5 into configure.optflags. {{{ # We could have debug/optimizations be global configurable at some point. options configure.optflags configure.cflags configure.cppflags configure.cxxflags configure.objcflags configure.ldflags configure.libs configure.fflags configure.f90flags configure.fcflags configure.classpath default configure.optflags {"-O2 -mcpu=G5 -mno-powerpc64"} }}} The -mno-powerpc64 is needed because as of the gcc included in Xcode 3.1.4 -mcpu=G5 gives you -mpowerpc64 as well, which breaks stuff, e.g. htop terminates with a Bus Error if you try to sort the process list, and somebody on the internet reported povray segfaulting. Nobody needs 64bit htop anyway. htop now takes less CPU (it was about 4-6% before, now mostly 0, occasionally jumping up to 2%) which I like because a CPU usage tool has no business hogging CPU cycles for itself. I guess this may seems little gentoo-ricer-ish. -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24778: please add mcpu (march is only for x86) ------------------------------------------+--------------------------------- Reporter: randomshinichi4869@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by afb@…): Using `configure.optflags` meanwhile worksforme... I think m32/m64/etc got derailed with +universal ? It used to be hardcoded "-O2" before it was changed. Went ricing in r33503, I think. Some "-Omg" request. I'm all for wiping configure's m32/m64/mtune/march... Nobody is using them anyway, but build_arch/optflags ? And top using 5-10% is "standard" on Mac OS X, I think. At least with Apple's top, haven't tried using htop. -- Ticket URL: <http://trac.macports.org/ticket/24778#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts