1 votes

Installer une ancienne version de gfortran

Je suis en train d'utiliser Ubuntu 16.04.2 LTS et je veux installer la version gfortran 5.3. Lorsque j'utilise l'une des commandes ci-dessous gfortran 5.4 est installé, ce qui n'est pas compatible avec le programme que j'essaie de lancer.

sudo apt-get install gfortran
apt-get install csh gfortran

Je tente de faire fonctionner le logiciel de mécanique quantique GAMESS, qui, autant que je sache, nécessite des modifications spécifiques pour chaque compilateur. Lorsque j'essaie d'installer GAMESS avec gfortran 5.4, j'obtiens un message disant Version de gfortran non reconnue. J'ai examiné le code et la version prise en charge la plus récente est la 5.3.

Comment pourrais-je installer l'ancienne version gfortran 5.3? De plus, est-ce que quelque chose comme ce qui suit fonctionnerait pour supprimer la version 5.4 afin d'éviter les conflits? Merci!

sudo apt-get remove --auto-remove gfortran

Pour clarification, je ne suis pas sûr pourquoi gamess n'accepte pas les versions après 5.3 mais j'obtiens trop d'erreurs pour terminer l'installation avec la version 5.4. De plus, lorsque j'entre la commande apt-cache policy gfortran j'obtiens la sortie suivante:

gfortran:
Installé : 4:5.3.1-1ubuntu1
Candidat : 4:5.3.1-1ubuntu1
Table de version :
*** 4:5.3.1-1ubuntu1 500
    500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
    100 /var/lib/dpkg/status

0voto

sudodus Points 39902

Ubuntu 16.04 LTS

Vous pouvez essayer d'utiliser l'option -std décrite dans le manuel,

man gfortan

   -std=std
       Specify the standard to which the program is expected to conform,
       which may be one of f95, f2003, f2008, gnu, or legacy.  The default
       value for std is gnu, which specifies a superset of the Fortran 95
       standard that includes all of the extensions supported by GNU
       Fortran, although warnings will be given for obsolete extensions
       not recommended for use in new code.  The legacy value is
       equivalent but without the warnings for obsolete extensions, and
       may be useful for old non-standard programs.  The f95, f2003 and
       f2008 values specify strict conformance to the Fortran 95, Fortran
       2003 and Fortran 2008 standards, respectively; errors are given for
       all extensions beyond the relevant language standard, and warnings
       are given for the Fortran 77 features that are permitted but
       obsolescent in later standards. -std=f2008ts allows the Fortran
       2008 standard including the additions of the Technical
       Specification (TS) 29113 on Further Interoperability of Fortran
       with C and TS 18508 on Additional Parallel Features in Fortran.

Ubuntu 14.04 LTS

Ubuntu 14.04.1 LTS bénéficie d'un support à long terme de 5 ans, jusqu'en avril 2019. J'ai testé dans un système live persistant créé à partir du fichier iso. ubuntu-14.04.1-desktop-amd64.iso con mkusb .

Lorsque j'ai installé gfortran dans ce système, il s'agissait de la version 4.8.4

GNU Fortran (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

Le dialogue de ligne de commande suivant illustre ce que j'avais et ce que j'ai fait. Si vous n'avez pas de chance avec Ubuntu 16.04 LTS, vous pouvez essayer avec Ubuntu 14.04 LTS. Peut-être qu'elle fonctionne mieux avec le logiciel que vous voulez compiler.

ubuntu@ubuntu:~$ sudo lsblk -fm
NAME   FSTYPE   LABEL                    MOUNTPOINT            NAME     SIZE OWNER GROUP MODE
sda                                                            sda     29.1G root  disk  brw-rw----
sda1 ntfs     usbdata                  /media/ubuntu/usbdata sda1     7G root  disk  brw-rw----
sda2                                                         sda2     1K root  disk  brw-rw----
sda3 vfat     usbboot                  /media/ubuntu/usbboot sda3   244M root  disk  brw-rw----
sda4 iso9660  Ubuntu 14.04.1 LTS amd64 /cdrom                sda4 999.5M root  disk  brw-rw----
sda5 ext4     casper-rw                                      sda5  20.9G root  disk  brw-rw----
sr0                                                            sr0     1024M root  cdrom brw-rw----
loop0  squashfs                          /rofs                 loop0  938.7M root  disk  brw-rw----
ubuntu@ubuntu:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/cow             21G   71M   20G   1% /
udev            1.9G  4.0K  1.9G   1% /dev
tmpfs           384M  1.2M  383M   1% /run
/dev/sda4       981M  981M     0 100% /cdrom
/dev/loop0      939M  939M     0 100% /rofs
none            4.0K     0  4.0K   0% /sys/fs/cgroup
tmpfs           1.9G  4.0K  1.9G   1% /tmp
none            5.0M     0  5.0M   0% /run/lock
none            1.9G   76K  1.9G   1% /run/shm
none            100M   56K  100M   1% /run/user
/dev/sda5        21G   71M   20G   1% /media/ubuntu/casper-rw
/dev/sda3       241M   46M  196M  19% /media/ubuntu/usbboot
/dev/sda1       7.0G   37M  7.0G   1% /media/ubuntu/usbdata
ubuntu@ubuntu:~$ sudo apt-get update
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty InRelease
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/main Translation-en_US
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/main Translation-en
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/restricted Translation-en_US
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/restricted Translation-en
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]      
Ign http://archive.ubuntu.com trusty InRelease                            
Get:2 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get:3 http://security.ubuntu.com trusty-security/main amd64 Packages [643 kB]
Hit http://archive.ubuntu.com trusty Release.gpg                    
Get:4 http://archive.ubuntu.com trusty-updates/main amd64 Packages [999 kB]
Get:5 http://security.ubuntu.com trusty-security/restricted amd64 Packages [14.0 kB]
Get:6 http://security.ubuntu.com trusty-security/main Translation-en [345 kB]  
Get:7 http://security.ubuntu.com trusty-security/restricted Translation-en [3,491 B]
Get:8 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [17.1 kB]
Get:9 http://archive.ubuntu.com trusty-updates/main Translation-en [491 kB]
Get:10 http://archive.ubuntu.com trusty-updates/restricted Translation-en [3,978 B]
Hit http://archive.ubuntu.com trusty Release                             
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/main Translation-en
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
Fetched 2,648 kB in 2s (1,235 kB/s)
Reading package lists... Done
ubuntu@ubuntu:~$ sudo apt-get install gfortran
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  cpp-4.8 gcc-4.8 gcc-4.8-base gfortran-4.8 libasan0 libatomic1 libgcc-4.8-dev
  libgfortran-4.8-dev libgfortran3 libgomp1 libitm1 libquadmath0 libstdc++6
  libtsan0
Suggested packages:
  gcc-4.8-locales gcc-4.8-multilib gcc-4.8-doc libgcc1-dbg libgomp1-dbg
  libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg
  gfortran-multilib gfortran-doc gfortran-4.8-multilib gfortran-4.8-doc
  libgfortran3-dbg
The following NEW packages will be installed:
  gfortran gfortran-4.8 libgfortran-4.8-dev libgfortran3
The following packages will be upgraded:
  cpp-4.8 gcc-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev libgomp1
  libitm1 libquadmath0 libstdc++6 libtsan0
11 upgraded, 4 newly installed, 0 to remove and 687 not upgraded.
Need to get 17.4 MB of archives.
After this operation, 19.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main gfortran amd64 4:4.8.2-1ubuntu6 [1,252 B]
Get:2 http://security.ubuntu.com/ubuntu/ trusty-security/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.3 [94.9 kB]
Get:3 http://security.ubuntu.com/ubuntu/ trusty-security/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.3 [126 kB]
Get:4 http://security.ubuntu.com/ubuntu/ trusty-security/main libitm1 amd64 4.8.4-2ubuntu1~14.04.3 [28.5 kB]
Get:5 http://security.ubuntu.com/ubuntu/ trusty-security/main libgomp1 amd64 4.8.4-2ubuntu1~14.04.3 [23.1 kB]
Get:6 http://security.ubuntu.com/ubuntu/ trusty-security/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.3 [8,636 B]
Get:7 http://security.ubuntu.com/ubuntu/ trusty-security/main libasan0 amd64 4.8.4-2ubuntu1~14.04.3 [63.1 kB]
Get:8 http://security.ubuntu.com/ubuntu/ trusty-security/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.3 [5,047 kB]
Get:9 http://security.ubuntu.com/ubuntu/ trusty-security/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.3 [4,595 kB]
Get:10 http://security.ubuntu.com/ubuntu/ trusty-security/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.3 [1,688 kB]
Get:11 http://security.ubuntu.com/ubuntu/ trusty-security/main gcc-4.8-base amd64 4.8.4-2ubuntu1~14.04.3 [16.2 kB]
Get:12 http://security.ubuntu.com/ubuntu/ trusty-security/main libstdc++6 amd64 4.8.4-2ubuntu1~14.04.3 [259 kB]
Get:13 http://security.ubuntu.com/ubuntu/ trusty-security/main libgfortran3 amd64 4.8.4-ubuntu1~14.04.3 [248 kB]
Get:14 http://security.ubuntu.com/ubuntu/ trusty-security/main libgfortran-4.8-dev amd64 4.8.4-2ubuntu1~14.04.3 [269 kB]
Get:15 http://security.ubuntu.com/ubuntu/ trusty-security/main gfortran-4.8 amd64 4.8.4-2ubuntu1~14.04.3 [4,883 kB]
Fetched 17.4 MB in 23s (724 kB/s)                                              
(Reading database ... 169556 files and directories currently installed.)
Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../libgomp1_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libgomp1:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Preparing to unpack .../gcc-4.8-base_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking gcc-4.8-base:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up gcc-4.8-base:amd64 (4.8.4-2ubuntu1~14.04.3) ...
(Reading database ... 169556 files and directories currently installed.)
Preparing to unpack .../libstdc++6_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libstdc++6:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.2-19ubuntu1) ...
Setting up libstdc++6:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Selecting previously unselected package libgfortran3:amd64.
(Reading database ... 169568 files and directories currently installed.)
Preparing to unpack .../libgfortran3_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libgfortran3:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Selecting previously unselected package libgfortran-4.8-dev:amd64.
Preparing to unpack .../libgfortran-4.8-dev_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking libgfortran-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Selecting previously unselected package gfortran-4.8.
Preparing to unpack .../gfortran-4.8_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
Unpacking gfortran-4.8 (4.8.4-2ubuntu1~14.04.3) ...
Selecting previously unselected package gfortran.
Preparing to unpack .../gfortran_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking gfortran (4:4.8.2-1ubuntu6) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libgomp1:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libgfortran3:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up libgfortran-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Setting up gfortran-4.8 (4.8.4-2ubuntu1~14.04.3) ...
Setting up gfortran (4:4.8.2-1ubuntu6) ...
update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode
Processing triggers for libc-bin (2.19-0ubuntu6) ...
ubuntu@ubuntu:~$ gfortran --version
GNU Fortran (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

ubuntu@ubuntu:~$ gfortran -dumpversion
4.8
ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ubuntu:~$ 

Veuillez noter que je n'ai pas testé ce qui se passe après la mise à jour et la mise à niveau d'un système installé de 14.04 LTS.

SistemesEz.com

SystemesEZ est une communauté de sysadmins où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres sysadmins, poser vos propres questions ou résoudre celles des autres.

Powered by:

X