Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Spaces in paths when using make

king_duckz
Beginner
2,811 Views

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
1 Solution
Judith_W_Intel
Employee
2,810 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

0 Kudos
9 Replies
aazue
New Contributor I
2,810 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
0 Kudos
king_duckz
Beginner
2,810 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.

0 Kudos
aazue
New Contributor I
2,810 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
0 Kudos
king_duckz
Beginner
2,810 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.
0 Kudos
king_duckz
Beginner
2,810 Views
- *bump* -
0 Kudos
Judith_W_Intel
Employee
2,811 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

0 Kudos
Brandon_H_Intel
Employee
2,810 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.
0 Kudos
Nirbheek_C_
Beginner
2,810 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'.

0 Kudos
Judith_W_Intel
Employee
2,810 Views

 

Nirbheek,

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

Judy

0 Kudos
Reply