How to install both gcc-4.7-plugin-dev and gcc-4.8-plugin-dev on Ubuntu 16.04 without conflicts?
I have just installed Ubuntu 16.04 Xenial on the laptop I use for development.
I am currently working on a plugin for gcc and I want my plugin to be compatible with several different versions of the compiler (currently from `gcc-4.6` to `gcc-6`). For this reason I need several different versions of the compiler and of the plugin headers installed on my development workstation at the same time, so that I can build the plugin against the different versions. This worked like a charm with the old LTS 14.04, but with the new LTS I have a problem I can't solve.
I can easily install all the version of gcc from `gcc-4.7` to `gcc-5` from the default repository, but when I try start installing the `gcc-*-plugin-dev` packages I run into troubles. Basically everything is fine if I install only `gcc-4.
user@
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libgmpv4-dev
Suggested packages:
gmp-doc libgmp10-doc libmpfr-dev
The following packages will be REMOVED:
gcc-
The following NEW packages will be installed:
gcc-
0 upgraded, 2 newly installed, 6 to remove and 0 not upgraded.
Need to get 1003 kB of archives.
After this operation, 15.0 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
user@
As you can see it does not let me install the package if I don't remove the others. The problem seems to be the fact that the different versions of gcc rely on different versions of `libgmp`. If fact `gcc-4.
This seemed very strange to me, since in Ubuntu 14.04 everything worked just fine. Hence I decided to take a look on packages.ubuntu.com
Here is what I found out:
1. about `libgmp-dev` and `libgmpv4-dev`
* on Ubuntu 14.04 `libgmpv4-dev` does not exist and all the versions of `gcc-*-plugin-dev` depend on `libgmp-dev`
* on Ubuntu 16.04 there are two separate packages `libgmp-dev` and `libgmpv4-dev`. Apparently, the only difference between the two of them is that the former stays in the `main` repository while the latter is in `universe`.
* for `libgmp-dev` the dependencies are the same in both Ubuntu 14.04 and 16.04
* `libgmpv4-dev` on Ubuntu 16.04, instead, depends on basically the same packages, but the naming and the versions are slightly different than those in `libgmp-dev`. And `libgmpv4-dev` reports "(GCC 4.x compatible)" in its description. But I don't understand why this is significant, since gcc-4.8 is in the 4.x series but it works perfectly fine with the (non-4.
2. about `gcc-4.
* on Ubuntu 14.04 they depend on the same version of libgmp: `libgmp-dev`
* on Ubuntu 16.04 it's not clear why, but they start to have different dependencies, as I showed you on the terminal:
- `gcc-4.
- `gcc-4.
Does anybody of you have any idea about why things are this way? Do you know if and how I can install both the versions `gcc-4.
Thanks in advance
fez
P.S.
I know that there exist a ppa for the gcc toolchain ( https:/
P.P.S.
I have also tried to install the version that have conflicts in chroot, and it seems to work, but I really would like to know if there's a way to fix this dependency problem without dirty tricks. In principle I'd like to find a way to make the installation manageable with apt.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu gcc-4.7 Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask pfez for more information if necessary.