mlba-team / xdispatch

Unmaintained. See https://github.com/emzeat/xdispatch2 for successor project.
http://opensource.mlba-team.de/xdispatch
Apache License 2.0
76 stars 24 forks source link

unable to build for Windows #6

Open Sabine-Schnabeltier opened 6 years ago

Sabine-Schnabeltier commented 6 years ago

Using msys2 under Windows 10, the following warnings and errors are given, preventing the build of the library.

$ git clone https://github.com/mlba-team/xdispatch.git
Cloning into 'xdispatch'...
remote: Counting objects: 7405, done.
remote: Total 7405 (delta 0), reused 0 (delta 0), pack-reused 7405
Receiving objects: 100% (7405/7405), 4.02 MiB | 3.20 MiB/s, done.
Resolving deltas: 100% (4211/4211), done.
Checking out files: 100% (489/489), done.

$ cd xdispatch

$ git submodule update --init
Submodule 'build' (https://github.com/mlba-team/mz-cmaketools.git) registered for path 'build'
Cloning into '/home/sabine/xdispatch/build'...
Submodule path 'build': checked out '7adb690b7dd9dd08cc8a1edf26092c4354a3d7b6'

$ cmake -G "MSYS Makefiles"
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.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:/msys64/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/msys64/usr/bin/git.exe (found version "2.19.0")
-- version information for '0.8.0~devel (devel)'
-- running mz compiler detection tools
-- GCC compatible compiler found
-- compiler version 82
-- C++11 support detected
-- 64bit platform
-- Today is: 2018-10-03T19:45:28Z (Year 2018)
-- User is: sabine
-- Compiler version is: 82
-- forcing C++11 support on this platform
-- configuring for build type:
-- Looking for strip utility
-- Looking for strip utility - found
-- Setting binary output path: C:/msys64/home/sabine/xdispatch/bin/
-- Looking for include file sys/event.h
-- Looking for include file sys/event.h - not found
-- Looking for include file kqueue/sys/event.h
-- Looking for include file kqueue/sys/event.h - not found
-- Looking for include file pthread_workqueue.h
-- Looking for include file pthread_workqueue.h - not found
-- Looking for include file dispatch/dispatch.h
-- Looking for include file dispatch/dispatch.h - not found
CMake Warning at CMakeLists.txt:91 (find_package):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core" with any
  of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.

-- adding library libkqueue
-- Looking for EPOLLRDHUP
-- Looking for EPOLLRDHUP - not found
-- Looking for ppoll
-- Looking for ppoll - 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/eventfd.h
-- Looking for include file sys/eventfd.h - not found
-- Looking for include file sys/inotify.h
-- Looking for include file sys/inotify.h - not found
-- Looking for include file sys/signalfd.h
-- Looking for include file sys/signalfd.h - not found
-- Looking for include file sys/timerfd.h
-- Looking for include file sys/timerfd.h - not found
-- building libkqueue as static lib
-- adding library libpthread_workqueue
-- building libpthread_workqueue as static lib
-- adding library dispatch
-- Looking for include file mach/mach_time.h
-- Looking for include file mach/mach_time.h - not found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file crtdbg.h
-- Looking for include file crtdbg.h - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for getprogname
-- Looking for getprogname - not found
-- Looking for getexecname
-- Looking for getexecname - not found
-- Looking for program_invocation_short_name
-- Looking for program_invocation_short_name - not found
-- Looking for CLOCK_UPTIME
-- Looking for CLOCK_UPTIME - not found
-- Looking for CLOCK_MONOTONIC
-- Looking for CLOCK_MONOTONIC - found
-- Looking for sysconf
-- Looking for sysconf - not found
-- linking dispatch with: pthread_workqueue;kqueue;ws2_32
-- adding library xdispatch
-- linking xdispatch with: dispatch
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/sabine/xdispatch

$ make
Scanning dependencies of target kqueue
[  1%] Building C object libkqueue/CMakeFiles/kqueue.dir/src/common/filter.c.obj
In file included from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/private.h:37,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:24:
C:/msys64/home/sabine/xdispatch/libkqueue/src/windows/platform.h:22: warning: "_WIN32_WINNT" redefined
 #define _WIN32_WINNT 0x0501

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/crtdefs.h:10,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/assert.h:15,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:17:
C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:232: note: this is the location of the previous definition
 #define _WIN32_WINNT 0x601

In file included from C:/msys64/home/sabine/xdispatch/libkqueue/src/windows/platform.h:43,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/private.h:37,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:24:
C:/msys64/home/sabine/xdispatch/libkqueue/include/sys/event.h:179:8: error: redefinition of 'struct timespec'
 struct timespec {
        ^~~~~~~~
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/sys/stat.h:26,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/windows/platform.h:34,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/private.h:37,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:24:
C:/msys64/mingw64/x86_64-w64-mingw32/include/sys/types.h:89:8: note: originally defined here
 struct timespec {
        ^~~~~~~~
In file included from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/private.h:37,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:24:
C:/msys64/home/sabine/xdispatch/libkqueue/src/windows/platform.h:132:13: error: conflicting types for 'pid_t'
 typedef int pid_t;
             ^~~~~
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/sys/stat.h:26,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/windows/platform.h:34,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/private.h:37,
                 from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:24:
C:/msys64/mingw64/x86_64-w64-mingw32/include/sys/types.h:68:16: note: previous declaration of 'pid_t' was here
 typedef _pid_t pid_t;
                ^~~~~
In file included from C:/msys64/home/sabine/xdispatch/libkqueue/src/common/filter.c:24:
C:/msys64/home/sabine/xdispatch/libkqueue/src/common/private.h:38:11: fatal error: ../common/queue.h: No such file or directory
 # include "../common/queue.h"
           ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libkqueue/CMakeFiles/kqueue.dir/build.make:63: libkqueue/CMakeFiles/kqueue.dir/src/common/filter.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:987: libkqueue/CMakeFiles/kqueue.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
emzeat commented 6 years ago

I am afraid Windows support is somewhat limited on master currently.

I recommend to go try the 'stable' branch instead.

borrrden commented 5 years ago

Stable is not building either. The timespec struct ends up with multiple definitions.

E.g.

xdispatch\libpthread_workqueue\src\windows\times.h(15): error C2011: 'timespec': 'struct' type redefinition (compiling source file xdispatch\libpthread_workqueue\src\windows\manager.c) 2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\time.h(40): note: see declaration of 'timespec' (compiling source file xdispatch\libpthread_workqueue\src\windows\manager.c)

emzeat commented 5 years ago

Stable is not building either. The timespec struct ends up with multiple definitions.

E.g.

xdispatch\libpthread_workqueue\src\windows\times.h(15): error C2011: 'timespec': 'struct' type redefinition (compiling source file xdispatch\libpthread_workqueue\src\windows\manager.c) 2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\time.h(40): note: see declaration of 'timespec' (compiling source file xdispatch\libpthread_workqueue\src\windows\manager.c)

This is using the MSVC toolchain. This should be fixed on current master as of 68e917cc21e48f13bf73368a693005e9840e5079.

emzeat commented 5 years ago

I do not have the resources to also fix master for the msys/mingw toolchain though. Sorry for that. I welcome any pull requests of course.