I'm trying to install libssh-0.8.5 onto Ubuntu 16.04 using the instructions from the install.readme provided. I follow every step as stated, but I get an error after executing the make command to build the project. The error is as follows:
[ 65%] Built target exec
tests/CMakeFiles/ssh_ping.dir/flags.make:8: *** target pattern contains no '%'. Stop.
CMakeFiles/Makefile2:1696: recipe for target 'tests/CMakeFiles/ssh_ping.dir/all' failed
make[1 ]: *** [tests/CMakeFiles/ssh_ping.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I have researched and seen that it could be a syntax error somewhere in my make file that is preventing the build to continue. I have looked at the target make file giving the problem, but cant seem to identify what is causing the error.
The flag.make file is as follows:
The problem seems to be coming from the highlighted bold line. Can anyone see what I am missing?
On StackOverflow (and most other similar sites), please cut and paste text into your questions and format them using the proper markdown facilities, rather than attaching images containing text. The latter is difficult to read and we can't cut and paste it into our answer to show where things are going wrong.
You cannot embed newlines in quoted strings, in makefiles. Make is completely line-oriented and does not parse quotes at all. So to make this:
FOO = "bar
biz"
is not considered one line assigning a value containing a newline to a variable FOO. Instead, it's considered two lines, the first of which is assigning the value "bar to variable FOO and the second of which is a syntax error since make can't parse the string baz" as a valid command.
Apparently ssh wasn't installed properly on your platform, while cmake relies on it. I am a bit surprised that cmake itself did not raise an error when generating flag.make but as I don't use cmake I do not know whether it is its normal behaviour or not.
Anyway, when cmake tried to detect your version of OpenSSH it did it by running ssh and got an error message instead of the version number it wanted. This error message got inserted in the generated flag.make Makefile. Because the second line of this error message (I could copy-paste it here if it was not in a picture in your question) has the:
a: b: c
form, make tried to interpret it as a static pattern rule but as it contains no % wildcard character, make raised a syntax error.
What happens if you try to run /usr/bin/ssh -V on the command line?
Related
Summary
I want to manually add syntax highlighting of specific words in error messages. I tried with a pipeline to awk, but this doesn't seem to work with the entire message that is thrown by make. Can anybody help me to get the following pipeline working for make's entire error message?
make | awk '{for(i=1;i<=NF;i++){ if($i~/error/ || $i~/Built/) $i=sprintf("\033[0;36m %s \033[0;00m",$i)}; print}'
Or maybe—better still—a different approach to my
Situation (in detail)
To build my latex project, I use Cmake together with UseLATEX (github page). That way, I can simply render my document by executing make from inside a build folder. Only problem: There is no syntax highlighting for the wall of text of an error message. I need to add a minimal version of this, to work productively. (Maybe words could be highlighted globally in my terminal?)
By passing the output in a pipeline to awk (manpage)—inspired by this askubuntu post—I was able to highlight make's success message, pdflatex myfile.tex's success and error message, but not make's error message, it did not highlight the interesting parts of the long message.
By highlighting Built in the code snippet above, one can see that it does highlight when the first command make succeeds.
The problem is that I do not fully understand when the pipeline passes what. It seems that some output can get highlighted and some cannot.
Thanks for any help!
Steps needed to reproduce
To get into exactly the situation at hand, you need a project folder containing
build/
cmake/
myfile.tex
CMakeLists.txt
with cmake/ containing UseLATEX.cmake
and CMakeLists.txt reading
include(cmake/UseLATEX.cmake)
ADD_LATEX_DOCUMENT(myfile.tex)
and myfile.tex being a valid or non-valid latex document, e.g.
\documentclass{article}
\begin{document}
Some \undefined command
\end{document}
From inside the build/ folder, call cmake .., and then make, or rather the full command above.
The message is written on stderr, not on stdout. You have to handle stderr. In bash, you can:
make 2> >(do_something_with_stderr >&2) | do_something_with_stdout
Because | changes buffering, it's not always wanted in interactive programs. For interactive I prefer:
make 2> >(do_something_with_stderr >&2) >(do_something_with_stdout)
and sometimes that's one function:
some_func() { do_something; }
make 2> >(some_func >&2) >(some_func)
I am trying to compile Tensorflow 2 c++ API on windows, using this guide: https://itnext.io/how-to-use-your-c-muscle-using-tensorflow-2-0-and-xcode-without-using-bazel-builds-9dc82d5e7f80
All dependencies where downloaded and installed.
When getting to the actual compilation command:
bazel build -c opt — verbose_failures //tensorflow:libtensorflow_cc.so
taken fro within the tensorflow root directory, i get the following Error:
Skipping 'ù': Bad target pattern 'ù': package names may contain A-Z, a-z, 0-9, or any of ' !"#$%&'()*+,-./;<=>?[]^_`{|}~' (most 7-bit ascii characters except 0-31, 127, ':', or '\')
A snippet of the Powershell input and output related to the issue
As seen in the snippet, The root directory does not contain any special characters.
I have searched the web for hours and couldn't find a solution.
Does anyone have a suggestion how to tackle this?
This is an error about the command line.
Maybe you accidentally entered invalid characters that confused Bazel. I do that sometimes if I jump left and right with Ctrl+Left / Ctrl+Right and accidentally hit a key inbetween.
Try typing the command again (do not copy-paste it), and running it.
Also, it is --verbose_failures (starting with two - characters), not - verbose_failures.
Trying to remove a file prefix using the method proposed in this thread:
Remove prefix with make
but even with a copy paste, I'm getting make's missing separator error.
FILE=/a/thing #line 16
$(FILE:a/%=%) #line 17
Makefile:17: *** missing separator. Stop.
When GNU Make processes the following:
FILE=a/thing
$(FILE:a/%=%)
The $(FILE:a/%=%) is evaluated to thing. That's the problem.
What you want is probably:
removed-prefix=$(FILE:a/%=%)
That is, create a variable removed-prefix whose expansion results in thing, or:
FILE:=$(FILE:a/%=%)
In an effort to make the .rst files more readable I started using substitutions instead of refs everywhere for common objects. For example :ref:user-story is now |user story|. The output is fine, but when a user mistypes a substitution we do not see any errors when we execute make livehtml like we do when we use :refs:. Is there a way to see undefined references like we do with ref's.
I've tried, with no success.
make livehtml -W
make livehtml -Wv
I do see errors like duplicate substitutions, but not unresolved substitutions.
Sphinx 1.4.6
Windows 10
Python 2.7.11
After some trial and error using -n for nit-picky mode displayed undefined substitution errors when building.
make livehtml -n
I am attempting to install rexec into Redhat Enterprise Release 4. Everytime I attempt to use the make command I get the following error.
Makefile:15: *** missing separator. Stop.
I have looked elsewhere on the net and line 15 of the Makefile has the below:
.include (I am unsure why but this website is blanking out what comes after .include, it is bsd.kmod.mk surrounded by <>)
I have used vi to make sure that space in the middle is a TAB and not 8 spaces, this does not resolve the issue. I have placed a TAB in front of the .include as I read somewhere there has to be a tab at the beginning, I then get a different error:
make: *** No rule to make target 'rexec.ko' , needed by 'load'. Stop.
I am unsure what else I'm supposed to do to get rexec installed, any clues?
Entire Makefile:
SRCS = rexec.c vnode_if.h
KMOD = rexec
KO = ${KMOD}.ko
KLDMOD = t
KLDLOAD = /sbin/kldload
KLDUNLOAD = /sbin/kldunload
load: ${KO}
${KLDLOAD} -v ./${KO}
unload: ${KO}
${KLDUNLOAD} -v -n ${KO}
.include (I am unsure why but this website is blanking out what comes after .include, it is bsd.kmod.mk surrounded by <>)
I believe the .include should be using spaces. Check out the last part of the Makefile. It should end like this:
unload: ${KO}
<tab>${KLDUNLOAD} -v -n ${KO}
.include <bsd.kmod.mk>
Where <tab> is an actual tab character. And that blank line better be blank; no tricksy whitespace on it.