I am trying to build a PyTorch cpp/cuda extension library on Windows. This library makes use of CMake. I am getting the “nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified” error message.
As I understand, this error invariably comes because of invalid command line options. CMake apparently gets these options from the Caffe2Targets.cmake file in PyTorch distribution. I am reproducing what I believe are the relevant lines from that file.
set_target_properties(torch_cuda PROPERTIES INTERFACE_COMPILE_OPTIONS "/Z7;/EHa;/DNOMINMAX;/wd4267;/wd4251;/wd4522;/wd4522;/wd4838;/wd4305;/wd4244;/wd4190;/wd4101;/wd4996;/wd4275;/bigobj"
- First question: Cuda documentation specifies that the command options begin with “-” or “–”. But, all these begin with a “/”; is that the issue? Since PyTorch is widely used, I would be surprised if use of “/” is the cause though.
- Second question: When I searched for options like “Z7”, “EHa” etc. in cuda documentation, they did not even show up. Are they valid options at all? If not, I wonder why this file in PyTorch distribution lists them?
- Third question: Assuming they are indeed valid options, are they documented somewhere else? My real goal is to search that documentation to determine which of those listed options is not valid, and then delete it from the file to solve the “nvcc fatal” error I am currently getting.