libzmq: Build Failure on Windows 10 for ARM/ARM64
Issue description
When trying to build ZMQ for ARM/ARM64 on Windows, I get these errors:
\src\clock.cpp(260): error C2065: 'CLOCK_MONOTONIC': undeclared identifier
\src\clock.cpp(260): error C3861: 'clock_gettime': identifier not found
Which makes sense because that’s not a Windows API. I’m unable to build ZMQ other than with VcPkg because I am not familiar with CMake.
I also opened this issue: https://github.com/Microsoft/vcpkg/issues/5171 But the initial feedback I got was that I need to open an issue here.
Environment
- libzmq version (commit hash if unreleased):
0761e6bb48e34c1499104eaf7f9daa0c6647977c - OS: Windows 10.0.17763.253
- Compiler: Visual Studio 2017 15.9.5
- Built With: VcPkg
Minimal test code / Steps to reproduce the issue
- Run:
vcpkg install zeromq:arm64-windowsOR - Run:
vcpkg install zeromq:arm-windows
What’s the actual result?
The build fails with the above errors.
What’s the expected result?
The build completes successfully.
More Information
I can provide a suitable replacement for clock_gettime that works on Windows, but even if I hack one in, just to test it, I get a linker error because the project isn’t including the .lib you need when linking on Windows (perhaps because it isn’t detecting this to be a Windows build). At that point, I need some help because I don’t know anything about CMake and I don’t know how to change the files to include the right libraries in the linker settings. I really need someone more familiar with this to help. But, let me know if you want my replacement for clock_gettime.
I know that ARM and ARM64 on Windows is a new thing, but it’s a real thing now, and I really hope you intend to support it. Please let me know how I can help.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 24 (13 by maintainers)
I was getting the same issue, but it looks like on windows you have to change the polling setting to use epoll instead of select. The best way I found to build for ARM64 is to edit the port file (with just a couple of changes), rather than messing around manually with the build tree. So in
vcpkg/ports/zeromq/portfile.cmakemake the following changes:and then run
vcpkg install zeromq:arm64-windows