bash - make command not found - linux

I have created make file named Makefile in my linux ec2 server.
all: a b
a: daemon.cpp dictionary_exclude.cpp
g++ -o a daemon.cpp dictionary_exclude.cpp -lpthread -std=c++0x -L.
b: user_main.cpp client.cpp
g++ -o b user_main.cpp client.cpp
I could run each of this independently successfull.
But when I execute
make
make -f Makefile
It says make : -bash: make: command not found
Any idea? I can see manually for make is available through man make

Please execute following command to install make in your system
sudo yum install build-essential

In CentOS or Red Hat, try this:
yum groupinstall "Development Tools"

It might be that you have not installed binutils http://en.wikipedia.org/wiki/GNU_Binutils or you have not set your PATH variable to the correct location of bin utils.

sudo apt-get install build-essential on Ubuntu 16 worked for me

Related

I want to install G++ on my Linux Mint but not able to do so

I want to install g++ for using GROMACS on Linux mint. I typed the following command:
sudo apt-get install g++
It successfully installs the g++ but when I change the directory to Downloads to configure and make cmake and fftw, it (Downloads) is empty.
I have tried removing sudo apt-get remove g++ and re-installing g++ but it shows the same result. I don't know where it is downloading g++.
The command apt-get install g++ doesn't download any executables into your current directory or in the ~/Downloads/ directory.
Usually, it is installed in /usr/bin.
You can check for g++ with the command g++ --version.
Also, you can see where it is installed with whereis g++.
The build-essential package is a reference for all the packages needed
to compile a Debian package. It generally includes the GCC/g++
compilers and libraries and some other utilities
https://superuser.com/a/151558
For this purpose install them with command sudo apt install build-essential
and it will install all the things

arm-linux-gnueabi-g++: command not found

I am trying to compile C++ code for ARM architecture. I don't know exactly the full name of processor (waiting for information from some hardware guy), I know only it is some ARM.
The problem which I have.
I use command in order to compile my resource files for ARM architecture:
arm-linux-gnueabi-g++ myApp.cpp -g -Wall -o myApp
and also
arm-linux-gnueabi-gcc myApp.cpp -g -Wall -lstdc++ -o myApp
and gets output:
-bash: arm-linux-gnueabi-g++: command not found
and
-bash: arm-linux-gnueabi-gcc: command not found
In linux which I used I am not sure if there is installed gcc,g++ arm package...
There is:
locate arm-none-linux-gnueabi-
locate arm-linux-gnueabihf-g++
locate arm-linux-gnueabihf-gcc
, there is none:
locate arm-linux-gnueabi-g++
locate arm-linux-gnueabi-gcc
I am not allowed to do some tries and install arm package, because this linux is running on some server to which many developers are attached.
setting PATH in shell:
PATH=$PATH:/opt/eds/x86_64/13.1-2/embedded/ds-5/bin/arm-linux-gnueabihf-g++
or with gcc
doesn't solve the issue.
Setting it in:
~/.bashrc
also doesn't solve the issue because additional problems occurs, I cannot connect to linux server.
Thanks in advance for any help.
for kernel or uboot cross compiling below commands are enough:
sudo apt-get install -y gcc-arm-linux-gnueabihf
sudo apt-get install -y libncurses-dev
sudo apt-get install -y libqt4-dev pkg-config
sudo apt-get install -y u-boot-tools
sudo apt-get install -y device-tree-compiler
but for c++ cross compiling you should install g++ using below command:
sudo apt-get install g++-arm-linux-gnueabihf

Install gcc on AWS EC2 without using yum?

I am trying to install Redis on EC2 but it needs gcc. When I tried gcc was not installed.
Then I tried to install gcc manually and got the following error:
configure: error: could not find a working compiler, see config.log for details
How can I solve this?
If you use a standard AMI Linux instance, you can install gcc simply by running:
sudo yum groupinstall "Development Tools"
On a SuSE instance, you can try:
sudo zypper install gcc
I copied form user7706975's answer
1 Download gcc version from gcc.parentingamerica.com/releases.
2 Compile it from Gcc Wiki for example if you want the version 4.6.2
tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=$HOME/GCC-4.6.2 --enable-languages=c,c++,fortran,go
make
make install
Reference: My AWS EC2 Instance: Ubuntu 16.04

"pkg-config script could not be found" on OSX

I am trying to install some software on my mac; however I keep receiving the same error:
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables XMEDCON_GLIB_CFLAGS
and XMEDCON_GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
I am not quite sure how to go about adding the pkg-config to the PATH. I have seen online (see link) that I should add the following:
Link showing how to direct PATH variable
export PATH=$PATH:/opt/local/bin # Fixed typo as mentioned in comment
which is where I have placed pkg-config. I still keep getting the error though every time I try to configure the files using ./configure. Any help would be super appreciated!
For Ubuntu/Debian OS,
apt-get install -y pkg-config
For Redhat/Yum OS,
yum install -y pkgconfig
For Archlinux OS,
pacman -S pkgconf
for me, (OSX) the problem was solved doing this:
brew install pkg-config
Answer to my question (after several Google searches) revealed the following:
$ curl https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz -o pkgconfig.tgz
$ tar -zxf pkgconfig.tgz && cd pkg-config-0.29
$ ./configure && make install
from the following link: Link showing above
Thanks to everyone for their comments, and sorry for my linux/OSX ignorance!
Doing this fixed my issues as mentioned above.
if you have this error :
configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.
Instead of do this command :
$ ./configure && make install
Do that :
./configure --with-internal-glib && make install
Try
which pkg-config
if it is empty then fire
brew install pkg-config
OR : ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
MacOS users
Unfortunately, pkg-config does not come with OS X by default. Here are some notes on how to compile from source. It assumes that you have Xcode installed.
Download and extract
curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xfz pkg-config-0.28.tar.gz
Configure and Install
cd pkg-config-0.28
setenv CC /usr/bin/cc (for tcsh)
export CC=/usr/bin/cc (for bash)
2a) If you have super-user powers
./configure --prefix=/usr/local CC=$CC --with-internal-glib
make
sudo make install
2b) if not
./configure --prefix=$HOME/someplace/in/my/path CC=$CC --with-internal-glib
make
make install
Source: https://opensource.ncsa.illinois.edu/confluence/display/DESDM/Installing+pkg-config+from+source+for+OSX

gcc on Lubuntu not working

I am trying to use the gcc on Lubuntu.
I have done the following installs but get the message "The program 'gcc' can be found in the following packages"
sudo apt-get install gcc
sudo apt-get install build-essential
What I am doing wrong, is there a way I can verify the gcc was correctly installed?
I bet its not in your path variable
env | grep path
If that doesn't work you need to add the location of gcc to your path environment variable by the looks of it.
To find gcc try:
find . -name gcc
Then to add to path
export PATH=$PATH:/path/to/gcc
echo $PATH;
If that fails, try this guide it may be an issue with your calls to apt-get https://askubuntu.com/questions/240919/how-to-install-gcc-4-7-on-lubuntu-11-10

Resources