invalid numeric argument ‘/Wsign-compare’ : Can’t install pip package or build corresponding library on Windows

  apriltags, pip, python, visual-studio, windows

I’ve been using the python module apriltag (found here https://pypi.org/project/apriltag/) on linux for a while, and need to move my system over to Windows. On my windows machine, I tried to install the apriltag pip package on python3.6:

python -m pip install apriltag

but the wheel failed to build, giving me a long error list in which I believe the key line is

Building Custom Rule C:/Users/xxxx/apriltag_3b8f424df9f543459d5bd3db09137d9f/core/CMakeLists.txt
cl : Command line error D8021: invalid numeric argument ‘/Wsign-compare’“`

Worried that maybe the PyPI package didn’t work on windows(?) I looked at the project that it was based on, found here https://github.com/swatbotics/apriltag. Cloning into it and building it with Visual Studio, the first build fails with

Error D8021 invalid numeric argument ‘/Wsign-compare’

I’ve looked on here for /Wsign-compare but have found no example of anyone even getting that error, let alone solving it. Let me know if there’s a fix for it, or if this repo just isn’t going to build on windows ever.

Thanks 🙂

EDIT: added entire python build log for context

python -m pip install apriltag

Collecting apriltag
  Using cached apriltag-0.0.16.tar.gz (201 kB)
Building wheels for collected packages: apriltag
  Building wheel for apriltag (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:UsersxxxxxxAppDataLocalProgramsPythonPython36python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersxxxxxxAppDataLocalTemp2pip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py'"'"'; __file__='"'"'C:UsersxxxxxxAppDataLocalTemp2pip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersxxxxxxAppDataLocalTemppip-wheel-b7pu6nq2'
       cwd: C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946
  Complete output (75 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.6
  copying pythonapriltag.py -> buildlib.win-amd64-3.6
  running build_ext
  -- Building for: Visual Studio 15 2017
  -- The C compiler identification is MSVC 19.14.26428.1
  -- The CXX compiler identification is MSVC 19.14.26428.1
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe - works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe - works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Looking for pthread.h
  -- Looking for pthread.h - not found
  -- Found Threads: TRUE
  -- Found PkgConfig: C:/msys64/usr/bin/pkg-config.exe (found version "0.29.2")
  -- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
  -- Configuring done
  -- Generating done
  CMake Warning:
    Manually-specified variables were not used by the project:
  
      PYTHON_EXECUTABLE
  
  
  -- Build files have been written to: C:/Users/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/build/temp.win-amd64-3.6/Release
  Microsoft (R) Build Engine version 15.7.177.53362 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  C:Program Files (x86)Microsoft Visual Studio17ProfessionalCommon7IDEVCVCTargetsMicrosoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot
reside under the Temporary directory as it could lead to issues with incremental build. [C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946buildtemp.win-amd64-3.6ReleaseZERO_CHECK.vcxproj]
    Checking Build System
  C:Program Files (x86)Microsoft Visual Studio17ProfessionalCommon7IDEVCVCTargetsMicrosoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot
reside under the Temporary directory as it could lead to issues with incremental build. [C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946buildtemp.win-amd64-3.6Releasecoreapriltag.vcxproj]
    Building Custom Rule C:/Users/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/core/CMakeLists.txt
  cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946buildtemp.win-amd64-3.6Releasecoreapriltag.vcxproj]
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py", line 74, in <module>
      py_modules=['apriltag']
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libsite-packagessetuptools__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscore.py", line 148, in setup
      dist.run_commands()
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 955, in run_commands
      self.run_command(cmd)
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 974, in run_command
      cmd_obj.run()
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libsite-packageswheelbdist_wheel.py", line 192, in run
      self.run_command('build')
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 974, in run_command
      cmd_obj.run()
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscommandbuild.py", line 135, in run
      self.run_command(cmd_name)
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 974, in run_command
      cmd_obj.run()
    File "C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py", line 35, in run
      self.build_extension(ext)
    File "C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py", line 60, in build_extension
      subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
    File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libsubprocess.py", line 311, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for apriltag
  Running setup.py clean for apriltag
Failed to build apriltag
Installing collected packages: apriltag
    Running setup.py install for apriltag ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:UsersxxxxxxAppDataLocalProgramsPythonPython36python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersxxxxxxAppDataLocalTemp2pip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py'"'"'; __file__='"'"'C:UsersxxxxxxAppDataLocalTemp2pip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersxxxxxxAppDataLocalTemppip-record-ryn6eco8install-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersxxxxxxAppDataLocalProgramsPythonPython36Includeapriltag'
         cwd: C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946
    Complete output (77 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.6
    copying pythonapriltag.py -> buildlib.win-amd64-3.6
    running build_ext
    -- Building for: Visual Studio 15 2017
    -- The C compiler identification is MSVC 19.14.26428.1
    -- The CXX compiler identification is MSVC 19.14.26428.1
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe - works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe - works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Looking for pthread.h
    -- Looking for pthread.h - not found
    -- Found Threads: TRUE
    -- Found PkgConfig: C:/msys64/usr/bin/pkg-config.exe (found version "0.29.2")
    -- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        PYTHON_EXECUTABLE
    
    
    -- Build files have been written to: C:/Users/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/build/temp.win-amd64-3.6/Release
    Microsoft (R) Build Engine version 15.7.177.53362 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    C:Program Files (x86)Microsoft Visual Studio17ProfessionalCommon7IDEVCVCTargetsMicrosoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946buildtemp.win-amd64-3.6ReleaseZERO_CHECK.vcxproj]
      Checking Build System
    C:Program Files (x86)Microsoft Visual Studio17ProfessionalCommon7IDEVCVCTargetsMicrosoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946buildtemp.win-amd64-3.6Releasecoreapriltag.vcxproj]
      Building Custom Rule C:/Users/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/core/CMakeLists.txt
    cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946buildtemp.win-amd64-3.6Releasecoreapriltag.vcxproj]
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py", line 74, in <module>
        py_modules=['apriltag']
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libsite-packagessetuptools__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libsite-packagessetuptoolscommandinstall.py", line 61, in run
        return orig.install.run(self)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscommandinstall.py", line 545, in run
        self.run_command('build')
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscommandbuild.py", line 135, in run
        self.run_command(cmd_name)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py", line 35, in run
        self.build_extension(ext)
      File "C:UsersxxxxxxAppDataLocalTemppip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py", line 60, in build_extension
        subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
      File "C:UsersxxxxxxAppDataLocalProgramsPythonPython36libsubprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UsersxxxxxxAppDataLocalProgramsPythonPython36python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersxxxxxxAppDataLocalTemp2pip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py'"'"'; __file__='"'"'C:UsersxxxxxxAppDataLocalTemp2pip-install-4bvz6i3japriltag_80d1649893034236a5513184eaa51946setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersxxxxxxAppDataLocalTemppip-record-ryn6eco8install-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersxxxxxxAppDataLocalProgramsPythonPython36Includeapriltag' Check the logs for full command output.```

Source: Windows Questions

LEAVE A COMMENT