clang's build performance

Ryan Schmidt ryandesign at macports.org
Mon Jul 7 18:51:21 PDT 2014


On Jul 7, 2014, at 3:16 AM, René J.V. Bertin wrote:

> On Monday July 07 2014 08:43:33 Akim Demaille wrote:
> 
>> Since I'm spending quite some time compiling, I'd like to try
>> compiling clang-3.5 itself with -O3.
> 
> IIRC I tried invoking `port` with CC, CXX, CFLAGS etc. set to my own values only to note that they were reset.

MacPorts deliberately clears your environment when it runs, in order to avoid the unlimited variety of problems that could be caused by users deliberately or accidentally having various environment variable set to unpredictable values.

There's no supported way for users to alter a port's optimization flags at the command line. These are expected to be set to reasonable values by the port maintainer and not need to be changed by the user.

> For experimenting you could copy the port directory (port dir llvm-3.5) to your local 'repository', and edit the Porfile. Llvm's configure script has an option to specify your own optimisation flags. I'm not sure if -O3 vs. -O2 will make a lot of difference instead of in build time though. You could add -mdynamic-no-pic (and check if --enable-pic isn't there to counter its effect), and add the -march flag for your CPU plus `-fvectorize -fslp-vectorize-aggressive`

If you edit the portfile, the correct variable to use to change the optimization flags is

configure.optflags

Most ports respect this variable. Don't know if the clang and llvm ports do.

The default value for this variable is -Os.




More information about the macports-users mailing list