diff --git a/paddle/fluid/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc index 1642c178097674decad0a597221e7e49b5545a18..9d5ae813de0f5861d7bc97c9dc2885d91b7240fb 100644 --- a/paddle/fluid/platform/cpu_info.cc +++ b/paddle/fluid/platform/cpu_info.cc @@ -14,10 +14,6 @@ limitations under the License. */ #include "paddle/fluid/platform/cpu_info.h" -#if defined(_WIN32) -#define NOMINMAX // msvc max/min macro conflict with std::min/max -#endif - #ifdef PADDLE_WITH_XBYAK #include "xbyak/xbyak.h" #include "xbyak/xbyak_util.h" @@ -27,7 +23,7 @@ limitations under the License. */ #include #include #elif defined(_WIN32) -#define WIN32_LEAN_AND_MEAN +#define NOMINMAX // msvc max/min macro conflict with std::min/max #include #else #include diff --git a/paddle/fluid/platform/port.h b/paddle/fluid/platform/port.h index 41388d8959e260bdfdca7a24abb4d213ea6c4cc7..c1b81159aca979efe4b46777a1cef49e44b95e27 100644 --- a/paddle/fluid/platform/port.h +++ b/paddle/fluid/platform/port.h @@ -37,10 +37,6 @@ #define GOOGLE_GLOG_DLL_DECL #include // _popen, _pclose #include -#ifdef _WINSOCKAPI_ -/* Prevent inclusion of winsock.h in windows.h */ -#define WIN32_LEAN_AND_MEAN -#endif #include #include // std::accumulate in msvc #ifndef S_ISDIR // windows port for sys/stat.h diff --git a/python/setup.py.in b/python/setup.py.in index 0a83773c8279fe06743ef437d9a87733a4e35bd9..155dd9c58050fcc1650ae4c6412d50f908a8d255 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -174,18 +174,17 @@ else: package_data['paddle.libs'] += ['openblas' + ext_name] if '${WITH_MKLDNN}' == 'ON': - if '${CMAKE_BUILD_TYPE}' == 'Release': - if os.name != 'nt': - # only change rpath in Release mode. - # TODO(typhoonzero): use install_name_tool to patch mkl libs once - # we can support mkl on mac. - # - # change rpath of libmkldnn.so.0, add $ORIGIN/ to it. - # The reason is that all thirdparty libraries in the same directory, - # thus, libmkldnn.so.0 will find libmklml_intel.so and libiomp5.so. - command = "patchelf --set-rpath '$ORIGIN/' ${MKLDNN_SHARED_LIB}" - if os.system(command) != 0: - raise Exception("patch libmkldnn.so failed, command: %s" % command) + if '${CMAKE_BUILD_TYPE}' == 'Release' AND os.name != 'nt': + # only change rpath in Release mode. + # TODO(typhoonzero): use install_name_tool to patch mkl libs once + # we can support mkl on mac. + # + # change rpath of libmkldnn.so.0, add $ORIGIN/ to it. + # The reason is that all thirdparty libraries in the same directory, + # thus, libmkldnn.so.0 will find libmklml_intel.so and libiomp5.so. + command = "patchelf --set-rpath '$ORIGIN/' ${MKLDNN_SHARED_LIB}" + if os.system(command) != 0: + raise Exception("patch libmkldnn.so failed, command: %s" % command) package_data['paddle.libs']+=['libmkldnn.so.0' if os.name != 'nt' else ('mkldnn' + ext_name)] shutil.copy('${MKLDNN_SHARED_LIB}', libs_path) if '${WITH_NGRAPH}' == 'ON':