MINGW64 "make build" error: "bash: make: command not found" - bash

I am working on Windows 10. I want to run a "make build" in MINGW64 but following error comes up:
$ make build
bash: make: command not found
I want to build Glide for Golang
I tried following:
$ sudo yum install build-essential
bash: sudo: command not found
As well as:
$ yum install build-essential
bash: yum: command not found
And:
$ apt-cyg build-essential
bash: apt-cyg: command not found
How can I "work-around" this problem?

Go to ezwinports, https://sourceforge.net/projects/ezwinports/files/
Download make-4.2.1-without-guile-w32-bin.zip (get the version
without guile)
Extract zip
Copy the contents to C:\ProgramFiles\Git\mingw64\ merging the folders, but do NOT overwrite/replace any exisiting files.

You can also use Chocolatey.
Having it installed, just run:
choco install make
When it finishes, it is installed and available in Git for Bash / MinGW.

You have to install mingw-get and after that you can run mingw-get install msys-make to have the command make available.
Here is a link for what you want http://www.mingw.org/wiki/getting_started

We can't use the 'make' command on windows and we don't get it preinstalled with MINGW. So to use it, you need to download it first. The steps are as follows-
Go to https://sourceforge.net/projects/mingw/postdownload and download it.
After the installation is over, go and check if bin folder is present in the directory of MINGW .
If everything works well till now, change the environment variables- go to settings of your laptop and type Environment variables. Go to it's section and click on 'environment variables' at the end.
On the section where 'path' is written, add a new file - the location of the bin file and save.
Install make by typing the following on mingw command line :
mingw-get install mingw32-make
Now make is installed. To use it in command line just write "mingw32-make" in place of "make".

Try using cmake itself.
In the build directory, run:
cmake --build .

Go to downloads of jmeubank.github.io/tdm/gcc : https://jmeubank.github.io/tdm-gcc/download/
Download 64+32-bit MinGW-w64 edition.
Run the .exe file.
Click on Remove if you have tdm-gcc already.
Then Click on Create to install tdm-gcc.
Complete the installation.
Add path to environment variable if not added automatically.
Now run mingw32-make on your terminal / command prompt.
Hope this works

You have to install make first. Run any of the below commands and it will work.
pip install make
OR
conda install make

Related

bash 3rdparty/osx/install_deps.sh?

I am trying to follow these installation instructions:
https://www.thomasvanhoey.com/post/installing-openpose-on-mac-october-2020-version/
for installing OpenPose on Mac.
I have a Mac M1, running Big Sir. When I try to do step 3, and run this in terminal: (I'm in the openpose folder that was created when I installed CMake, where there is a 3rdparty folder)
bash 3rdparty/osx/install_deps.sh
I get:
No such file or directory
also step 4 doesn't work, i run this in the command line in terminal:
~~protoc src/caffe/proto/caffe.proto --cpp_out=. mkdir include/caffe/proto mv src/caffe/proto/caffe.pb.h include/caffe/proto~~
I get
zsh: command not found: ~~protoc
Does anyone know why I am getting these errors? I "Cloned the repository in the target folder". I "Install CMake GUI" the old fashioned way. I ran and it installed.
brew install caffe
Thnx
Replace with: bash scripts/osx/install_deps.sh
The file to be executed is install_deps.sh. When I perform $ find . -name osx it is found in openpose/scripts/. So just run bash scripts/osx/install_deps.sh.

Can't install apertium language packages from source - make command shows errors

I am trying to install apertium-eng-ita package from source (available at https://github.com/apertium/apertium-eng-ita). The system is debian 11 (i tried also on fresh ubuntu, get the same error). So i downloaded all the files into my /root directory (/root/eng-ita contents all the files from provided link) and run:
./autogen.sh
This generated all the necessary files inside the "eng-ita" folder, including "Makefile". But then i run:
make
and see errors like:
apertium-validate-dictionary apertium-eng-ita.eng-ita.dix /bin/bash:
apertium-validate-dictionary: command not found make: ***
[Makefile:769: eng-ita.autobil.bin] Error 127
I began googling (for example, here is some info - https://wiki.apertium.org/wiki/Installation_troubleshooting) this 127 error and found some information about PATH, but where i can put this PATH to make it work?
If you're installing from source, you should first add the apt source and install apertium-all-dev which will give you make etc. Cf. https://wiki.apertium.org/wiki/Prerequisites_for_Debian you should
curl -sS https://apertium.projectjj.com/apt/install-nightly.sh | sudo bash
sudo apt-get -f install locales build-essential automake subversion git pkg-config \
gawk libtool apertium-all-dev
(But you don't need to install from source if you just want to use the pair and not develop for it. There are nightly debian packages of the latest git commit; after running the first command you can get that package with sudo apt install apertium-eng-ita)

Why doesn't zsh recognize command from globally installed npm package?

After installing oh-my-zsh and reinstalling node and npm again, I install npm-check-updates globally and try to call 'ncu' (the npm-check-updates command). However, I get an error: zsh:
command not found: ncu. Does anyone know how to fix this?
I have corrected this problem with the following instructions:
sudo npm install -g npm-check-updates
Make sure the 'ncu' package can be found in the $PATH environment variable. Try this, to find where 'ncu' is supposed to be installed:
which ncu
If it still gives you trouble, try to see if it's in /usr/bin, $HOME/npm/bin, /usr/local/lib or /usr/sbin, and check that your $PATH environment variable contains a way to 'ncu'. Your $PATH environment variable, which can be found in
$HOME/.bashrc (Linux)
$HOME/.bash_profile (MacOS)
should look something like this:
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/npm/bin
After an install you can run rehash so zsh will analyse what new executables are available on $PATH.
Not sure if that would fix the problem, I know it fixes the missing tab completion entry after install.
FYI I am using a OSX.
The problem was that my export path in my .zshrc was wrong.
This was what it was previously:
export PATH=$HOME/bin:/usr/local/bin:$PATH.
Notice there is nothing pointing at npm or any of the packages I installed globally.
For anyone who has this problem in the future...
Ensure that npm is installed and that you can still run npm commands (if not uninstall then install npm). Then run npm -g list --depth 0 to list all your global packages.
Go into your home folder and press ⌘+Shift+. (shows all hidden files/folders), there should be a .npm folder there, ensure the packages in the list you obtained in the previous step matches what's in the bin folder.
Edit your export PATH string accordingly:
export PATH=$HOME/bin:/usr/local/bin:**$HOME/.npm/bin**:$PATH.
This worked for me!

exec: "gcc": executable file not found in %PATH% when trying go build

I am using Windows 10. When I tried to build Chaincode it reported this error
# github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
exec: "gcc": executable file not found in %PATH%
My chaincode imports:
import (
"fmt"
"strconv"
"github.com/hyperledger/fabric/core/chaincode/shim"
pb "github.com/hyperledger/fabric/protos/peer"
)
It's running fine in Docker.
gcc (the GNU Compiler Collection) provides a C compiler. On Windows, install TDM-GCC. The github.com/miekg/pkcs11 package uses cgo. Cgo enables the creation of Go packages that call C code.
If you are running Ubuntu do:
apt-get install build-essential
This solved the problem. It installs the gcc/g++ compilers and libraries.
I also encountered this message, but in my case, it was missing gcc.exe. I used choco and installed mingw, and then it worked.
details:
download choco
choco install mingw -y
check: gcc -v
1) Install .exe from > https://sourceforge.net/projects/mingw-w64/
1.2) ! use x86_64 architecture
2) Add C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin to PATH in User Variables and in System Variables. For me it works.
! To edit Path variable press Windows key, type 'path', choose 'Edit the system environment variables', click 'Environment Variables', find Path variable in System variables and in User variables then edit.
On Windows install http://tdm-gcc.tdragon.net/download, that is all.
If you are using an alpine based image with your Dockerfile
Install build-base which will be met with your requirements.
apk add build-base
$ go env
check CGO_ENABLED if its 1 change it to 0 by
$export CGO_ENABLED=0
For my case :
os: windows 10
command:
choco install mingw
install choco if not installed:
Link: https://www.liquidweb.com/kb/how-to-install-chocolatey-on-windows/
worked for me.
The proper explanations why go build does not work for hyperledger in Windows environment are given as other answers.
For your compilation purposes, just to make it work without installing anything extra, you can try the following
go build --tags nopkcs11
It worked for me. I hope same works for you too.
You can try - this is not a solution but a temp workaround
cgo_enabled=0 go build
Once you install gcc - and make sure %PATH has a way to find it (gcc.exe) - this should go away.
Also running this one will ensure the cgo_enabled variable will stay this way as long as terminal is open. That way you don't have to prefix it each time you do a build.
export cgo_enabled=0 go build
just followed instructions from following and it solve my issue
https://code.visualstudio.com/docs/cpp/config-mingw
it ask to install Mingw-w64 via MSYS2
important command is pacman -S --needed base-devel mingw-w64-x86_64-toolchain
then add C:\msys64\mingw64\bin to PATH
thanks
For Ubuntu, what worked for me was to simply run:
sudo apt install gcc
On Amazon Linux 2:
Install go
wget https://go.dev/dl/go1.18.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
Install gcc
sudo yum groupinstall "Development Tools"
I recommend using the package group, even though it can be done without it, because groupinstall gives you the necessary packages to compile software on Amazon Linux and Redhat, CentOS for that matter.
on Ubuntu its very easy but on windows need to do it:
download MinGW on http://www.mingw.org/
install on basic package Gcc-g++ (see this image)
add on environment Patch of windows variables.
restart and continue with "go get ..."
If you are running Ubuntu do:
sudo apt-get update
sudo apt-get install build-essential.
If the above commands do not work do:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe"
The main component contains applications that are free software, can be freely redistributed and are fully supported by the Ubuntu team. & The universe component is a snapshot of the free, open-source, and Linux world.
Then install package by following command in terminal:
sudo apt-get update
sudo apt-get install build-essential.
For more info click here: https://itectec.com/ubuntu/ubuntu-problem-installing-build-essential-on-14-04-1-lts-duplicate/
Just add this to your Dockerfile
RUN apk add alpine-sdk
gcc should not be necessary, unless you are cross compiling for a non-windows platform, or use cgo.
If you still need gcc, however, you should install MinGW, which provides a gcc port for Windows (Cygwin and msys should also work, although I have never actually tested this).
Edit: I see from your error message now, that it is a dependency that requires gcc. If you didn't already know this, gcc is a c/c++ compiler, and in this case it is probably needed to compile c source files included by a dependency or sub-dependency.
Instruction to fix the "exec: “gcc”: executable file not found in %PATH%" error with MSYS2:
Download MSYS2.
Put MSYS2 folder into your $PATH.
Start the MSYS2 command line program.
Run this command: pacman -S gcc.
Kindly install the MINGW after GUI will automatically take.
http://mingw.org/wiki/Getting_Started
On Windows, you can install gcc by Scoop:
scoop install gcc
you need to download MingGW64
put MingGW64 folder into your $PATH
run go build xxx.go (with cgo library)
Hi jaswanth the main problem is that you haven't register your %GO_HOME%\pkg\tool\windows_amd64 to yuour Environment Path.
%GO_HOME% is the repository where you install your go at the first time.
same as other, just install tdm-gcc, but you can use its terminal, "MinGW", you can access it from start menu folder tdm-gcc, after start, browse to your project, and run it again
I'm a Windows user and I downloaded tdm-gcc (MinGW-w64 based) from the link below:
https://jmeubank.github.io/tdm-gcc/
After installation, it made a folder named "TDM-GCC-64".
I added "C:\TDM-GCC-64\bin" to my PATH, And it fixed my problem.

How to install missing function package of Octave in Mac?

I try to install the symbolic package for the Octave in the Mac, https://octave.sourceforge.io/symbolic/index.html, which path should be set?
More fundamental problem is that I follow the commands suggested by https://octave.sourceforge.io/ to install the symbolic package described as above, but the "pkg install" is always shown "pkg: command not found" in the command line. How to deal with it?
I had a similar problem and resolved it by using "pkg -forge install symbolic", which installs from the forge central repository.
I guess you entered the pgk install command in the osx shell. It has to be issued in octave. Start octave first, then run pgk install symbolic in octave´s command line.
To see installed package list user pkg list command.

Resources