diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 67dfc3c42a840dfcb3943eadb24199dc5670293b..fc984f5e560ef30c342e108c50648e3e83e8b62d 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -54,10 +54,10 @@ endif(WIN32) if(WITH_MUSL) add_definitions(-DPADDLE_WITH_MUSL) - message(STATUS, "WITH_MKL=OFF, when WITH_MUSL=ON") + message(STATUS, "Set compile option WITH_MKL=OFF when WITH_MUSL=ON") SET(WITH_MKL OFF) - message(STATUS, "WITH_GPU=OFF, when WITH_MUSL=ON") + message(STATUS, "Set compile option WITH_GPU=OFF when WITH_MUSL=ON") SET(WITH_GPU OFF) endif() diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index 784760a65a42a8027c407f52c6d421d451c17e5b..01bf5335da6d1f16976cc89b40b347d6ad34f1aa 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -47,6 +47,10 @@ limitations under the License. */ #include #include +#ifndef PADDLE_WITH_MUSL +#include +#endif + #define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h #include "glog/logging.h" #include "paddle/fluid/platform/errors.h" @@ -230,13 +234,14 @@ inline std::string SimplifyDemangleStr(std::string str) { } inline std::string GetCurrentTraceBackString() { - //static constexpr int TRACE_STACK_LIMIT = 100; std::ostringstream sout; sout << "\n\n--------------------------------------\n"; sout << "C++ Traceback (most recent call last):"; sout << "\n--------------------------------------\n"; -#if !defined(_WIN32) && 0 +#if !defined(_WIN32) && !defined(PADDLE_WITH_MUSL) + static constexpr int TRACE_STACK_LIMIT = 100; + void* call_stack[TRACE_STACK_LIMIT]; auto size = backtrace(call_stack, TRACE_STACK_LIMIT); auto symbols = backtrace_symbols(call_stack, size); @@ -255,7 +260,7 @@ inline std::string GetCurrentTraceBackString() { } free(symbols); #else - sout << "Windows not support stack backtrace yet.\n"; + sout << "Not support stack backtrace yet.\n"; #endif return sout.str(); } diff --git a/paddle/fluid/platform/macros.h b/paddle/fluid/platform/macros.h index 7ab63cc10c143a7aaabfb828c9d69814a04997a4..82b20a53ce770757c08d1c9d2ce28a084861147c 100644 --- a/paddle/fluid/platform/macros.h +++ b/paddle/fluid/platform/macros.h @@ -25,6 +25,8 @@ limitations under the License. */ classname& operator=(classname&&) = delete #endif -//#if defined(__FLT_MAX__) -//#define FLT_MAX __FLT_MAX__ -//#endif // __FLT_MAX__ +#ifndef PADDLE_WITH_MUSL + #if defined(__FLT_MAX__) + #define FLT_MAX __FLT_MAX__ + #endif // __FLT_MAX__ +#endif diff --git a/paddle/fluid/platform/port.h b/paddle/fluid/platform/port.h index 0c4d41a7835f6127c56da35c280a90ebb77d2a34..5c346537ccad8e69c0d426f35d43f531d4190e2e 100644 --- a/paddle/fluid/platform/port.h +++ b/paddle/fluid/platform/port.h @@ -26,7 +26,6 @@ #if !defined(_WIN32) #include // dladdr -//#include // backtrace #include #include #include // std::accumulate