Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.71k stars 1.04k forks source link

windows test #5624

Closed wyli closed 1 year ago

wyli commented 1 year ago

the windows test fails (due to some unrelated reason), @wyli can you take a look plz

C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\torch\include\pybind11\detail/common.h(152): warning C4005: 'HAVE_SNPRINTF': macro redefinition C:\hostedtoolcache\windows\Python\3.8.10\x64\include\pyerrors.h(315): note: see previous definition of 'HAVE_SNPRINTF' creating D:\a\MONAI\MONAI\build\lib.win-amd64-3.8 creating D:\a\MONAI\MONAI\build\lib.win-amd64-3.8\monai C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\torch\lib /LIBPATH:C:\hostedtoolcache\windows\Python\3.8.10\x64\libs /LIBPATH:C:\hostedtoolcache\windows\Python\3.8.10\x64\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib /EXPORT:PyInit__C D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\ext.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\filtering\bilateral\bilateral.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\filtering\bilateral\bilateralfilter_cpu.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\filtering\bilateral\bilateralfilter_cpu_phl.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\filtering\permutohedral\permutohedral.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\filtering\permutohedral\permutohedral_cpu.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\lltm\lltm_cpu.obj D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\resample\pushpull_cpu.obj /OUT:build\lib.win-amd64-3.8\monai\_C.pyd /IMPLIB:D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\_C.lib /openmp LINK : warning LNK4044: unrecognized option '/openmp'; ignored Creating library D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\_C.lib and object D:\a\MONAI\MONAI\build\temp.win-amd64-3.8\Release\a\MONAI\MONAI\monai\csrc\_C.exp ext.obj : error LNK2001: unresolved external symbol __imp___tls_offset_?init@?1??lazy_init_num_threads@internal@at@@YAXXZ@4_NA ext.obj : error LNK2001: unresolved external symbol __imp___tls_index_?init@?1??lazy_init_num_threads@internal@at@@YAXXZ@4_NA build\lib.win-amd64-3.8\monai\_C.pyd : fatal error LNK1120: 2 unresolved externals error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120 Error: Process completed with exit code 1.

Originally posted by @myron in https://github.com/Project-MONAI/MONAI/issues/5606#issuecomment-1333027230

wyli commented 1 year ago

probably related to this https://github.com/pytorch/pytorch/issues/88835 https://developercommunity.visualstudio.com/t/thread_local-causing-fatal-error-LNK1161/10199441

current workaround https://github.com/Project-MONAI/MONAI/pull/5606/commits/29a34ad830976cf51d69a777a83ec0798e7a6dca