How to install two GCC versions for cuda 5.0 on centos7 - gcc

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.

Related

GLIBCXX_3.4.26 not found on centos

I am facing this issue on centos:-
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found
Gcc version i have is :- gcc version 7.2.0 (GCC)
How can i install GLIBCXX_3.4.26 on centos 7.8?
You need to build your application using the system compiler or GCC from Developer Toolset. Developer Toolset uses a hybrid linkage model which avoids these errors. This functionality is likely missing from your custom build of GCC.

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

gFortran and OpenACC support

According to the gFortran docs in order to enable OpenACC support it is necessary to use the -fopenacc switch. However, this does not seem to work.
gfortran: error: unrecognized command line option ‘-fopenacc’
gFortran version is GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28).
What is the correct way to compile Fortran code with OpenACC support?
Your version is WAY too old. The currently supported versions of GCC are 7, 8 and 9.
The version specific manuals are available at https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gfortran/OpenACC.html#OpenACC Change the version number in the address to see other versions.
The option appears to be added in version 5 but the support in more recent versions is likely to be much better.

How to upgrade gcc 4.7.2 in centos 6.9 to gcc 4.8

I am running centos version 6.9 and had installed gcc using command sudo yum install -y gcc gcc-c++ which installed gcc version 4.7.2. However i need to use gcc version 4.8.5. How do i upgrade gcc to the required version?
CentOS 6 does not come with GCC 4.7, so you must have installed something else.
You can upgrade to CentOS 7. This will give you GCC 4.8.5 (plus extensive backports, including at least one new backend). But the binaries you compile on CentOS 7 will not run on CentOS 6.
If you need just a newer GCC, and not version 4.8.5 exactly, you can use Developer Toolset. Version 7 gives you GCC 7. For C and C++ at least, the compiled code will run on any CentOS 6 system.

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

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

Resources