Related
This is my makefile:
all:ll
ll:ll.c
gcc -c -Wall -Werror -02 c.c ll.c -o ll $# $<
clean :
\rm -fr ll
When I try to make clean or make make, I get this error:
:makefile:4: *** missing separator. Stop.
How can I fix it?
make defines a tab is required to start each recipe. All actions of every rule are identified by tabs. If you prefer to prefix your recipes with a character other than tab, you can set the .RECIPEPREFIX variable to an alternate character.
To check, I use the command cat -e -t -v makefile_name.
It shows the presence of tabs with ^I and line endings with $. Both are vital to ensure that dependencies end properly and tabs mark the action for the rules so that they are easily identifiable to the make utility.
Example:
Kaizen ~/so_test $ cat -e -t -v mk.t
all:ll$ ## here the $ is end of line ...
$
ll:ll.c $
^Igcc -c -Wall -Werror -02 c.c ll.c -o ll $# $<$
## the ^I above means a tab was there before the action part, so this line is ok .
$
clean :$
\rm -fr ll$
## see here there is no ^I which means , tab is not present ....
## in this case you need to open the file again and edit/ensure a tab
## starts the action part
On VS Code, just click the "Space: 4" on the downright corner and change it to tab when editing your Makefile.
By default, you should always write command after a Tab and not white space. This can be changed to another character with .RECIPEPREFIX variable.
This applies to gcc line (line #4) in your case. You need to insert tab before gcc.
Also replace \rm -fr ll with rm -fr ll. Insert tabs before this command too.
The solution for PyCharm would be to install a Makefile support plugin:
Open Preferences (cmd + ,)
Go to Plugins -> Marketplace
Search for Makefile support, install and restart the IDE.
This should fix the problem and provide a syntax for a makefile.
TLDR;
makefile syntax can be quirky
if you want a line of code to be interpreted as make code it must only be indented with spaces.
if you want a line of code to be interpreted as bash code it must only be indented with tabs
sometask:
ifeq ($FOO,bar) // this is make code. only spaces
echo "foobar" // this is bash code. only tabs
endif // again, this is make code. only spaces
technically its the leading indentation that dictates the interpreter.
Using .editorconfig to fix the tabs automagically:
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
Its pretty old question but still I would like say about one more option using vi/vim editor to visualize the tabs. If you have vi/vim installed then open a Makefile (e.g. vim Makefile) and enter :set list. This will show number of tabs inserted as below,
%-linux: force$
^I#if [ "$(GCC_VERSION)" = "2.96" ] ; then \$
^I^Iecho ===== Generating build tree for legacy $# architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $# legacy; \$
^Ielse \$
^I^Iecho ===== Generating build tree for $# architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $#; \$
^Ifi$
^Icd build-$#;make$
You started line 4 with "space,space" instead of "tab" - nothing else.
When you created a Makefile in VSCode, You should set the Tab Size: 4.
If anyone of you are using a product from Intellij, the solution for this it's the following:
Go to Preferences > Editor > Code Style
here you need to select the file type related to your problem. But most probably you need to select Other File Types.
In the tab opened mark the checkbox for Use tab character and be careful, Tab size and Indent values must be 4.
The key point was "HARD TAB"
Check whether you used TAB instead of whitespace
Check your .vimrc for set tabstop=X
If you are using mcedit for makefile edit. you have to see the following mark.
This is because tab is replaced by spaces.
To disable this feature go to
gedit->edit->preferences->editor
and remove check for
"replace tab with space"
If you are here searching how to make the tabs and new lines you added understandable by vim you have to first enable tab in vim.
You can do it using :set noet i.e. (to switch from spaces to TAB) before you make your tab additions.
With this command your tabs will look like the other ones (i.e. ^I) and *** missing separator. Stop. error from make will go away :)
after you make changes you can switch back with :set et
Do yourself a favour and make this a permanent member of your .editorconfig, if your editor/IDE supports it (it probably does!)
[Makefile]
indent_style = tab
If you are editing your Makefile in eclipse:
Windows-> Preferences->General->Editor->Text Editors->Show Whitespace Characters -> Apply
Or use the shortcut shown below.
Tab will be represented by gray ">>" and Space will be represented by gray "." as in figure below.
If someone ever comes across this issue with
*** missing separator. Stop.
during the build, they should double-check their file system path to the sources, it should not contain special characters like "#"
e.g. path
/home/user/#my_sources/
might be invalid
This is my makefile:
all:ll
ll:ll.c
gcc -c -Wall -Werror -02 c.c ll.c -o ll $# $<
clean :
\rm -fr ll
When I try to make clean or make make, I get this error:
:makefile:4: *** missing separator. Stop.
How can I fix it?
make defines a tab is required to start each recipe. All actions of every rule are identified by tabs. If you prefer to prefix your recipes with a character other than tab, you can set the .RECIPEPREFIX variable to an alternate character.
To check, I use the command cat -e -t -v makefile_name.
It shows the presence of tabs with ^I and line endings with $. Both are vital to ensure that dependencies end properly and tabs mark the action for the rules so that they are easily identifiable to the make utility.
Example:
Kaizen ~/so_test $ cat -e -t -v mk.t
all:ll$ ## here the $ is end of line ...
$
ll:ll.c $
^Igcc -c -Wall -Werror -02 c.c ll.c -o ll $# $<$
## the ^I above means a tab was there before the action part, so this line is ok .
$
clean :$
\rm -fr ll$
## see here there is no ^I which means , tab is not present ....
## in this case you need to open the file again and edit/ensure a tab
## starts the action part
On VS Code, just click the "Space: 4" on the downright corner and change it to tab when editing your Makefile.
By default, you should always write command after a Tab and not white space. This can be changed to another character with .RECIPEPREFIX variable.
This applies to gcc line (line #4) in your case. You need to insert tab before gcc.
Also replace \rm -fr ll with rm -fr ll. Insert tabs before this command too.
The solution for PyCharm would be to install a Makefile support plugin:
Open Preferences (cmd + ,)
Go to Plugins -> Marketplace
Search for Makefile support, install and restart the IDE.
This should fix the problem and provide a syntax for a makefile.
TLDR;
makefile syntax can be quirky
if you want a line of code to be interpreted as make code it must only be indented with spaces.
if you want a line of code to be interpreted as bash code it must only be indented with tabs
sometask:
ifeq ($FOO,bar) // this is make code. only spaces
echo "foobar" // this is bash code. only tabs
endif // again, this is make code. only spaces
technically its the leading indentation that dictates the interpreter.
Using .editorconfig to fix the tabs automagically:
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
Its pretty old question but still I would like say about one more option using vi/vim editor to visualize the tabs. If you have vi/vim installed then open a Makefile (e.g. vim Makefile) and enter :set list. This will show number of tabs inserted as below,
%-linux: force$
^I#if [ "$(GCC_VERSION)" = "2.96" ] ; then \$
^I^Iecho ===== Generating build tree for legacy $# architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $# legacy; \$
^Ielse \$
^I^Iecho ===== Generating build tree for $# architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $#; \$
^Ifi$
^Icd build-$#;make$
You started line 4 with "space,space" instead of "tab" - nothing else.
When you created a Makefile in VSCode, You should set the Tab Size: 4.
If anyone of you are using a product from Intellij, the solution for this it's the following:
Go to Preferences > Editor > Code Style
here you need to select the file type related to your problem. But most probably you need to select Other File Types.
In the tab opened mark the checkbox for Use tab character and be careful, Tab size and Indent values must be 4.
The key point was "HARD TAB"
Check whether you used TAB instead of whitespace
Check your .vimrc for set tabstop=X
If you are using mcedit for makefile edit. you have to see the following mark.
This is because tab is replaced by spaces.
To disable this feature go to
gedit->edit->preferences->editor
and remove check for
"replace tab with space"
If you are here searching how to make the tabs and new lines you added understandable by vim you have to first enable tab in vim.
You can do it using :set noet i.e. (to switch from spaces to TAB) before you make your tab additions.
With this command your tabs will look like the other ones (i.e. ^I) and *** missing separator. Stop. error from make will go away :)
after you make changes you can switch back with :set et
Do yourself a favour and make this a permanent member of your .editorconfig, if your editor/IDE supports it (it probably does!)
[Makefile]
indent_style = tab
If you are editing your Makefile in eclipse:
Windows-> Preferences->General->Editor->Text Editors->Show Whitespace Characters -> Apply
Or use the shortcut shown below.
Tab will be represented by gray ">>" and Space will be represented by gray "." as in figure below.
If someone ever comes across this issue with
*** missing separator. Stop.
during the build, they should double-check their file system path to the sources, it should not contain special characters like "#"
e.g. path
/home/user/#my_sources/
might be invalid
This is my makefile:
all:ll
ll:ll.c
gcc -c -Wall -Werror -02 c.c ll.c -o ll $# $<
clean :
\rm -fr ll
When I try to make clean or make make, I get this error:
:makefile:4: *** missing separator. Stop.
How can I fix it?
make defines a tab is required to start each recipe. All actions of every rule are identified by tabs. If you prefer to prefix your recipes with a character other than tab, you can set the .RECIPEPREFIX variable to an alternate character.
To check, I use the command cat -e -t -v makefile_name.
It shows the presence of tabs with ^I and line endings with $. Both are vital to ensure that dependencies end properly and tabs mark the action for the rules so that they are easily identifiable to the make utility.
Example:
Kaizen ~/so_test $ cat -e -t -v mk.t
all:ll$ ## here the $ is end of line ...
$
ll:ll.c $
^Igcc -c -Wall -Werror -02 c.c ll.c -o ll $# $<$
## the ^I above means a tab was there before the action part, so this line is ok .
$
clean :$
\rm -fr ll$
## see here there is no ^I which means , tab is not present ....
## in this case you need to open the file again and edit/ensure a tab
## starts the action part
On VS Code, just click the "Space: 4" on the downright corner and change it to tab when editing your Makefile.
By default, you should always write command after a Tab and not white space. This can be changed to another character with .RECIPEPREFIX variable.
This applies to gcc line (line #4) in your case. You need to insert tab before gcc.
Also replace \rm -fr ll with rm -fr ll. Insert tabs before this command too.
The solution for PyCharm would be to install a Makefile support plugin:
Open Preferences (cmd + ,)
Go to Plugins -> Marketplace
Search for Makefile support, install and restart the IDE.
This should fix the problem and provide a syntax for a makefile.
TLDR;
makefile syntax can be quirky
if you want a line of code to be interpreted as make code it must only be indented with spaces.
if you want a line of code to be interpreted as bash code it must only be indented with tabs
sometask:
ifeq ($FOO,bar) // this is make code. only spaces
echo "foobar" // this is bash code. only tabs
endif // again, this is make code. only spaces
technically its the leading indentation that dictates the interpreter.
Using .editorconfig to fix the tabs automagically:
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
Its pretty old question but still I would like say about one more option using vi/vim editor to visualize the tabs. If you have vi/vim installed then open a Makefile (e.g. vim Makefile) and enter :set list. This will show number of tabs inserted as below,
%-linux: force$
^I#if [ "$(GCC_VERSION)" = "2.96" ] ; then \$
^I^Iecho ===== Generating build tree for legacy $# architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $# legacy; \$
^Ielse \$
^I^Iecho ===== Generating build tree for $# architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $#; \$
^Ifi$
^Icd build-$#;make$
You started line 4 with "space,space" instead of "tab" - nothing else.
When you created a Makefile in VSCode, You should set the Tab Size: 4.
If anyone of you are using a product from Intellij, the solution for this it's the following:
Go to Preferences > Editor > Code Style
here you need to select the file type related to your problem. But most probably you need to select Other File Types.
In the tab opened mark the checkbox for Use tab character and be careful, Tab size and Indent values must be 4.
The key point was "HARD TAB"
Check whether you used TAB instead of whitespace
Check your .vimrc for set tabstop=X
If you are using mcedit for makefile edit. you have to see the following mark.
This is because tab is replaced by spaces.
To disable this feature go to
gedit->edit->preferences->editor
and remove check for
"replace tab with space"
If you are here searching how to make the tabs and new lines you added understandable by vim you have to first enable tab in vim.
You can do it using :set noet i.e. (to switch from spaces to TAB) before you make your tab additions.
With this command your tabs will look like the other ones (i.e. ^I) and *** missing separator. Stop. error from make will go away :)
after you make changes you can switch back with :set et
Do yourself a favour and make this a permanent member of your .editorconfig, if your editor/IDE supports it (it probably does!)
[Makefile]
indent_style = tab
If you are editing your Makefile in eclipse:
Windows-> Preferences->General->Editor->Text Editors->Show Whitespace Characters -> Apply
Or use the shortcut shown below.
Tab will be represented by gray ">>" and Space will be represented by gray "." as in figure below.
If someone ever comes across this issue with
*** missing separator. Stop.
during the build, they should double-check their file system path to the sources, it should not contain special characters like "#"
e.g. path
/home/user/#my_sources/
might be invalid
I'm trying to get BLAS working with in a FORTRAN 77 program, but so far I've been unsuccesful and I can't figure out how to get going with this. For reference I'm doing this under Ubuntu 12.10.
This is the code of the program I'm trying to compile:
program blastest
implicit none
include 'cblas_f77.h'
end
The file cblas_f77.h resides in /usr/include, and there are both libblas.a and libblas.so (and a bunch of other BLAS related files) in /usr/lib.
How do you configure this to work properly?
So far, I've tried the following:
Note: adding -lblas to either of the options make no difference at all...
Just f77, no options (didn't really expect this to work, but what the heck...):
$ f77 blastest.f -o blastest
MAIN blastest:
Cannot open file cblas_f77.h
/usr/bin/f77: aborting compilation
f77 with include option to find the header file. Now, instead it fails on (despite the file name) not being coded with FORTRAN 77 in mind, so the first six columns are nonempty...
$ f77 blastest.f -o blastest -I/usr/include
MAIN blastest:
Error on line 1 of /usr/include/cblas_f77.h: nondigit in statement label field "/* "
Error on line 2 of /usr/include/cblas_f77.h: labeled continuation line (starts " * cbl")
Error on line 3 of /usr/include/cblas_f77.h: labeled continuation line (starts " * Wri")
...
Full output: http://pastebin.com/eZBzh9N5
Switched to gfortran, to be more flexible with the spacing in the header file:
$ gfortran blastest.f -o blastest -I/usr/include
Warning: cblas_f77.h:9: Illegal preprocessor directive
Warning: cblas_f77.h:10: Illegal preprocessor directive
Warning: cblas_f77.h:12: Illegal preprocessor directive
...
Full output: http://pastebin.com/P71Di9pR
OK, so I guessed I need -cpp to get the preprocessor working. That gave exactly the same output as above. Also, if you keep reading you see that the full output, the compiler is still complaining about labelled continuation lines further down...
I believe that you are using the C library "cblas". I would recompile with this command:
gfortran blastest.f -o blastest -L/usr/lib -lblas
and this should sort it all out. I do not believe (though i am not sure) that you need to make use of the "include" statement.
When I build a C code using gcc, Makefile as below on a Ubuntu 10.04-x32 bit system, under bash shell. The gcc output message has some unwanted characters in the output message(see below: â).
test#dualboot-desktop:~/test/opencv$ make
cc -L/usr/local/lib -I/usr/local/include/opencv2 -lopencv_imgproc -lopencv_highgui -lopencv_video -lopencv_calib3d test1.c -o test_opencv
test1.c: In function âmainâ:
test1.c:13: error: too few arguments to function âcvLoadImageâ
test1.c:21: error: expected â;â before âcvMoveWindowâ
make: *** [test_opencv] Error 1
They jumble up the actual message sometimes and get pesky.
What is the cause of that? Anything wrong in my user settings on ubunti
How can I fix that?
If you set LC_LANG to something that ends in UTF8 but your terminal is having problems (or is not configured to handle) UTF8, then you run into trouble.
Either configure your terminal or set LC_LANG=en_GB.
Same problem with application "Terminal" under linux mint.
Solution:
Terminal (4th menu tab), zurücksetzen/reset, (2nd menu choice from below).
The annoying symbol was a single quote '.
To make it permanent, choose Einstellungen/Settings (2nd menu tab, last choice), then advanced, then Zeichensatz/Character set, change it to "UTF-8" (was some strange ISO, not even 8859-1, in my case)