While trying to build a Facebook provided PyTorch extension on Windows, I see syntax errors related to PyTorch header code such as the following. Are there some standard set of flags that need to be passed to the “cl” compiler on Windows to not get these errors? Otherwise, I wonder how any PyTorch extension would build on Windows since these are common headers.
Thanks!
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(98): error C2990: 'c10::Dict': non-class template has already been declared as a class template
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(13): note: see declaration of 'c10::Dict'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(99): note: see reference to class template instantiation 'c10::impl::DictEntryRef<Key,Value,Iterator>' being compiled
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(98): error C2059: syntax error: '<'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(98): error C2238: unexpected token(s) preceding ';'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(177): error C2990: 'c10::Dict': non-class template has already been declared as a class template
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(13): note: see declaration of 'c10::Dict'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(178): note: see reference to class template instantiation 'c10::impl::DictIterator<Key,Value,Iterator>' being compiled
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/Dict.h(177): error C2059: syntax error: '<'
...
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(76): error C2990: 'c10::List': non-class template has already been declared as a class template
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(16): note: see declaration of 'c10::List'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(80): note: see reference to class template instantiation 'c10::impl::ListElementReference<T,Iterator>' being compiled
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(76): error C2059: syntax error: '<'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(76): error C2238: unexpected token(s) preceding ';'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(177): error C2990: 'c10::List': non-class template has already been declared as a class template
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(16): note: see declaration of 'c10::List'
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(178): note: see reference to class template instantiation 'c10::impl::ListIterator<T,Iterator>' being compiled
pathToCondaEnv\lib\site-packages\torch\include\ATen/core/List.h(177): error C2059: syntax error: '<'