web-dev-qa-db-fra.com

Installer l'ancienne version de Gfortran

J'utilise Ubuntu 16.04.2 LTS et souhaite installer gfortran version 5.. Lorsque j'utilise l'une des entrées ci-dessous, gfortran5.4 est installé, ce qui n'est pas compatible avec le programme que j'essaie d'exécuter.

Sudo apt-get install gfortran
apt-get install csh gfortran

J'essaie de lancer le logiciel de mécanique quantique GAMESS, qui nécessite, à ma connaissance, des modifications spécifiques pour chaque compilateur. Lorsque j'essaie d'installer GAMESS avec gfortran 5.4, le résultat obtenu est unrecognized version of gfortran. J'ai regardé le code et la dernière version prise en charge est 5.3.

Comment installer l'ancienne version gfortran5.? En outre, quelque chose comme le travail suivant pourrait-il supprimer la version 5.4 afin d'éviter tout conflit? Merci!

Sudo apt-get remove --auto-remove gfortran

Pour plus de clarté, je ne suis pas sûr de savoir pourquoi gamess n'acceptera pas les versions ultérieures à 5.3, mais je reçois trop d'erreurs pour terminer l'instillation avec la version 5.4. De plus, lorsque je saisis apt-cache policy gfortran, je reçois le résultat suivant:

gfortran:
Installed: 4:5.3.1-1ubuntu1
Candidate: 4:5.3.1-1ubuntu1
Version table:
*** 4:5.3.1-1ubuntu1 500
    500 http://us.archive.ubuntu.com/ubuntu xenial/main AMD64 Packages
    100 /var/lib/dpkg/status
1
DWK

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 est disponible depuis 5 ans, jusqu'en avril 2019. Je l'ai testé dans un système en direct persistant créé à partir du fichier iso ubuntu-14.04.1-desktop-AMD64.iso avec mkusb.

Lorsque j’ai installé gfortran dans ce système, c’était 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'ai 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 que cela 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-2ubuntu1~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.

0
sudodus