Скачали какой-нибудь пакетик и хотите его скомпилировать?
А у вас вылазит:
make: command not found
Решение простое, вам необходимо установить пакет make
aptitude install make
Еще из этой серии вам может понадобиться компилятор gcc и вы увидите такую ошибку:
gcc: Command not found
Это тоже решается просто — устанавливаем gcc и необходимые зависимости
Я пытаюсь следовать руководству, чтобы получить CudaMiner , работающий в Linux. У меня PAINSTAKINGLY установлены драйверы NVidia, Cuda 5.0 и, кстати, я провалился на последнем шаге, когда я запускаю make :
Я уверен, что у меня есть gcc, на самом деле у меня есть несколько версий. Я установил версию 4.6 (это то, что требуется cuda), но она, похоже, не находит ее. Я так близко!
3 ответа
Сделайте это: откройте терминал и введите gcc —version . Что-нибудь придумало?
В качестве альтернативы выполните поиск исполняемого файла gcc, который должен быть расположен в / usr / bin. Do ls /usr/bin | grep gcc . Какой результат вы получаете от этой команды?
Если вы не получаете выход из любой команды, вам нужно найти исполняемый файл gcc, где бы вы его не установили (где-то в / usr / share, возможно?). Когда найдено, do cd /usr/bin && ln -s [ABSOLUTE PATH OF GCC] .
Если у вас нет выхода из первого, но выводятся из второго, тогда у вас есть серьезные проблемы, потому что / usr / bin не находится в вашем PATH. Отредактируйте файл /etc/environment и добавьте следующую строку в конец документа: PATH="$PATH:/usr/bin" .
Если вы получили выход из первого, тогда возникает проблема где-то с bash, не читая его собственный PATH. Я думаю, что ад замерзнет перед первыми работами, но наблюдайте, как вы доказываете мне, что я ошибаюсь, и замораживаю ад для меня. 🙂
Надеюсь, это поможет! +1 меня, если это произойдет!
I am trying to a create a makefile architecture so I have one global makefile at the top which call another in a subdirectory.
When I "make" in the top directory I have the following error :
But when i type exactly the same command (gcc -W -Wall -pedantic proj/main.c -o proj.exe) in my terminal, it’s building.
And if I remove the makefile include, he recognize gcc but don’t build because no sources (normal behavior).
2 Answers 2
In the UNIX shell, the environment variable PATH specifies the set of directories to search for executables when you run a command.
When make runs a recipe, variables defined in the makefile are placed into the environment of each shell. This allows you to pass values to sub- make invocations (see Recursive Use of make ). By default, only variables that came from the environment or the command line are passed to recursive invocations.
Because PATH is a shell variable and is defined in the environment of make , it is "came from the environment". That means when you modify the value with PATH = $(PROJECT) the updated value will be set in the environment of the shell that runs the recipe for $(PROJECT).exe . That means the shell runs with a bad value for the PATH and so cannot find gcc .
To avoid this confusion, do not use PATH as a makefile variable. Use another name which is not the same as an environment variable that the shell depends on. You could call it PROJECT_PATH instead, or just use $(PROJECT) instead of $(PATH) .