Community
cancel
Showing results for 
Search instead for 
Did you mean: 
king_duckz
Beginner
1,015 Views

Spaces in paths when using make

Jump to solution

Hello, the project I'm working on has many source files placed in subdirectories containing spaces in their names. This cannot be changed, due to the many references to such names scattered everywhere. However, building with gcc works just fine.

The problem arises when make tries to build dependencies:

make -C '../../Code/System/CPP/SysCore' -f 'SysCore.mk'
make[2]: Entering directory `/home/developer/dev/v/CurrentProject/Code/System/CPP/SysCore'
make[2]: *** No rule to make target `../../../../System', needed by `../../../../../gen/Intermediate/COC/Linux/Release/SysCore/_AllCpp_auto_2.o'. Stop.
make[2]: Leaving directory `/home/developer/dev/v/CurrentProject/Code/System/CPP/SysCore'
make[1]: *** [SysCore] Error 2

The problem is that target../../../../System is not actually a target, it should rather be ../../../../System Code/CPP/Projects/Sequencing/MakeDeferredCaller.h

This appears exactly like that in _AllCpp_auto_2.d, but is mis-interpreted by make due to the unescaped space. We already signaled a similar problem to the clang dev team, and they already fixed this problem on their side. Assuming that this is an Intel Compiler issue, would it be possible to have a fix/workaround?

The same line, generated by gcc, reads:../../../../System\\ Code/CPP/Projects/Sequencing/MakeDeferredCaller.h

My compiler version:

icpc (ICC) 12.0.4 20110427
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.

Thanks!

0 Kudos

Accepted Solutions
Judith_W_Intel
Employee
1,014 Views

I think this has already been reported. Our bug tracking number is Quad 42115, CQ 31953.

Here is a description of the problem in our bug tracking system:

icc doesn't escape spaces in filenames when generating
dependency information. gcc does.
Example:
dep_test.cpp contains 1 line:
#include "Some File.h"

gcc -M dep_test.cpp
dep_test.o: dep_test.cpp Some\ File.h
icc -M dep_test.cpp
dep_test.o: dep_test.cpp Some File.h

This causes problems because "Some" and "File.h" are not valid make targets.

I will raise the priority of this one and try to get a fix into 12.1 ASAP.

thanks (and sorry for the inconvenience).
Judy

View solution in original post

9 Replies
aazue
New Contributor I
1,014 Views
Hi
I know Unix side
all problem of name folders or files have space could be replaced by the characters ?
example my file replaced by my?file etc ....
Regards
king_duckz
Beginner
1,014 Views

Hello, thanks for your reply. Unfortunately .d files are compiler-generated, so there is nothing much I can do. One option could be post-processing .d files, but there may be spaces that must remain unescaped, so a trivial replace wouldn't be appopriate. Writing such a tool would be a much greater effort than just fix the problem in icc/icpc.

aazue
New Contributor I
1,014 Views
Hi
To take hand perfectly your result all makefiles you must use utility
same automake,autoconf,autogen,m4 etc... for regenerate appropriated with one level is more bottom
sometimes you have not other choice maybe excepted if you write manually this task.
Unfortunately i am also ,often confronted this type problem never easy.
Good luck ...
Regards
king_duckz
Beginner
1,014 Views
Hello bustaf, I'm sorry but I don't quite understand what you're saying.
Our makefiles are already generated by some other tool (internally developed), but the problem really is in .d files, which are compiler-generated, so this at a later time in the build process. As I said, the same makefiles work with gcc and, since when they fixed this problem on their side, with clang (both compilers put escaped spaces in their .d files).
I don't understand if you imply some workaround to get around this, but I don't really want to tweak makefile generation and risk to break other compilers. I feel this is an issue within the compiler, and should be fixed by Intel. Infact, I would really appreciate some feedback from someone in the staff.
king_duckz
Beginner
1,014 Views
- *bump* -
Judith_W_Intel
Employee
1,015 Views

I think this has already been reported. Our bug tracking number is Quad 42115, CQ 31953.

Here is a description of the problem in our bug tracking system:

icc doesn't escape spaces in filenames when generating
dependency information. gcc does.
Example:
dep_test.cpp contains 1 line:
#include "Some File.h"

gcc -M dep_test.cpp
dep_test.o: dep_test.cpp Some\ File.h
icc -M dep_test.cpp
dep_test.o: dep_test.cpp Some File.h

This causes problems because "Some" and "File.h" are not valid make targets.

I will raise the priority of this one and try to get a fix into 12.1 ASAP.

thanks (and sorry for the inconvenience).
Judy

View solution in original post

Brandon_H_Intel
Employee
1,014 Views
This fix is available in the C++ Composer XE 2011 update 7 and above. Let us know if you have any questoins or further problems.
Nirbheek_C_
Beginner
1,014 Views

The source-file (dependency) side is fixed, but the generated-file side of the rule is still broken w.r.t. spaces:

$ icc -MMD -MF 'main .c.o.d' -o 'main .c.o' -c 'main .c'

$ cat 'main .c.o.d'

main .c.o: main\ .c

As you can see, 'main .c' is quoted, but the output 'main .c.o' is not, which means that it will be read as two files: 'main' and '.c.o'.

Judith_W_Intel
Employee
1,014 Views

 

Nirbheek,

Thanks for reporting this. I have opened a new bug report (DPD200416849) for this problem.

Judy