I don't understand some of this discussion. Marco started this by asking

Marco Comini wrote:

I'd like fink run compilers on my G5 with the '-fast' option instead
of the '-g -O2' which goes by default.

Nobody contradicted this "by default". Everyone seems to agree that there is such a default. Then:


So I understand that for sure I always have to use -mcpu=G5 and -mtune=G5, but why not using -O3 instead of -O2?

No maybe I am blind, but I cannot find anywhere in fink's code a place where '-g -O2' is defined as a default.


If many packages use these flags, then this does not come from fink, but perhaps from the gnu auto-tools, standard configure scripts, or libtool. There are quite a few packages that use other defaults, and every package maintainer is free to use whatever optimization is useful and working. But how to do this depends very much on the individual package.

IMHO the main reason why there is no switch in fink like "--optimize=G5" or similar is that this is impossible to implement. There are packages where you can define compiler flags simply by defining CFLAGS or CXXFLAGS on the configure or make command line. But there are many others where these variables have different names, where you cannot use such command line variables but would need to patch the configure scripts, others that don't even use configure scripts or makefiles and where you would have to patch some other source files, others that have one or two source files that need to be compiled with lower optimisation, and so on.

So the discussion about different optimization options needs to get away from general defaults and focus on individual packages. There may be some packages where different optimizations for G4 and G5 might make sense. I am convinced that this concerns only a very small number of packages, and for these the discussion should take place between interested users and the package maintainer.

As an example, I was told (no idea if this is really true) that the flags

  -O3 -mcpu=G3 -mtune=G4 -funroll-loops

give good results on both G3 and G4 processors for the vtk package. So I patched the corresponding source file (which is called "CMakeLists.txt" in this case) in the vtk-py23 package correspondingly. If someone can convince me that there is a need for a different optimization flag for G5s, I would be happy to include this, or to make two different packages for G3/G4 and G5.

Another example: The atlas package, whose sole purpose in life is optimization. If you build atlas, it optimizes itself for the machine on which you compile it, so you get different results for G3, G4, and G5, maybe even for subtypes, and different results depending on some interactive compile-time choices. If Fink's same-deb-no-matter-where-it-was-built policy were applied to this package, it would either become useless or we would need different variants, atlas-G3, atlas-G4, atlas-G5, and maybe atlas-G5-dual-1.8, atlas-G5-dual-2.5 and so on. Nobody in their right mind would suggest such a scenario.

So what I wanted to say is: If you have suggestions for different compiler optimization flags for a specific package, discuss this (perhaps publicly on the list) with the package maintainer. You might find a solution that is working well for all types of Macs, or you might be able to convince him that a different variant for G5s is a good idea. But don't go on claiming that fink itself needs to be changed for this purpose.

--
Martin



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Fink-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to