23

I'm trying to follow a tutorial to get CudaMiner working on Linux. I have PAINSTAKINGLY installed NVidia drivers, Cuda 5.0 and incidentally I'm failing on the last step when I run make:

make  all-recursive
make[1]: Entering directory `/var/progs/CudaMiner'
Making all in compat
make[2]: Entering directory `/var/progs/CudaMiner/compat'
Making all in jansson
make[3]: Entering directory `/var/progs/CudaMiner/compat/jansson'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..     -g -O2 -MT dump.o -MD -MP -MF .deps/dump.Tpo -c -o dump.o dump.c
/bin/bash: gcc: command not found
make[3]: *** [dump.o] Error 127
make[3]: Leaving directory `/var/progs/CudaMiner/compat/jansson'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/progs/CudaMiner/compat'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/progs/CudaMiner'
make: *** [all] Error 2

I'm pretty sure I have gcc, in fact I have multiple versions of it. I installed version 4.6 (which is what cuda requires) but it doesn't seem to find it. I'm so close!

Thanks in advance.

2
  • 8
    Have you tried sudo apt-get install build-essential?
    – jobin
    Mar 2, 2014 at 5:15
  • 2
    build-essential is already the newest version
    – dsp_099
    Mar 2, 2014 at 5:20

4 Answers 4

33

Maybe simple...

sudo apt-get install gcc

... could be enough?

1
  • 11
    That's gcc's one fatal flaw. It only works correctly if installed. Jun 23, 2015 at 18:50
8

Do this: open a terminal and type gcc --version. Does anything come up?

Alternatively, search for the gcc executable, which should be located in /usr/bin. Do ls /usr/bin | grep gcc. What output do you get from that command?

If you get no output from either command, then you need to find your gcc executable wherever you installed it (somewhere in /usr/share maybe?). When found, do cd /usr/bin && ln -s [ABSOLUTE PATH OF GCC].

If you got no output from the first, but output from the second, then you have serious trouble, because /usr/bin is not in your PATH. Edit the file /etc/environment and ADD the following line to the end of the document: PATH="$PATH:/usr/bin".

If you got output from the first, then there is a problem somewhere with bash not reading its own PATH. I think hell would freeze before the first works, but watch you prove me wrong and freeze hell for me. :)

Hope this helps! +1 me if it does!

4
  • 2
    To check if gcc is in the path, it's better to run 'which gcc'.
    – Gx1sptDTDa
    Nov 20, 2014 at 19:25
  • My case 1st command doesn't found gcc, 2nd command found gcc. So I tried your solution to add the PATH="$PATH:/usr/bin to environment file, but unfortunately doesn't work.
    – Jason
    Jan 28, 2020 at 5:43
  • @Jason this question is about 5 years old now. I'd suggest opening your own question with as much info that you can give. Where did the second command show your gcc is located? Feb 1, 2020 at 7:50
  • @Zzzach... I found out that I didn't create a symbol link between gcc --> gcc-[the version I want], which is why the gcc-[certain version] is already in the file system but couldn't be called in shell. Your solution should work actually.
    – Jason
    Feb 1, 2020 at 19:13
3

/usr/bin/gcc is a link to the gcc compiler in use

It is not unusual to have multiple versions of gcc installed. there binaries are in the same folder, e.g. gcc-4.4 gcc-4,6 and gcc-4.7

The link /usr/bin/gcc will point to one of these versions. If it is the wrong version, then the change the link to gcc-4.6.

0

To be able to use gcc and tools that are needed by it, try installing build-essential:

$ sudo apt-get install build-essential
1
  • sudo apt update , then sudo apt install build-essential
    – Binyam
    Apr 19, 2022 at 12:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .