dvlab-research / PointGroup

PointGroup: Dual-Set Point Grouping for 3D Instance Segmentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Link error while building pointgroup_ops library

victoryc opened this issue · comments

After crossing a few hurdles, I have reached a stage on Windows where all the three files listed in setup.py are compiling fine. Now, only the following link error remains. @llijiang or others: Any idea about the cause/fix for this?
Thanks!

Creating library build\temp.win-amd64-3.7\Release\src\PG_OP.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\src\PG_OP.cp37-win_amd64.exp
pointgroup_ops.obj : error LNK2001: unresolved external symbol "public: long * __cdecl at::Tensor::data_ptr<long>(void)const " (??$data_ptr@J@Tensor@at@@QEBAPEAJXZ)
build\lib.win-amd64-3.7\PG_OP.cp37-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals

For the benefit of others running into this: Thanks to a poster on NVidia CUDA developers forum, I was able to solve the mysterious link error. The cause of the link error is the usage of "long" type which happens to be taken to be 32-bit wide on Windows 64 bit machines while it is taken to be 64 bit wide on Linux 64 bit machines. Replacing all occurrences of "long" in the code by "int64_t" got rid of the link error. As mentioned by that knowledgeable poster on the CUDA forum, it is a really bad idea to use "long" in code meant to be cross-platform.