Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 07-18-11, 08:30 AM   #13
dk75
Registered User
 
Join Date: Jan 2009
Posts: 171
Default Re: Could not compile 'gcc-version-check.c' in my Debian box.

Strange thought... you are using stable debian (2.6.32 kernel) and have same problem like testing had (i have not anymore).

PS: i'm using alternatives system to change gcc, g++, gcov and cpp in one go to version that i need (all of them).
It needs to be configured before, like with that script (it's my environment script as i have 4.3, 4.4, 4.5 and 4.6 GCC installed):
Code:
#!/bin/bash

sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --remove-all gcov
sudo update-alternatives --remove-all cpp

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 43 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.3 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.3 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.3

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.4 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.4 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.4

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 45 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.5 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.5 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 46 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.6 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.6 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.6

exit 0
Then i do "sudo update-alternatives --config gcc" and chose desired gcc environment.
__________________
  • Linux Debian Sid x86_64/ 3.2.0
  • Lenovo T61p
  • NVIDIA driver 295.33
  • Xorg/XServer 7.6+12/1.11.4
  • GNOME 3.2.2
dk75 is offline   Reply With Quote
Old 07-18-11, 08:36 AM   #14
ant
A GeForced Ant
 
ant's Avatar
 
Join Date: Sep 2002
Location: An Ant Farm
Posts: 348
Default Re: Could not compile 'gcc-version-check.c' in my Debian box.

Quote:
Originally Posted by dk75 View Post
Strange thought... you are using stable debian (2.6.32 kernel) and have same problem like testing had (i have not anymore).

PS: i'm using alternatives system to change gcc, g++, gcov and cpp in one go to version that i need (all of them).
It needs to be configured before, like with that script (it's my environment script as i have 4.3, 4.4, 4.5 and 4.6 GCC installed):
Code:
#!/bin/bash

sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --remove-all gcov
sudo update-alternatives --remove-all cpp

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 43 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.3 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.3 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.3

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.4 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.4 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.4

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 45 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.5 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.5 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 46 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.6 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.6 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.6

exit 0
Then i do "sudo update-alternatives --config gcc" and chose desired gcc environment.
If I don't specify which gcc version when compiling NVIDIA drivers, then I get error:

The CC version check failed:

The compiler used to compile the kernel (gcc 4.3) does not exactly match the current compiler
(gcc 4.6). The Linux 2.6 kernel module loader rejects kernel modules built with a version of
gcc that does not exactly match that of the compiler used to build the running kernel.

If you know what you are doing and want to ignore the gcc version check, select "No" to continue
installation. Otherwise, select "Yes" to abort installation, set the CC environment variable to
the name of the compiler used to compile your kernel, and restart installation. Abort now?

Yes No
__________________
Ant @ The Ant Farm (http://antfarm.ma.cx) and Ant's Quality Foraged Links (http://aqfl.net).
ant is offline   Reply With Quote
Old 07-18-11, 09:16 AM   #15
dk75
Registered User
 
Join Date: Jan 2009
Posts: 171
Default Re: Could not compile 'gcc-version-check.c' in my Debian box.

doesn't CC is symlinked to GCC at your system?
After that update-alternatives do symlinking to GCC desired gcc version
Code:
:~$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --with-arch-32=i586 --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 4.6.1 (Debian 4.6.1-1) 
:~$ 
:~$ sudo update-alternatives --config gcc
There are 4 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-4.6   46        auto mode
  1            /usr/bin/gcc-4.3   43        manual mode
  2            /usr/bin/gcc-4.4   44        manual mode
  3            /usr/bin/gcc-4.5   45        manual mode
  4            /usr/bin/gcc-4.6   46        manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/gcc-4.3 to provide /usr/bin/gcc (gcc) in manual mode.
:~$ 
:~$ cc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --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 4.3.5 (Debian 4.3.5-4) 
:~$
__________________
  • Linux Debian Sid x86_64/ 3.2.0
  • Lenovo T61p
  • NVIDIA driver 295.33
  • Xorg/XServer 7.6+12/1.11.4
  • GNOME 3.2.2
dk75 is offline   Reply With Quote
Old 07-18-11, 09:26 AM   #16
ant
A GeForced Ant
 
ant's Avatar
 
Join Date: Sep 2002
Location: An Ant Farm
Posts: 348
Post Re: Could not compile 'gcc-version-check.c' in my Debian box.

Quote:
Originally Posted by dk75 View Post
doesn't CC is symlinked to GCC at your system? ...
$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i486-linux-gnu/4.6.1/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/i386-linux-gnu --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu target=i486-linux-gnu
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-1)

$ locate bin/cc
/usr/bin/cc
/usr/bin/cclive
/usr/bin/ccze
/usr/bin/ccze-cssdump

$ ls -all /usr/bin/cc
lrwxrwxrwx 1 root root 20 Jun 5 2005 /usr/bin/cc -> /etc/alternatives/cc
__________________
Ant @ The Ant Farm (http://antfarm.ma.cx) and Ant's Quality Foraged Links (http://aqfl.net).
ant is offline   Reply With Quote
Old 07-18-11, 09:36 AM   #17
dk75
Registered User
 
Join Date: Jan 2009
Posts: 171
Default Re: Could not compile 'gcc-version-check.c' in my Debian box.

so, use once my script to configure alternatives system and after that with "sudo update-alternatives --config gcc" you could change cc in between 4.3, 4.4, 4.5 and 4.6 without the hassle.

Or you could do it in your way as usual - your choice.
__________________
  • Linux Debian Sid x86_64/ 3.2.0
  • Lenovo T61p
  • NVIDIA driver 295.33
  • Xorg/XServer 7.6+12/1.11.4
  • GNOME 3.2.2
dk75 is offline   Reply With Quote
Old 07-18-11, 10:32 AM   #18
dahveed3
Registered User
 
Join Date: Sep 2007
Posts: 22
Default Re: Could not compile 'gcc-version-check.c' in my Debian box.

That's a part stable, part testing and who knows what system, being that there's the squeeze kernel there and the rest kind of or wanting to being upgraded to newer than stable packages.

That kind of system nearly always becomes an impossible mess to deal with. The only package upgrades for Debian stable should be those from backports.org, squeeze-updates, debian-multimedia.org (if desired), and the security repo.

And if running testing, then it looks like a kernel meta-package is not installed otherwise it would have 2.6.39 after aptitude full-upgrade from squeeze to wheezy.

Testing has had a broken nvidia (and fglrx until recently) since the 2.6.39 kernel upgrade due to the new multi-lib linking system that debian has chosen for it. That will be fixed sometime later today since the new nvidia packages have put in their time in sid and should come in today. What was happening is that when installing nvidia, the mesa support for 3D would be removed just as the above posts indicate. That's what's getting fixed in the new nvidia packages today.

The gcc version warning happens whenever the kernel was compiled with a different version of gcc than the nvidia driver installer uses. I have squeeze installed with the 2.6.38 kernel from squeeze-backports and the official nvidia installer (as well as previously the wheezy debian nvidia packages) have no gcc version mismatch problem at this time.

But even if they did, this was not the reason for the mesa support being removed. That was simply due to the linking problems in testing with the new multi-lib supporting kernel which, by the way, the OP isn't even using since he's still on 2.6.32 from squeeze! (See how confusing when mixing stable with anything else?)

A simple export CC=gcc_4.3whatever before installing using the official nvidia driver would eliminate the installer warning as long as the named gcc version was installed on the system. This isn't necessary at this time in stable even with the backported kernel (or with the stable kernel), but apparently is necessary if the user has full-upgraded to wheezy but is still using the squeeze kernel (a mixed system).

I purged the debian nvidia packages a couple of days ago and installed the just released download from nvidia in order to avoid needing to activate the wheezy sources and experiment with seeing whether the new linking system would allow the newer debian nvidia packages to install on stable with the old non-multi-lib supporting squeeze kernel. I just didn't want to keep using the debian packages I had when they would no longer be available except in my cache in case of a possible need to reinstall them. So I went with the nvidia download instead, putting an /etc/modprobe.d/disable-nouveau.conf in there as per the nvidia readme.

No gcc mis-match was reported on my system by the nvidia-installer as I don't mix stable up with the other distributions. But if the OP is really using testing, he should remove the stable source and upgrade the kernel to testing's kernel by installing the appropriate meta-package, like linux-image-2.6-amd64 or linux-image-2.6-686, etc, as well as the same for the linux-headers packages. Then a simple aptitude full-upgrade will keep him fully in testing in the future as well as ensuring the new nvidia packages will be installable without the package manager removing the mesa 3d stuff.
__________________
Epox EP-8KRAIPRO AthlonXP3200+ GeForce 6600GT 2x512MB PC3200 DDR-SDRAM SBLive 5.1 Platinum
dahveed3 is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:02 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.