GLIBC_2.11' not found (required by /path_name/bin/gfortran) - gcc

I already have GCC and Gfortran installed. It is gcc version 4.1.2 20080704 (Red Hat 4.1.2-52). However, I am trying to install a more recent gfortran compiler. Here is what I did so far. From the http://gfortran.meteodat.ch/download/x86_64/ I downloaded the nightly "gcc-trunk.tar.xz" and I extracted it into the directory "opt." This created the directory "gcc-trunk". I then downloaded the "gcc-5-infrastructure.tar.xz" and extracted it into "gcc-trunk." I then input
PATH="$HOME/gcc-trunk/bin":$PATH
MANPATH="$HOME/gcc-trunk/share/man"
LD_LIBRARY_PATH="$HOME/gcc-trunk/lib64":"$HOME/gcc-trunk/lib":$LD_LIBRARY_PATH
on bash. I then tried to verify whether gfortran installed correctly with
/path_name/gfortran -v
However, I get the message GLIBC_2.11' not found (required by /path_name/bin/gfortran). I am not sure what is the problem. What should I do?

The gfortran binary you downloaded was built against a newer version of glibc than the one you have installed on your system.
You can solve this problem e.g. by
Acquiring a gfortran binary built against an older version of glibc
Building GCC from source
Upgrade to a newer distro with a newer glibc

Related

Targetting an older version of libstdc++ with recent GCC when cross-copiling to an embedded-linux ARM device

We need to find a cross-compilation toolchain for an ARM embedded linux target that satisfies the following criteria:
Kernel 3.17
GLIBC 2.18
Recent version of GCC is required to compile some third-party code
Those requirements brought me to generate a custom cross-compilation toolchain using crosstool-ng. I selected the min kernel version, min glibc version and it seemed to work well until I tried to compile code containing C++.
Because the new GCC is using a more recent libstdc++ than what is available on the target, the executable won't run and we get an error like this:
/usr/lib/libstdc++.so.6: version `CXXABI_1.3.9' not found
The code compiled fine with an older version of GCC.
Looking at the configuration options for crosstool-ng I didn't find anything that would let me change the min libstdc++ version, like for glibc.
Is there a way to target an older libstdc++ version without downgrading GCC?
Can I use the headers and libstdc++.so files from the target to replace the ones GCC is using when cross-compiling?

How to install older version of GCC on Windows 10

I need to install MinGW GCC 7.3 on my computer for a project. Downloaded and installed: C:\MinGW\bin\MingGW-get.exe. But when I run it, it only gives me the option to install the latest GCC v9.2.0. How do I download and install GCC v7.3 on my computer? Step-by-step directions appreciated.
Unless you specifically want the mingw.org toolchain, check out https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/. Currently there's v8.1.0, v7.3.0, v6.4.0 and v5.4.0. Other versions are available elsewhere.
Of you need to support an older C/C++ standard the -std= compiler flag may already help (e.g. -std=c99 for ISO 1999 C or -std=c++98 for ISO 1998 C++).
Note that GCC 7.3 is not the latest version of GCC 7. The latest GCC 7 release is version 7.5.0.
You can the Windows (MinGW-w64) version from: http://winlibs.com/
The online installer tool (first option on the page) allows you to do so.
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe

How to find a GCC version which contains a certain version of libstdc++.so?

With my knowledge, libstdc++.so is bundled with g++ and will be installed when installing a g++. However, if I want to install a certain version of libstdc++.so, how can I know which version of g++ (or gcc) should I install?
See the this section of appendix B of the libstdc++ manual, which contains a list of gcc and libstdc++ version numbers.

How to install two GCC versions for cuda 5.0 on centos7

I need to install cuda 5.0 in centos7 x64. But, I have a problem with GCC, as the current version installed is (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11).
What is the supported version of GCC for Cuda 5.0 and how to install this older GCC version with my actual compiler ((GCC) 4.8.5).
Thanks in advance
#talonmies has provided a list of maximum GCC version supported by different versions of CUDA. Specifically: CUDA 5.0 supports GCC up to 4.6 - and that's what you should install.
There's an answer here on SO which explains how to get GCC 4.6(.3) installed by building from sources. Essentially you need to build some libraries with any C compiler before you can build GCC itself.
Good luck.

TensorFlow build fails with `GLIBCXX_3.4.20' not found

Building TensorFlow with gcc version 4.8.5 or 5.4.0 gives an error:
bazel-out/host/bin/external/protobuf/protoc: /lib64/libstdc++.so.6:
version `GLIBCXX_3.4.20' not found (required by
bazel-out/host/bin/external/protobuf/protoc)
Tried to add linker flags in CROSSTOOL.tpl file in Tensorflow, however it didn't help.
You built your app with version of GCC that's newer than your host GCC. So your app uses symbols which are not present in host libstdc++ which causes runtime linker to fail.
You can solve this by linking your app with -Wl,-rpath,path/to/new/libs or setting LD_LIBRARY_PATH appropriately.

Resources