nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

wrong reason

I want to compile colmap3.8 with VS, so use cmake+ vcpkgto configure the VS2022 project. When compiling colmap_cuda, you need to use the nvcc compiler to compile the gpu code.
When compiling with NVCC, options appear in the command line /Zc:__cplusplus, as shown in the figure below:
insert image description here
and it cannot be recognized by nvcc, so an error is reported:

nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

Solution

Move /Zc:__cplusplusthe options into -Xcompiler=the string that follows, as shown in the image below:
insert image description here

Further reading, about /Zc:__cplusplusoptions

official document

Description of cufftdx

Compiling using MSVC as CUDA host compiler requires enabling __cplusplus (/Zc:__cplusplus). In order to do so, pass -Xcompiler “/Zc:__cplusplus” as an option to NVCC. Failing to do so may result in errors reporting that a variable of class dim3 can’t be declared constexpr.

Guess you like

Origin blog.csdn.net/qq_42679415/article/details/129477793