pybind / pybind/pybind11

Windows 10: "Fatal error C1060: compiler is out of heap space" when building a C++ library with Pybind11

Open
#2,996 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

I'm getting fatal error C1060: compiler is out of heap space trying to build and install a C++ library with Pybind11 on Windows 10. Building works fine on Linux, and also used to work on Windows 10. Any ideas?

Requirement already satisfied: pybind11 in d:\conda_jmetal\lib\site-packages (from bbcomp==0.0.1) (2.6.2)
Building wheels for collected packages: bbcomp
  Building wheel for bbcomp (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\conda_jmetal\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-njq44h2v\\setup.py'"'"'; __file__='"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-njq44h2v\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\AppData\Local\Temp\pip-wheel-k99xe_02'
       cwd: C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'bbcomp' extension
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\conda_jmetal\lib\site-packages\pybind11\include -ID:\conda_jmetal\include -ID:\conda_jmetal\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tpbbcomp.cpp /Fobuild\temp.win-amd64-3.9\Release\bbcomp.obj /std:c++latest /EHsc /bigobj
  bbcomp.cpp
  C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/bbcomplib.cpp(189): warning C4101: 'ex': unreferenced local variable
  C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/bbcomplib.cpp(216): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
  C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/bbcomplib.cpp(310): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
  C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/hypervolume.cpp(30): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
  C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/interpreter.cpp(651): warning C4273: 'round': inconsistent dll linkage
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_math.h(533): note: see previous definition of 'round'
  C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/interpreter.cpp(744): fatal error C1060: compiler is out of heap space
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for bbcomp
  Running setup.py clean for bbcomp
Failed to build bbcomp
Installing collected packages: bbcomp
    Running setup.py install for bbcomp ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\conda_jmetal\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-njq44h2v\\setup.py'"'"'; __file__='"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-njq44h2v\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\AppData\Local\Temp\pip-record-iln1c3ao\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\conda_jmetal\Include\bbcomp'
         cwd: C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\
    Complete output (17 lines):
    running install
    running build
    running build_ext
    building 'bbcomp' extension
    creating build
    creating build\temp.win-amd64-3.9
    creating build\temp.win-amd64-3.9\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\conda_jmetal\lib\site-packages\pybind11\include -ID:\conda_jmetal\include -ID:\conda_jmetal\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tpbbcomp.cpp /Fobuild\temp.win-amd64-3.9\Release\bbcomp.obj /std:c++latest /EHsc /bigobj
    bbcomp.cpp
    C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/bbcomplib.cpp(189): warning C4101: 'ex': unreferenced local variable
    C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/bbcomplib.cpp(216): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
    C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/bbcomplib.cpp(310): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
    C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/hypervolume.cpp(30): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
    C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/interpreter.cpp(651): warning C4273: 'round': inconsistent dll linkage
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_math.h(533): note: see previous definition of 'round'
    C:\Users\AppData\Local\Temp\pip-req-build-njq44h2v\./bbcomp-core-source-gplv3/interpreter.cpp(744): fatal error C1060: compiler is out of heap space
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\conda_jmetal\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-njq44h2v\\setup.py'"'"'; __file__='"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-njq44h2v\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\AppData\Local\Temp\pip-record-iln1c3ao\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\conda_jmetal\Include\bbcomp' Check the logs for full command output.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows build command from setup.py and inspect the compiler failure reported at bbcomp-core-source-gplv3/interpreter.cpp:744. Compare the failing MSVC build with the stated working Linux build and determine whether the failure is actionable in pybind11; done means a verified cause and a reproducible resolution or a confirmed external issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.