multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

Command line warning D9002 : ignoring unknown option '-fPIC' #91

Open Gaelic98 opened 4 years ago

Gaelic98 commented 4 years ago

Hello All,

I've been attempting to install the code to perform some segmentation on some images we have as part of another project which uses pytorch and we hope to keep the code base consistent.

However, we are running into some issues with regards to installation.

Specifically we are struggling with the section:

 cd nms/src/cuda/
 nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
 cd ../../
 python build.py
 cd ../

 cd roialign/roi_align/src/cuda/
 nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
 cd ../../
 python build.py
 cd ../../

We have the correct arch and our cl.exe has been added to the file path. However, we encounter the errors:

nms_kernel.cu
cl : Command line warning D9002 : ignoring unknown option '-fPIC'
nms_kernel.cu
cl : Command line warning D9002 : ignoring unknown option '-fPIC'
nms_kernel.cu
cl : Command line warning D9002 : ignoring unknown option '-fPIC'

when attempting to run:

F:\Code\pytorch-mask-rcnn\nms\src\cuda>nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_61

We are using Windows 10 as our os with Visual Studio 2017.

Many Thanks in advance for any advice available.

wangyifantech commented 4 years ago

The -fPIC is the compile option of the gcc compiler. But the compiler you are using is cl.exe, since you are using the Visual Studio.

The cl.exe does not have the compile option -fPIC. So I think you need change the compiler to gcc, or find similar compile option of -fPIC (position-independent code) in cl.exe. But I think the best way is switching the environment to Linux.

If you can figure this out on Windows, please tell me, thank you.

Best, Yifan

Stephanie-ustc commented 4 years ago

Have you solved this problem?

Stephanie-ustc commented 4 years ago

If you can figure this out on Windows, could you share this, thank you.

oguzcanbekar commented 3 years ago

Is there any development about this problem? Do I have to use Linux?