I want to install CD-HIT but 'make' command shows error.
I am running in cygwin (32 bits) so I installed 'make' with apt.cyg and it seems to be correctly installed. Also, I've added the path where CD-HIT are located to $PATH but I still get problems with 'make'.
Here you can see where CD-HIT files are located.
$ pwd
/home/Ale/cdhit-4.8.1
The path is in $PATH
$ $PATH
-bash: /home/Ale/cdhit-4.8.1:/home/Ale/cdhit-4.8.1:/usr/local/bin:/usr/bin:/cygdrive/c/Program: No such file or directory
When using make it shows this error.
$ make -f Makefile
g++ -fopenmp -DWITH_ZLIB -O2 cdhit-common.c++ -c
make: g++: No se encontró el programa
make: *** [Makefile:79: cdhit-common.o] Error 127
Related
I'm now compiling wxWidgets' hello world sample: https://docs.wxwidgets.org/trunk/overview_helloworld.html
using MingGW-w64 and it's mingw32-make on windows, and I'm using the pre-compiled Windows binaries it provides.
I have already compile successfully using
g++ -o hello -I/d/local/wxWidgets/lib/gcc810_x64_dll/mswu -I/d/local/wxWidgets/include -L/d/local/wxWidgets/lib/gcc810_x64_dll hello.cpp -lwxbase31u -lwxmsw31u_core
(I run this git-bash), and it can be execute normally too.
But when I copy the same line into makefile like this:
all: hello
hello: hello.cpp
g++ -o hello -I/d/local/wxWidgets/lib/gcc810_x64_dll/mswu -I/d/local/wxWidgets/include -L/d/local/wxWidgets/lib/gcc810_x64_dll hello.cpp -lwxbase31u -lwxmsw31u_core
and run with mingw32-make.exe in terminal, this error happened:
hello.cpp:3:10: fatal error: wx/wxprec.h: No such file or directory
#include <wx/wxprec.h>
^~~~~~~~~~~~~
compilation terminated.
mingw32-make: *** [makefile:3: hello] Error 1
I'm not sure if it's the including path problem, because It actually compile successfully when I run the same line in terminal directlty.
Are you also using the "git bash" terminal when you try with your Makefile ?
Regards
Xav'
After trying executing in cmd and git-bash a few times. I found it's probably the path style problem. I tried 2 cases of path specification below:
First:
g++ -o hello -I/d/local/wxWidgets/lib/gcc810_x64_dll/mswu -I/d/local/wxWidgets/include -L/d/local/wxWidgets/lib/gcc810_x64_dll hello.cpp -lwxbase31u -lwxmsw31u_core
Second:
g++ -o hello -ID:\local\wxWidgets\lib\gcc810_x64_dll\mswu -ID:\local\wxWidgets\include -LD:\local\wxWidgets\lib\gcc810_x64_dll hello.cpp -lwxbase31u -lwxmsw31u_core
Git-bash(execute in terminal directly): only first case successfully compiled.
Git-bash(using mingw32-make): only second case successfully compiled.
cmd(execute in terminal directly): only second case successfully compiled.
cmd(using mingw32-make): only second case successfully compiled.
Conclusion: I think mingw32-make using "traditional" Windows path style (backslash), even under git-bash.
Update:
I found that mingw32-make also support forword slash, so I can rewrite as:
g++ -o hello -ID:/local/wxWidgets/lib/gcc810_x64_dll/mswu ...
So I think it's better to use relative path in makefile, to prevent that (D:) in path, and also more portable(unix/linux use backslash too).
My environment:
I have recently installed MinGW and GNUWin32 on my Windows 10 pc.
I can compile with g++ successfully without using a make file.
With a makefile, make finds g++ to do compiles.
Problem:
My Clean rule is failing with:
make: /bin/sh: Command not found
make: *** [clean] Error 127
I edited my makefile to have only the following:
RM = C:\WFF\GNUWin32\bin\rm.exe
clean :
whoami
where rm
${RM} *.o *.exe
When I execute make, this is the result:
whoami
tilt
where rm
c:\WFF\GNUWin32\bin\rm.exe
C:\WFF\GNUWin32\bin\rm.exe *.o *.exe
make: /bin/sh: Command not found
make: *** [clean] Error 127
Observations:
whoami works
where works and finds rm.exe
but, through the macro substitution for ${RM}, rm.exe is not found
I tried both of the following with weird results:
executed the make file this way: make SHELL=cmd.exe
added this to the makefile: SHELL = C:\Windows\System32\cmd.exe
For each, make seems to
call cmd.exe
execute the comand whoami
and stops
I enter exit, and make continues
call cmd.exe
execute where rm
and stops
I enter exit, and make continues
etc.
If I enter exit too many times, the window is closed, which doesn't surprise me.
Question: any idea what I can do to debug this or solve it?
I'm trying to compile some C files on my Windows. (already tried to change permissions with chmod)
Here is the error i'm getting:
$ gcc -c hello.c hello.o
bash: /usr/bin/gcc: cannot execute binary file
I have checked, and this is my PATH on the environment variables:
C:\cygwin\bin;C:\cygwin\usr\local\bin
When I type only gcc i'm getting the same error, instead of getting a Missing arguments error.
the which command responds as:
$ which gcc
/usr/bin/gcc
So, i'm stuck here.
Any help?
Thanks!
I'm trying to install ncurses 5.9 on OS X 10.8 with GCC 4.9 installed. No errors or warnings show up when I run ./configure in the ncurses directory, but when I run make, I get gcc: error: unrecognized command line option ‘-no-cpp-precomp’. Upon googling the issue (and trying it out), I found that --no-cpp-precomp (with two dashes, i.e in long flag form) is a valid command.
I'm not sure what was prompting GCC to run the invalid command – whether it was make, or if it was a command specified in ncurses itself.
Is there any way to fix this? If so, how?
EDIT: I tried changing the reference in the ./configure file from -no-cpp-precomp to --no-cpp-precomp manually, using a text editor, and was met with this, despite GCC seemingly accepting the --no-cpp-precomp option. After that, I tried running autoreconf, and got this:
configure:6558: error: possibly undefined macro: AC_DIVERT_HELP
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /opt/local/bin/autoconf failed with exit status: 1
After running it with the m4_pattern_allow option:
autoreconf: 'configure.ac' or 'configure.in' is required
After running ./configure && make anyway:
cd man && make DESTDIR="" all
sh ./MKterminfo.sh ./terminfo.head ./../include/Caps ./terminfo.tail >terminfo.5
cd include && make DESTDIR="" all
cat curses.head >curses.h
AWK=gawk sh ./MKkey_defs.sh ./Caps >>curses.h
sh -c 'if test "chtype" = "cchar_t" ; then cat ./curses.wide >>curses.h ; fi'
cat ./curses.tail >>curses.h
gawk -f MKterm.h.awk ./Caps > term.h
sh ./edit_cfg.sh ../include/ncurses_cfg.h term.h
** edit: HAVE_TCGETATTR 1
** edit: HAVE_TERMIOS_H 1
** edit: HAVE_TERMIO_H 0
** edit: BROKEN_LINKER 0
cd ncurses && make DESTDIR="" all
gcc -o make_hash -DHAVE_CONFIG_H -I../ncurses -I. -I./../include -I../include -DUSE_BUILD_CC -DHAVE_CONFIG_H -I../ncurses -I. -D_DARWIN_C_SOURCE -DNDEBUG -I. -I../include -I/usr/local/include/ncurses -O2 --param max-inline-insns-single=1200 --no-cpp-precomp ./tinfo/make_hash.c -Wl,-search_paths_first
gcc: error: unrecognized command line option ‘--no-cpp-precomp’
make[1]: *** [make_hash] Error 1
make: *** [all] Error 2
It looks like this has been fixed in the latest patches to ncurses 5.9
The 5.9 source can be found here: ftp://invisible-island.net/ncurses/ncurses-5.9.tar.gz
The latest patches are here: ftp://invisible-island.net/ncurses/5.9/ but the latest rollup patch appears to have the fix: ftp://invisible-island.net/ncurses/5.9/patch-5.9-20130504.sh.gz
To apply the patch, get the 2 files above then:
$ tar xvf ncurses-5.9.tar.gz
$ cd ncurses-5.9
$ gzip -dc ../patch-5.9-20130504.sh.gz | sh
--no-cpp-precomp is an obsolete Apple GCC option it should generate a warnning not an error but if -Werror flag is passed to the compiler it will fail on warnings, either way, you will have to remove it manually from the build scripts and then run autoreconf or you could just remove it from the configure script directly.
I realize this is very old now, but since I'm running into the same issue (need to build on Mac Yosemite 10.10 with GCC 4.9), maybe it'll help someone else too. It looks like the configure script is detecting that it's a Mac and assuming clang is used, even though the 'gcc' from the PATH is GNU. Seems they fixed the detection logic in newer versions. I've found the same issue in Boost 1.37 and it was fixed (somewhere before) Boost 1.55.
I have:
fileMainProgram.cpp
fileClassImplementation.cpp
fileClass.h
makefile
in a directory.
Ran cmd and typed
g++ -make -f makefile
got this message after tinkering with it for a while (change file name/extension, tried without -f, used gcc instead of g++, etc)
C:\miscprograms\Dropbox\box\Dropbox\c++\etextbook\e12\progec12\pe1c12romanNumeral>g++ -make -f makefile
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe:makefile.tx
t: file format not recognized; treating as linker script
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe:makefile.tx
t:1: syntax error
collect2: ld returned 1 exit status
This is the makefile, (tried to delete the lines inbetween targets and actions, tried using automatic variables, etc,
I tried to compile the program as
g++ -c fileClassImplementation.cpp
then
g++ fileClassImplementation.o fileMain.cpp
to get an executable and it works fine.
all: a
a: romanNumeralMain.o romanNumeralImp.o
[1 tab]g++ romanNumeralMain.o romanNumeralImp.o -o a
romanNumeralMain.o: romanNumeralMain.cpp
g++ -c romanNumeralMain.cpp
romanNumeralImp.o: romanNumeralImp.cpp
g++ -c romanNumeralImp.cpp
clean:
rm romanNumeralImp.o romanNumeralMain.o a
Ran the whole thing on C4droid for my samsung phone and worked fine as is.
Doesn not work on my Windows7 laptop.
What you appear to have is a GNU Makefile, suitable for running GNU Make. Windows doesn't come with GNU Make, so you'll need to download it yourself.
It appears you've already downloaded MingW, try running the mingw32-make command to execute your makefile.