From b06ce129bcf8f0bb89fe5d1a1a13107218204d8a Mon Sep 17 00:00:00 2001 From: peizhilin Date: Thu, 20 Dec 2018 19:29:51 +0800 Subject: [PATCH] some not so useful adjust test=develop --- paddle/fluid/platform/cpu_info.cc | 6 +----- paddle/fluid/platform/port.h | 4 ---- python/setup.py.in | 23 +++++++++++------------ 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/paddle/fluid/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc index 1642c1780..9d5ae813d 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 41388d895..c1b81159a 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 0a83773c8..155dd9c58 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': -- GitLab