1

I installed the GCC 4.8.2 a couple of weeks ago. The installation process went well and I have GCC 4.8.2 at my Ubuntu system (12.04 64 bits). Now GNU just released the newer version 4.9.0.

My question is: Is there any way to upgrade my GCC to 4.9.0 without doing all process: configuration, building, checking and installation from scratch? Also, please tell me what is the benefit/purpose of gcc-4.8.2-4.9.0.diff.gz file? Is it like script/patch file to upgrade my compiler?

FYI, I don't have any plan to have two different versions of GCC at my system.

manlio
  • 18,345
  • 14
  • 76
  • 126

1 Answers1

2

My question is: Is there any way to upgrade my GCC to 4.9.0 without doing all process: configuration, building, checking and installation from scratch?

Yes, if you have it already built. No, if you have only sources.

Also, please tell me what is the benefit/purpose of gcc-4.8.2-4.9.0.diff.gz file?

Read manual for patch utility how to apply it. You can convert 4.8.2 sources to 4.9.0 ones with this diff.

Is it like script/patch file to upgrade my compiler?

Yes, but for its sources. So building is still required.

Do you really need new features of 4.9 for your projects?

Netch
  • 4,171
  • 1
  • 19
  • 31
  • Netch, May I ask you explain more? I have a GCC 4.8.2 build from source and currently I have the source of 4.9.0. – Saeed Amrollahi Boyouki Apr 23 '14 at 14:14
  • 1
    Apply `patch` to source directory with the diff file you've got and remake the building process from the very beginning. – Netch Apr 23 '14 at 14:19
  • Netch, In response to your question about Do I really need new features of 4.9, I should say, I'm a C++ Programmer and an advisory member of C++ committee from IRAN and I follow the new features of C++ (C++14) which were added to C++ recently. Also, I present seminars in IRAN/Tehran about C++, so I should have most recent GCC/Clang/Visual Studio compilers permanently. – Saeed Amrollahi Boyouki Apr 23 '14 at 14:47
  • Ok, got it. In that case I guess you need both compilers in parallel to compare their work, so I suggest configuring them with different prefixes (like `/opt/gcc-4.9.0`) and not overwrite older one with the newer one. – Netch Apr 23 '14 at 14:57
  • Netch, May I ask you explain (the UNIX command) how to apply a diff file on a source directory? – Saeed Amrollahi Boyouki Apr 23 '14 at 15:11
  • `patch -d $directory <$diff_file`, in most cases. But, depending on diff style, some other options can be needed. Very often, one shall specify `-p$level` to drop directories from patch paths. – Netch Apr 23 '14 at 20:20