I am compiling an ancient program called SCOL (written in 1997) which comes pre-packged with OpinionFinder using gcc 3.4.5. I am using CentOS 5.5. After giving the make command, I get the following error:
/home/shahw/opinionfinder/software/scol1k/tools/tagfixes -c e8.fx
Wrote e8.fxc
/home/shahw/opinionfinder/software/scol1k/tools/tagfixes -c bnc.fx
Wrote bnc.fxc
env BIN=/home/shahw/scol//bin MAN=/home/shahw/scol//man LIB=/home/shahw/scol//lib ./mk.csh.rc
env: ./mk.csh.rc: No such file or directory
make[1]: *** [csh.rc] Error 127
make[1]: Leaving directory `/home/shahw/opinionfinder/software/scol1k/data'
make: *** [modules] Error 2
I have confirmation from a source that the program compiles fine with this version of gcc, however I am not able to track down other platform specific information. Could this be an os specific problem? Do I need to set some environment variable for this to work? Any hint would be greatly appreciated. Thanks.
It looks like you're using the wrong shell. You're probably using bash whereas the old makefile seems to be assuming csh or similar. Try changing your shell to csh and see if that helps.
It is not able to find the file mk.csh.rc. Try finding this file first, using find command, and then you can include the directory in which this file resides by changing the environment variable path using export command
Related
I have a very simple makefile that I'm trying to execute in git-bash on a Windows 10 machine.
The contents of the makefile are:
start:
source env.sh
Where env.sh is a local file that exists.
If I execute the command make start I receive the following error:
process_begin: CreateProcess(NULL, source env.sh, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:2: start] Error 2
However, if I execute source env.sh at the command prompt all is well and I receive no error at all.
I've seen other posts like this Windows 10 Makefile error make (e=2): The system cannot find the file specified which report a similar error, but the linked question is to do with docker being on the path which I don't think applies here.
Is there any reason why the makefile errors but typing the command does not?
On Windows by default, GNU make always runs the Windows cmd.exe shell. The recipe that you're running here is a bash command.
You say it works at the command prompt but that's because the command prompt you're using is from Git bash; if you opened a Windows terminal and typed that command it wouldn't work.
If you want to use a different shell than the default you need to set the SHELL make variable in your makefile:
SHELL := <path to git bash>
Been pulling out my hairs on this one, it must be so simple but for some reason I can't get it to work..
I'm using go1.15, on Ubuntu 18.04, trying to build lnd from source off of github.
I run sudo make install after all the preliminaries but keep getting error
GO111MODULE=on go install -v -tags="" -ldflags " -s -w -X github.com/lightningnetwork/lnd/build.Commit=v0.11.0-beta-199-g98da919bf1c421dd4a976506761e626e39384a8d -X github.com/lightningnetwork/lnd/build.CommitHash=98da919bf1c421dd4a976506761e626e39384a8d -X github.com/lightningnetwork/lnd/build.GoVersion= -X github.com/lightningnetwork/lnd/build.RawTags=" github.com/lightningnetwork/lnd/cmd/lnd
/bin/sh: 1: go: not found
Makefile:139: recipe for target 'install' failed
make: *** [install] Error 127
i have GOPATH=/usr/local/go and have added /usr/local/go/bin to my PATH variable
can't understand what i am doing wrong
go version returns normally
I'm an intermediate programmer, but been using Linux for many years and do not understand what is going on.
Just in case somebody finds this the answer is that the golang installation instructions say to update your PATH variable in ~/.profile but this only applies to interactive shells, not scripts. So if you want to properly update this for scripts you'll have to find another way. My quick fix was just inserting a PATH update into the script itself.
Link for solution is:
Bash script can't execute Go command
I get this error when trying to compile html-xml-utils-6.9 on DragonFly BSD. Funny thing is, when doing grep -r f77 in the source directory, the result is empty. So no such option is in the constructed Makefile after ./configure.
This is my configure output: http://pastebin.com/4tKEXQKG
I tried to do alias f77="gfortran48", but the problem remains. gfortran48 is an installed compiler, I've checked with man gfortran48.
My full error output:
/home/olle2/Downloads/html-xml-utils-6.9$ make
make all-am
f77 -O -c html.e
make[1]: exec(f77) failed (No such file or directory)
*** Error code 1
Stop.
make[1]: stopped in /home/olle2/Downloads/html-xml-utils-6.9
*** Error code 1
Stop.
make: stopped in /home/olle2/Downloads/html-xml-utils-6.9
Any ideas?
Related thread: make: f77: No such file or directory
Aliases aren't available to non-interactive shells generally so an alias isn't the right solution to this problem.
The default FC make variable is f77 so that is likely what is in use in the makefile. This also indicates your solution.
Try make FC=gfortran48 or similar.
Solved with this line:
./configure LDFLAGS="-L/usr/local/lib -liconv" && gmake && echo $?
(gmake instead of make gives saner error messages.)
Thanks to #dragonflybsd IRC channel!
I am trying to build the open source drivers for the c1000a to fix my router. However, I run into a weird issue:
$ make PROFILE=963268BGW
make version is 3.81
kernel version is 3.13.0-29-generic
shell is /bin/sh. Bash version is
***************************************************
ERROR: /bin/sh does not invoke bash shell
***************************************************
make: *** [prebuild_checks] Error 1
Can anyone explain what this might mean?
The answer is that someone wrote a script or Makefile which depends on /bin/sh being Bash, and went out of their way to write code to detect that this is the case, rather than to write code which finds the shell that is required to run the script, like /bin/bash or /usr/bin/bash.
It is easy to tell GNU Make what shell to use for executing build "recipes" (bodies of rules), namely the SHELL variable. The default is /bin/sh/ but if you put
SHELL = /usr/bin/bash # or whatever else
then GNU Make will use that.
I'd gut the Makefile of the logic which tests /bin/sh and bails out, and set up the SHELL variable to point to Bash.
This error might happen when you are doing compilation in Debian flavor distributions such as Ubuntu. Use the command below to compile:
$> make PROFILE=963268BGW SHELL=/bin/bash
I have the following simple makefile:
all:
fat_imgen.exe
Where fat_imgen.exe is an executable in the same directory as the makefile. When I try and run this however this happens:
>make
fat_imgen.exe
make: fat_imgen.exe: Command not found
make: *** [all] Error 127
If I run fat_imgen from that same command prompt then it starts as expected - why can't make find fat_imgen.exe?
This is all running under Mingw / Windows.
When using a simple commend like the name of an executable, GNU make will start the executable directly. If the directory where the executable is found is not in the PATH/path, make will fail.
If you put the directory in the path, your makefile should work normally.
Also, as suggested in a comment by #AlexFarber, by adding './' GNU make will assume a more complex command (since not all shells are created equal), and hand the command over to the configured shell. That will work, since the shell is created in the directory where the command is then found.