Can I downgrade gcc in centos 64 bit? - linux

i am using centos 6.4 which has gcc with version 4.4.7 but CUDA 5 require gcc version 4.4.5 as per following link CUDA-toolkit-release-notes
How can I downgrade gcc to 4.4.5 or below without causing harm to my system?

Actually I think 4.4.7 will be OK. If you're having trouble using 4.4.7, please post a new question with the details of the problems you are having. Although the link you reference mentions 4.4.5, that simply means what CUDA was tested with. If you look in /usr/local/cuda/include/host_defines.h you will see that the enforced limit is 4.6.x or below:
#if defined(__GNUC__)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
#error -- unsupported GNU version! gcc 4.7 and up are not supported!
#endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6) */
#endif /* __GNUC__ */
If you really want to install a different gcc/g++, it is possible, you can search on those topics on stack overflow, or on the web. Here's one example on the web of a how-to site that explains installing an arbitrary version of gcc/g++ alongside the version that ships with your OS. It mentions Fedora 15 but the instructions should work OK for your CentOS 6.4

Related

Running binaries compiled in RHEL 7 gcc 4.7 in RHEL 6

I have a bunch of libraries built in RHEL 7 using gcc 4.7. Is the following possible
1) Can the binary be executed in RHEL 6 host without re-compiling ?
2) The shared objects produced in RHEL 7 hosts with gcc 4.7 be used
on a RHEL 6 with gcc 4.4 compiler ?
What are the caveats here ?
If you won't link your binary statically, your problem would be shared libraries:
gcc usually links C programs with:
glibc -- implementation for C runtime library. RHEL 6 and 7 have different versions of that library. glibc uses symbol tagging, i.e.:
myaut#panther:/tmp> readelf -s /lib64/libc.so.6 | grep ' open#'
1679: 00000000000d8a70 90 FUNC WEAK DEFAULT 12 open##GLIBC_2.2.5
So if your program with link with function which has newer tag that is present in RHEL6, you won't be able to run your program.
libgcc_s is a GCC runtime that mostly contains functions that are not available on hardware platform (i.e. 32-bit binaries doesn't support 64-bit long long arithmetic, so they require library to do that), put it seem to be optional.
Finally, GCC 4.4 and 4.7 have compatible ABIs, so you shouldn't run into trouble due to different compilers.
If you use the GCC compiler included with the Red Hat Developer Toolset, RH guarantees that an app compiled on a major RHEL version will also run on the +1 version, e.g compile on RHEL 6 and run on either RHEL 6 or 7.
There's v4, but also GCC 5 and working on 6.
See http://developers.redhat.com/products/developertoolset/overview/

version `GLIBC_2.11' not found while using gcc

I have problem using gcc/g++ after I changed the machine I use,
I installed gcc-4.9.2 in my previous machine, when I moved to the new machine, I copied gcc folder to the new machine.
When I try to use I get this error :
/data/obenchek/gcc-4.9.2/bin/g++: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by /data/obenchek/gcc-4.9.2/bin/g++)
I have already checked this question :
`GLIBC_2.11' not found
If it says right, the version of libc and g++ are not compatible , libc version :
/lib/libc.so.6
GNU C Library stable release version 2.4 (20090904), by Roland McGrath et al.
...
So I should reinstall gcc completely or there is a easier way to resolve this ??
I copied gcc folder to the new machine.
That's your problem: don't copy, install appropriate GCC package instead.
Most UNIX systems, including Linux, guarantee backward compatibility: a binary compiled on an older system continues to run on a newer one.
The reverse is not true: a binary compiled on a newer system often will not run on an older one. This is working "as designed".
In this particular instance, you copied GCC compiled with GLIBC-2.11 or newer to a machine that has GLIBC-2.10 or older. And that doesn't work.

Which gfortran compiler support "real*16 or real(kind=16)" under scientific linux 6?

I am currently using gfortran 4.4.7 compiler under scientific linux 6.
I need to declare variables with 128-bit.
I cannot change the O.S.
I hope there is something that I can do under scientific linux 6.
Install gfortran 4.6 or newer; support for REAL(KIND=16) has been added there with libquadmath. Preferably, you should install latest 4.9 version; IIRC some libquadmath-related bugs have been fixed in the meantime.
See https://gcc.gnu.org/wiki/GFortran/News#gfortran_4.6 .

How to install/update gcc-4.6 on openSUSE 11.2 (x86_64)?

I met an err when I installed JikesRVM, that is,
skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.4/libstdc++.so when searching for -lstdc++
So I am trying to install/update it to a later version. Now, the machine already has
gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revision 150839]
I am new to openSUSE, could you help?
Thanks!
You need to install 32 bit support for the GNU C/C++ compiler since JikesRVM on x86_64 currently supports only the 32 bit architecture.
To install this support in OpenSuSE 11.2 type
sudo zypper install gcc44-32bit gcc-32bit libstdc++44-devel-32bit
The first two provide runtime support for the C language and the 32-bit version of libgcc, the GCC low level runtime library. The third provides the 32-bit version of libstdc++, both the static import library and the dynamic library. It is the static libstdc++.a that was missing for JikesRVM.
To verify that the 32bit C++ build system is installed correctly you can test it with the following
echo "int main(){}" | g++ -x c++ -m32 -
Note Official support for OpenSuSE 11.2 has ended. Evergreen support will be available through 2013. Yet it is reasonable to update to 11.3 or a later version soon.

Can I check which version of OpenMP I have installed?

I am trying to find out which version of OpenMP is installed on my machine. It's a Linux box I am connected to using ssh.
I am using gcc to compile using -fopenmp.
Quoting from the GCC wiki page containing information on the OpenMP specification:
As of GCC 4.2, the compiler implements version 2.5 of the OpenMP
specification, as of 4.4 it implements version 3.0 and since GCC 4.7
it supports the OpenMP 3.1 specification. GCC 4.9 supports OpenMP 4.0
with the follow exceptions (as of 2013-11-28): the new 4.0 directives are not yet supported in Fortran and omp target will always run on the host
With gcc, I suppose you should be looking for the compiler version
gcc -v
Perhaps in combination with the version of libgomp
ls -ltr /usr/lib/libgomp.so.1*
e.g.
-rw-r--r-- 1 root root 46652 2010-09-27 23:00 /usr/lib/libgomp.so.1.0.0
Depending on your distro this might give more info:
dpkg --status libgomp
E.g:
Package: libgomp1
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 84
Maintainer: Ubuntu Core developers <ubuntu-devel-discuss#lists.ubuntu.com>
Architecture: i386
Source: gcc-4.5
Version: 4.5.1-7ubuntu2
Depends: gcc-4.5-base (= 4.5.1-7ubuntu2), libc6 (>= 2.6)
Description: GCC OpenMP (GOMP) support library
GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers
in the GNU Compiler Collection.
Homepage: http://gcc.gnu.org/
Original-Maintainer: Debian GCC Maintainers <debian-gcc#lists.debian.org>
In my case it confirms that the version matches gcc

Resources