Opened 14 years ago

Closed 14 years ago

#2773 closed Bugs (fixed)

Sun toolset uses -fast by default

Reported by: g_sauthoff@… Owned by: Vladimir Prus
Milestone: Boost 1.39.0 Component: build
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

With --toolset=sun, -fast is enabled by default.

The -fast option of the Sun CC enables optimized codegen for all the hardware features, which are available for the CPU, where the CC process is currently running.

For example if you compile with -fast on an Solaris/Opteron systems, you code very likely will contain 3dnow-instruction. If you want to share the binaries with Solaris/Intel-Xeon-64-bit systems you have a problem.

Thus, I suggest a default optimization level of '-O' for the Sun CC (e.g. with --toolset=sun). Or '-xOsomething' if you will.

The situation is comparable to using -O or -O2 with gcc, and not -march=native.

Change History (4)

comment:1 by Steven Watanabe, 14 years ago

Component: Nonebuild
Owner: set to Vladimir Prus

comment:2 by Vladimir Prus, 14 years ago

I don't really know what possible values of -xOsomething are there, and which one is considered the most reasonable value when optimizing for speed. If you tell me that, I can make the change. Thanks.

comment:3 by g_sauthoff@…, 14 years ago

Well, -xO4 is reasonable (switches automatic fn inlining on); -xO5 is reasonable as well, but it increases the compile time a bit.

comment:4 by Vladimir Prus, 14 years ago

Resolution: fixed
Status: newclosed

(In [51308]) Do not use -fast, since it causes the code to be generated for the processor the compiler is running on. Use -xO4 instead. Fixes #2773.

Note: See TracTickets for help on using tickets.