Resolving Missing sys Include Files: devpoll.h, epoll.h, event.h, and queue.h during CMake when Building MySQL on Windows

As I mentioned in a previous post that I’d mention how I resolved some additional missing include files when building MySQL on Windows.

In this post I cover 4 missing header files, as they are all related and have to do with polling, and headers (and functions) from libevent, and in the folder /sys. I’m not sure if one should even use these functions from libevent on Windows, as these are not needed for Windows, and may not be beneficial either (that last part I’ve just read briefly about, so I’d need to that a bit more myself to be 100%), but including the headers won’t hurt, as it doesn’t hurt if they don’t exist.

At any rate, here were the 4 related missing header file warnings:

-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - not found
-- Looking for include file sys/event.h
-- Looking for include file sys/event.h - not found
-- Looking for include file sys/queue.h
-- Looking for include file sys/queue.h - not found

[I do see it looks for devpoll.h twice, not sure if that is necessary, so I filed a feature request.]

Anyway, we’re missing devpoll.h, epoll.h, event.h, and queue.h.

There are probably better ways to accomplish this, but this is what worked for me:

To start, I downloaded libevent-2.0.21-stable.tar.gz for queue.h and event.h.

I then downloaded devpoll.h from here.

And then I got a working Windows version of epoll.h from here.

I copied all of the header files to (the location of the Visual Studio I’m using):

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys

Now, when building, the above looks like:

c:\mysql\mysql-5.6.12\bld>cmake ..
-- Building for: Visual Studio 10
-- Running cmake version 2.8.11.1
...
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - found
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - found
-- Looking for include file sys/event.h
-- Looking for include file sys/event.h - found
-- Looking for include file sys/queue.h
-- Looking for include file sys/queue.h - found

Again, these may not even be necessary, and I want to look more into libevent for Windows, but at least this helps explain these missing header files (and how to eliminate the “not found” messages if you so desire).

Hope this helps. :)

 

Related Build Links:

 

Tags: , , , , , , , ,

2 Responses to “Resolving Missing sys Include Files: devpoll.h, epoll.h, event.h, and queue.h during CMake when Building MySQL on Windows”

  1. Jan Kneschke says:

    The checks exist to see if a specific feature is provided on this system. Windows has no /dev/poll, only Solaris has and therefore only Solaris provides the sys/devpoll.h. Same for epoll, which is Linux specific. That work-in-progress windows-port of epoll has a slightly different API than the Linux one.

    Expect more harm than benefit by “fixing” those header checks.

  2. Wlad says:

    I’m wondering if one can bring Windows to unbuildable state, by including various obscure headers, like epoll.h :) .

    If those messages bother you, there is cmake\os\WindowsCache.cmake, which contains all things that are expected to be “not found” – cmake system checks are very slow with Visual Studio, and precaching known results of system checks speeds up the configuration process considerably.

    For the entries in question, you need to add

    SET(HAVE_SYS_DEVPOLL_H CACHE INTERNAL “”)
    SET(HAVE_SYS_EPOLL_H CACHE INTERNAL “”)
    SET(HAVE_SYS_EVENT_H CACHE INTERNAL “”)
    SET(HAVE_SYS_QUEUE_H CACHE INTERNAL “”)

    Adding Linux specific epoll.h to include path can have funny consequences that it won’t build at some point. One can’t trick out system checks like this:)


Period Panties by Period Panteez Menstrual Underwear Menstruation PMS Panty