1

I have a fairly simple question, and yet couldn't find an answer anywhere I looked.

In my workplace there is a CI server with ubuntu 12.04 installed, that server uses the default c/c++ binaries ( 4.6.3 ) versions of the compilers. There is now a project which requires new versions of the compilers ( ones that include c++11 ).

3 Questions:

  1. Will installing gcc-4.8 & g++4.8 break / change stuff which is used by the existing 4.6.3 versions ? ( maybe there are shared libs dependencies which can get overridden ? )

  2. Is it safe to assume gcc-4.8 & gcc-4.8 are not going to cause a situation where a build ( which relies on 4.6.3 ) passes, but in reality the build code behaviour changes ? ( maybe due to being optimized differently ? )

  3. Most importantly, Can several versions of the compilers be installed on a system without breaking previous versions of them ?

Please bear with me as c/c++ are not programming languages I ever got to work with.

3
  1. Will installing gcc-4.8 & g++4.8 break / change stuff which is used by the existing 4.6.3 versions ?

No.

  1. Is it safe to assume gcc-4.8 & gcc-4.8 are not going to cause a situation where a build ( which relies on 4.6.3 ) passes, but in reality the build code behaviour changes ? ( maybe due to being optimized differently ? )

Depends on how they rely on 4.6.3. Does your build process invoke gcc or gcc-4.6? If the latter, there shouldn't be any changes. If the former, you should use the alternatives system to configure gcc to use gcc-4.6, or change your processes to use gcc-4.6/g++-4.6. (Lookup update-alternatives.)

  1. Most importantly, Can several versions of the compilers be installed on a system without breaking previous versions of them ?

Yes, if you're installing using reasonably built debian packages. It's not unusual to have multiple versions of GCC installed.

| improve this answer | |
  • Regarding your answer on #2 - AFAIK installation of g++ 4.8 sets up a bin called /usr/bin/g++-4.8; thus, it shouldn't affect anything, this in turn means I can reference the versioned binary during the new project build process, Correct? – elad.chen Nov 10 '15 at 17:49
  • Yes - the versioned binaries should remain unaffected. – muru Nov 10 '15 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.