I am confused by the versions I have on my machine. I am running Ubuntu 16.04.
The output of gcc --version
and g++ --version
tells me that I have 7.2.0 installed. Great!
When I do gfortran --version
however, it tells me that I have 5.4.1 installed. When I updated (sudo apt-get install gfortran-7
), it correctly updated and now tells me that I already have the newest version.
And when I do gfortran-7 --version
it correctly identifies the version. How can I tell the system that there is a newer version of gfortran "available" on my system? How do I overwrite this?
edit: I already followed Cannot find -lgfortran but the symbolic link is already existant on my drive, so I tried updating and got to the above problem.
edit2: Additionally I just found out with gfortran -v
that this gfortran still thinks gcc is at version 5.4.1 as well. :S
edit3: The output of apt-cache policy gcc gfortran
is:
gcc:
Installed: 4:5.3.1-1ubuntu1
Candidate: 4:5.3.1-1ubuntu1
Version table:
*** 4:5.3.1-1ubuntu1 500
500 http://de.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status
gfortran:
Installed: 4:5.3.1-1ubuntu1
Candidate: 4:5.3.1-1ubuntu1
Version table:
*** 4:5.3.1-1ubuntu1 500
500 http://de.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status
The output of gcc -v
is
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-1ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-1ubuntu1~16.04)
The output of gfortran -v
is
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.1-2ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.1 20160904 (Ubuntu 5.4.1-2ubuntu1~16.04)
edit4: The output of whereis -b gcc gfortran gfortran-7
is
gcc: /usr/bin/gcc /usr/lib/gcc
gfortran: /usr/bin/gfortran
gfortran-7: /usr/bin/gfortran-7
{}
tool) the commands and results ofapt-cache policy gcc gfortran
,gcc -v
,gfortran -v
. – waltinator Aug 21 '17 at 15:40apt-cache policy gcc gfortran
shows that older versions are still being used. (as didgfortran -v
) – fxm Aug 22 '17 at 08:06apt
knows nothing about them. Perhaps you symlinked gcc and g++ to gcc-7 and g++-7 but didn't do the same for gfortran? – steeldriver Aug 22 '17 at 08:14gfortran-7
in 16.04, this package will only be available in 17.10. What Ubuntu version do you use? – dessert Aug 22 '17 at 08:35@steeldriver: Hmm, at least gfortran-7 I installed yesterday via
– fxm Aug 22 '17 at 08:38sudo apt-get install gfortran-7
, but I remember having a small problem with the others. How would I link them though?apt
ordpkg
? If so, no wonder it can't find them… – dessert Aug 22 '17 at 08:42sudo apt-get install
) yesterday. But how could I have installed them otherwise? I didn't use a tarball and set up everything myself, at most I used a different command thansudo apt-get
. – fxm Aug 22 '17 at 08:44gfortran-7
package? Does this help? – dessert Aug 22 '17 at 08:53whereis -b gcc gfortran gfortran-7
. – dessert Aug 22 '17 at 08:56whereis
to the question. And yes I do have the Ubuntu toolchain ppa and I remeber using it when installing gcc and g++! I didn't use it (explicitly) when installing gfortran-7 yesterday though. I had found the link you provided, but as I only needed one version of all of them to run, I thought it would not help me. – fxm Aug 22 '17 at 10:55