Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Windows 10: Missing <sys/mman.h> #58

Closed
sydrawat01 opened this issue Feb 21, 2023 · 3 comments
Closed

Build fails on Windows 10: Missing <sys/mman.h> #58

sydrawat01 opened this issue Feb 21, 2023 · 3 comments

Comments

@sydrawat01
Copy link

Build failure using g++ compiler

After installing the required GCC build tools on Windows, I run the following command to compile the fastBPE code:

g++ -std=c++11 -pthread -O3 fastBPE/main.cc -IfastBPE -o fast

Here's the output:

In file included from fastBPE/main.cc:1:
fastBPE/fastBPE.hpp:15:10: fatal error: sys/mman.h: No such file or directory
   15 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.

On trying other alternatives, I get the same error (see below).

Using setup.py

A pre-requisite to run this command (I believe) is we need Cython installed on our system. (ref #27)

Run the following command:

python setup.py install

Here's the output:

running install
C:\Users\rawatsid\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
C:\Users\rawatsid\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
writing fastBPE.egg-info\PKG-INFO
writing dependency_links to fastBPE.egg-info\dependency_links.txt
writing top-level names to fastBPE.egg-info\top_level.txt
reading manifest file 'fastBPE.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'fastBPE.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'fastBPE' extension
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IfastBPE -IC:\Users\rawatsid\AppData\Local\Programs\Python\Python310\include -IC:\Users\rawatsid\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /TpfastBPE/fastBPE.cpp /Fobuild\temp.win-amd64-cpython-310\Release\fastBPE/fastBPE.obj -std=c++11 -Ofast -pthread
cl : Command line warning D9025 : overriding '/Os' with '/Ot'
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
cl : Command line warning D9002 : ignoring unknown option '-Of'
cl : Command line warning D9002 : ignoring unknown option '-Oa'
cl : Command line warning D9002 : ignoring unknown option '-pthread'
fastBPE.cpp
C:\Users\rawatsid\fastBPE\fastBPE\fastBPE.hpp(15): fatal error C1083: Cannot open include file: 'sys/mman.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

This looks almost similar to the error here.

But after trying out the suggested solution from the comments from this issue, there are still compilation errors. (ref #43)

Similar errors faced by others: #33 #40 #42

I guess there is no support for windows based systems?

@sydrawat01 sydrawat01 changed the title Build fails on Windows 10: Missing sys/mman.h> Build fails on Windows 10: Missing <sys/mman.h> Feb 22, 2023
@sydrawat01
Copy link
Author

The <sys/mman.h> is a Unix header and not available on Windows as the headers under sys are all traditional Unix APIs.
This doesn't seem to work even after using Cygwin for Windows, which actually provides an implementation of mman.h.
See here.

@sydrawat01
Copy link
Author

After trying to install all dependencies on a basic Docker Ubuntu image, I finally got things to work.
This definitely is an OS issue, and it looks like the fastBPE was not built to support Windows.

@sydrawat01
Copy link
Author

Closing this issue since it's specific to the OS and nothing to do with the fastBPE project.

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

No branches or pull requests

1 participant