#1 Le 07/12/2016, à 22:19
- lolo_z
Problème mise à jour GCC
Bonjour,
Je viens de commencer à travailler sous environnement ubuntu.
Je dois compiler un code via un programme (CASTEM16) et pour cela j'utilise gcc et gfortran. De base la version gcc disponible sur mon ordinateur est la version 4.6.3. Seulement cette version ne permet pas de compiler le code, il me faudrait au moins la version 5. Je l'ai donc installée. Seulement, au lieu de remplacer gcc, j'ai maintenant gcc et gcc-5. Seulement la compilation fait appel à gcc et renvoie donc vers la version 4.6.3 (je ne peux pas modifier la commande en gcc-5....).
Je souhaiterais donc savoir comment faire pour que la commande gcc <....> utilise la version 5 pour compiler et non la version 4.6.3.
D'avance merci
Hors ligne
#2 Le 08/12/2016, à 07:36
- pingouinux
Re : Problème mise à jour GCC
Bonjour,
Peux-tu donner le retour de
ls -ld /usr/bin/gcc*
Hors ligne
#3 Le 08/12/2016, à 08:11
- lolo_z
Re : Problème mise à jour GCC
Bonjour,
Cela me donne :
loic@loic-K73SD:/$ ls -d usr/bin/gcc*
usr/bin/gcc usr/bin/gcc-ar-5 usr/bin/gcc-ranlib-6
usr/bin/gcc-4.6 usr/bin/gcc-ar-6 usr/bin/gccxml
usr/bin/gcc-5 usr/bin/gcc-nm-5 usr/bin/gccxml_cc1plus
usr/bin/gcc-6 usr/bin/gcc-nm-6
usr/bin/gcc-6.2.0.tar.bz2 usr/bin/gcc-ranlib-5
Hors ligne
#4 Le 08/12/2016, à 08:42
- pingouinux
Re : Problème mise à jour GCC
Ce n'est pas la commande que je t'ai demandée en #2
ls -ld /usr/bin/gcc*
Hors ligne
#5 Le 08/12/2016, à 13:50
- lolo_z
Re : Problème mise à jour GCC
Ah oui en effet j'ai oublié une lettre dsl
le résultat :
loic@loic-K73SD:/$ ls -ld /usr/bin/gcc*
lrwxrwxrwx 1 root root 21 Dec 7 21:00 /usr/bin/gcc -> /etc/alternatives/gcc
-rwxr-xr-x 1 root root 353216 Apr 16 2012 /usr/bin/gcc-4.6
-rwxr-xr-x 1 root root 890760 Sep 4 23:17 /usr/bin/gcc-5
-rwxr-xr-x 1 root root 952672 Sep 4 23:17 /usr/bin/gcc-6
-rw-r--r-- 1 root root 99778648 Aug 22 12:28 /usr/bin/gcc-6.2.0.tar.bz2
-rwxr-xr-x 1 root root 27040 Sep 4 23:17 /usr/bin/gcc-ar-5
-rwxr-xr-x 1 root root 27040 Sep 4 23:17 /usr/bin/gcc-ar-6
-rwxr-xr-x 1 root root 27040 Sep 4 23:17 /usr/bin/gcc-nm-5
-rwxr-xr-x 1 root root 27040 Sep 4 23:17 /usr/bin/gcc-nm-6
-rwxr-xr-x 1 root root 27048 Sep 4 23:17 /usr/bin/gcc-ranlib-5
-rwxr-xr-x 1 root root 27048 Sep 4 23:17 /usr/bin/gcc-ranlib-6
-rwxr-xr-x 1 root root 233288 Oct 27 2011 /usr/bin/gccxml
-rwxr-xr-x 1 root root 8635088 Oct 27 2011 /usr/bin/gccxml_cc1plus
loic@loic-K73SD:/$
Merci
Hors ligne
#6 Le 08/12/2016, à 14:18
- pingouinux
Re : Problème mise à jour GCC
Peux-tu donner aussi le retour de
ls -ld /etc/alternatives/gcc*
Hors ligne
#7 Le 08/12/2016, à 14:27
- lolo_z
Re : Problème mise à jour GCC
voilà :
loic@loic-K73SD:/$ ls -ld /etc/alternatives/gcc*
lrwxrwxrwx 1 root root 14 Dec 7 21:00 /etc/alternatives/gcc -> /usr/bin/gcc-5
loic@loic-K73SD:/$
Hors ligne
#8 Le 08/12/2016, à 14:35
- pingouinux
Re : Problème mise à jour GCC
Je ne comprends pas, ton gcc pointe bien vers la version gcc-5.
Quel est le retour de
type gcc gcc-5
gcc --version
gcc-5 --version
Hors ligne
#9 Le 08/12/2016, à 14:41
- lolo_z
Re : Problème mise à jour GCC
voilà le résultat :
loic@loic-K73SD:/$ type gcc gcc-5
gcc is /usr/bin/gcc
gcc-5 is /usr/bin/gcc-5
loic@loic-K73SD:/$ gcc --version
gcc (Ubuntu 5.4.1-2ubuntu1~12.04) 5.4.1 20160904
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
loic@loic-K73SD:/$ gcc-5 --version
gcc-5 (Ubuntu 5.4.1-2ubuntu1~12.04) 5.4.1 20160904
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hors ligne
#10 Le 08/12/2016, à 14:44
- pingouinux
Re : Problème mise à jour GCC
Cela confirme donc que gcc pointe bien vers la version gcc-5. Je ne vois pas quel est ton problème.
Hors ligne
#11 Le 08/12/2016, à 14:46
- lolo_z
Re : Problème mise à jour GCC
En fait je me demande si le problème ne ne viendrait pas plutot de ma version de gfortran.
loic@loic-K73SD:/$ ls -ld /usr/bin/gfortran*
lrwxrwxrwx 1 root root 12 Mar 13 2012 /usr/bin/gfortran -> gfortran-4.6
-rwxr-xr-x 1 root root 357312 Apr 16 2012 /usr/bin/gfortran-4.6
-rwxr-xr-x 1 root root 890768 Sep 4 23:15 /usr/bin/gfortran-5
-rwxr-xr-x 1 root root 956776 Sep 4 23:08 /usr/bin/gfortran-6
loic@loic-K73SD:/$
Ici pour le coup j'ai bien gfortran qui pointe vers la version 4.6. Comment est-ce que je pourrais faire pour que gfortran pointe vers gfotran-5 ?
Merci
Hors ligne
#12 Le 08/12/2016, à 14:51
- pingouinux
Re : Problème mise à jour GCC
cd /usr/bin
sudo ln -sf gfortran-5 gfortran
Et pour revenir en arrière
sudo ln -sf gfortran-4.6 gfortran
Hors ligne
#13 Le 08/12/2016, à 14:53
- lolo_z
Re : Problème mise à jour GCC
Super ma compilation a fonctionnée !
Merci beaucoup
Hors ligne