compile flag to include non-standard headers with spaces in their directory/name structure

Hi,

Is anyone aware as to how correctly compile the following on Windows 10, x64 bit, command line:

c>nvcc -c tbb.cpp -I “c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\components\common\include” -I “c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\include” /I"c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\tbb\include"

c>nvcc fatal : Don’t know what to do with ‘C:/Ic:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.0.166/windows/tbb/include’

Now, with the second -I removed, it seems to process the first -I correctly, but naturally unable to find includes pointed to by the second -I:

c>nvcc -c tbb.cpp -I “c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\components\common\include”

tbb.cpp
c:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.0.166/windows/ipp/components/common/include\base_ipp.h(26): fatal error C1083: Cannot open include file: ‘ippcore.h’: No such file or directory

So it seems nvcc doesn’t support multiple -I with spaces in the directory/path/name?

It does, however, work using MSVC cl.exe:

cl /EHsc -c tbb.cpp /I"c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\components\common\include" /I"c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\include" /I"c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\tbb\include"

c>Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

tbb.cpp
TBB Warning: tbb/task_scheduler_init.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.

You’ve actually got 3 include switches. You could try using the same include switch syntax for all 3 and put at least one whitespace between each include switch:

c>nvcc -c tbb.cpp -I “c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\components\common\include” -I “c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\ipp\include” -I “c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.0.166\windows\tbb\include”

Hi,

Yes, that did it. NVCC doesn’t seem to support the /l flag. Actually, there are 4 include switches, but I gave up after the 3rd, as I hadn’t realized there was a /l in there!

Thank you for your help.
Ian