Try fixing mingw build error when using CMake. (#77)
* Try fixing mingw build error when using CMake. * Check __MINGW32__ . * Fix linter.
This commit is contained in:
parent
eb2590b774
commit
05941a5f96
@ -207,11 +207,11 @@ utils::TCPSocket AllreduceBase::ConnectTracker(void) const {
|
|||||||
utils::Socket::Error("Connect");
|
utils::Socket::Error("Connect");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "retry connect to ip(retry time %d): [%s]\n", retry, tracker_uri.c_str());
|
fprintf(stderr, "retry connect to ip(retry time %d): [%s]\n", retry, tracker_uri.c_str());
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) || defined (__MINGW32__)
|
||||||
Sleep(retry << 1);
|
Sleep(retry << 1);
|
||||||
#else
|
#else
|
||||||
sleep(retry << 1);
|
sleep(retry << 1);
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Copyright (c) 2014 by Contributors
|
* Copyright (c) 2014-2018 by Contributors
|
||||||
* \file allreduce_robust.cc
|
* \file allreduce_robust.cc
|
||||||
* \brief Robust implementation of Allreduce
|
* \brief Robust implementation of Allreduce
|
||||||
*
|
*
|
||||||
@ -53,7 +53,7 @@ void AllreduceRobust::Shutdown(void) {
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// In OSX, one worker shutdowns and closes sockets while rest still run kCheckAck
|
// In OSX, one worker shutdowns and closes sockets while rest still run kCheckAck
|
||||||
// This cause rest workers checkandrecover and hang inf, https://github.com/dmlc/xgboost/pull/3818
|
// This cause rest workers checkandrecover and hang inf, https://github.com/dmlc/xgboost/pull/3818
|
||||||
// TODO: a fundamental fix for this
|
// TODO(Chen Qin): a fundamental fix for this
|
||||||
sleep(2);
|
sleep(2);
|
||||||
#endif
|
#endif
|
||||||
AllreduceBase::Shutdown();
|
AllreduceBase::Shutdown();
|
||||||
|
|||||||
@ -28,8 +28,11 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "../include/rabit/internal/utils.h"
|
#include "../include/rabit/internal/utils.h"
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) && not defined(__MINGW32__)
|
||||||
typedef int ssize_t;
|
typedef int ssize_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
typedef int sock_size_t;
|
typedef int sock_size_t;
|
||||||
|
|
||||||
static inline int poll(struct pollfd *pfd, int nfds,
|
static inline int poll(struct pollfd *pfd, int nfds,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user