Difference: Gcc46PortIssues (1 vs. 3)

Revision 32012-03-08 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="SupportedPlatforms"

Migrating to the gcc 4.6 compiler

Accessing the compiler

Changed:
<
<
gcc4.6 is not installed by default in either slc5 or slc6. To use it for regular Gaudi/LHCb builds it is enough to set the environment variable CMTCONFIG accordingly (e.g. x86_64-slc5-gcc46-opt).
>
>
gcc4.6 is not installed by default in either slc5 or slc6. To use it for regular Gaudi/LHCb builds it is enough to set the environment variable CMTCONFIG accordingly:
LbLogin -c x86_64-slc5-gcc46-opt
  To be able to use it on the command line outside the Gaudi/LHCb builds, you can do the following (bash): |
Line: 15 to 16
 (use setenv on tcsh)

Accessing gcc46 builds

Changed:
<
<
At the time of writing the gcc46 builds are available only in the nightlies (lhcb-lcg-head slot). For example you can do:
# export CMTCONFIG=x86_64-slc5-gcc46-dbg
# SetupProject --build-env --nightly lhcb-lcg-head LHCb HEAD
>
>
gcc46 builds are part of the official LHCb software distribution for all projects released since January 2012
 

Common compilation errors

The most common problems are described on the gcc 4.6 migration guide (it may be useful to have a look to the gcc 4.4 one too).
Line: 36 to 33
 Comes from code like:
a = b = a = 1;
Changed:
<
<
The problem is that the assignment to a appears twice and the standard does not define what the behavior should be. The code should be modified to remove the duplicated assignement:
>
>
The problem is that the assignment to a appears twice and the standard does not define what the behavior should be. The code should be modified to remove the duplicated assignment:
 
a = b = 1;
Added:
>
>
or, better
a = 1;
b = 1;
 
Added:
>
>

Differences in application output between gcc43 and gcc46

The most common cause of differences when comparing the output of an application build with gcc46 with the gcc43 equivalent are due to differences in sorting. In most cases, the differences have been fixed by replacing occurrences of std::sort with std::stable_sort
  -- MarcoClemencic - 23-Nov-2011 \ No newline at end of file

Revision 22011-11-23 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="SupportedPlatforms"

Migrating to the gcc 4.6 compiler

Line: 31 to 31
 

Warnings

Added:
>
>
 

warning: operation on ... may be undefined [-Wsequence-point]

Comes from code like:
a = b = a = 1;

Revision 12011-11-23 - MarcoClemencic

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="SupportedPlatforms"

Migrating to the gcc 4.6 compiler

Accessing the compiler

gcc4.6 is not installed by default in either slc5 or slc6. To use it for regular Gaudi/LHCb builds it is enough to set the environment variable CMTCONFIG accordingly (e.g. x86_64-slc5-gcc46-opt).

To be able to use it on the command line outside the Gaudi/LHCb builds, you can do the following (bash):

# export CMTCONFIG=x86_64-slc5-gcc46-opt
# SetupProject LCGCMT gcc
(use setenv on tcsh)

Accessing gcc46 builds

At the time of writing the gcc46 builds are available only in the nightlies (lhcb-lcg-head slot). For example you can do:
# export CMTCONFIG=x86_64-slc5-gcc46-dbg
# SetupProject --build-env --nightly lhcb-lcg-head LHCb HEAD

Common compilation errors

The most common problems are described on the gcc 4.6 migration guide (it may be useful to have a look to the gcc 4.4 one too).

Below are hints on solving other common errors or warnings.

Errors

Warnings

warning: operation on ... may be undefined [-Wsequence-point]

Comes from code like:
a = b = a = 1;

The problem is that the assignment to a appears twice and the standard does not define what the behavior should be. The code should be modified to remove the duplicated assignement:

a = b = 1;

-- MarcoClemencic - 23-Nov-2011

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback