Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Command line error D8021 : invalid numeric argument '/Wno-cpp' #552

Closed
aw236 opened this issue Jul 10, 2018 · 3 comments
Closed

Command line error D8021 : invalid numeric argument '/Wno-cpp' #552

aw236 opened this issue Jul 10, 2018 · 3 comments

Comments

@aw236
Copy link

aw236 commented Jul 10, 2018

I am trying to install Detectron on my Windows 10 PC with a GTX 1070.

I followed the directions.

DETECTRON=/path/to/clone/detectron

  1. git clone https://github.com/facebookresearch/detectron $DETECTRON
  2. pip install -r $DETECTRON/requirements.txt
  3. cd $DETECTRON && make

on the make step, I get the following error:

C:\Users\andcy\$DETECTRON>make
python setup.py develop --user
running develop
running egg_info
writing Detectron.egg-info\PKG-INFO
writing top-level names to Detectron.egg-info\top_level.txt
writing dependency_links to Detectron.egg-info\dependency_links.txt
reading manifest file 'Detectron.egg-info\SOURCES.txt'
writing manifest file 'Detectron.egg-info\SOURCES.txt'
running build_ext
building 'detectron.utils.cython_bbox' extension
C:\Users\andcy\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\andcy\AppData\Local\Continuum\anaconda2\lib\site-packages\numpy\core\include -IC:\Users\andcy\AppData\Local\Continuum\anaconda2\include -IC:\Users\andcy\AppData\Local\Continuum\anaconda2\PC /Tcdetectron/utils/cython_bbox.c /Fobuild\temp.win-amd64-2.7\Release\detectron/utils/cython_bbox.obj -Wno-cpp
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Users\\andcy\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
make: *** [dev] Error 1

I searched the Internet for: cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'.

I found a number of solutions:

  1. Installation on Windows Command line error D8021 : invalid numeric argument '/Wno-cpp' CharlesShang/FastMaskRCNN#173
  2. invalid numeric argument '/Wno-cpp' cocodataset/cocoapi#51

The solution being:

First go to cocoapi\PythonAPI\setup.py and change a line from from:
extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
to extra_compile_args={'gcc': ['/Qstd=c99']},

It did not work because of TypeError: can only concatenate list (not "dict") to list make:.

Further down in the comments, @TonyNgo1 mentions that he also gets the error and suggests removing the line entirely. It works.

However, I am still unable to make Detectron.

Any ideas or references?

2227 Warning(s)
0 Error(s)

Time Elapsed 00:05:28.53
"Caffe2 built successfully"

  • Operating system: ?

  • Compiler version: ?

  • CUDA version: 9.2

  • cuDNN version: ?

  • NVIDIA driver version: 398.36

  • PYTHONPATH environment variable: ?
    I do not see an environment variable with this name when I look under my environment variables.

  • python --version output:

C:\Users\andcy>python --version
Python 2.7.14 :: Anaconda custom (64-bit)
  • Anything else that seems relevant: ?
@ir413
Copy link
Contributor

ir413 commented Jul 12, 2018

Hi @aw236, we do not provide support for building on Windows at this time (see #454, #276 and #25 for discussions that may be helpful). Sorry for the inconvenience.

@ir413 ir413 closed this as completed Jul 12, 2018
@gcrookie
Copy link

extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
to extra_compile_args={'gcc': ['/Qstd=c99']},

This worked for me on Windows

@liqi198786
Copy link

@aw236 , hi , have you solved the problem? i encountered the same situation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants