alpine上编译paddlepaddle得到一个奇怪的异常
Created by: jtyoui
paddlepaddle:1.8.3 alpine:1.13.0
[ 5%] Building CXX object paddle/fluid/platform/dynload/CMakeFiles/dynamic_loader.dir/dynamic_loader.cc.o
In file included from /opt/Paddle-1.8.3/paddle/fluid/platform/enforce.h:50,
from /opt/Paddle-1.8.3/paddle/fluid/platform/dynload/dynamic_loader.cc:23:
/opt/Paddle-1.8.3/paddle/fluid/platform/macros.h:29: error: "FLT_MAX" redefined [-Werror]
29 | #define FLT_MAX __FLT_MAX__
|
In file included from /usr/include/c++/9.3.0/cfloat:42,
from /opt/Paddle-1.8.3/paddle/fluid/platform/macros.h:16,
from /opt/Paddle-1.8.3/paddle/fluid/platform/enforce.h:50,
from /opt/Paddle-1.8.3/paddle/fluid/platform/dynload/dynamic_loader.cc:23:
/usr/include/float.h:15: note: this is the location of the previous definition
15 | #define FLT_MAX 3.40282346638528859812e+38F
|
cc1plus: all warnings being treated as errors
make[2]: *** [paddle/fluid/platform/dynload/CMakeFiles/dynamic_loader.dir/build.make:83: paddle/fluid/platform/dynload/CMakeFiles/dynamic_loader.dir/dynamic_loader.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4551: paddle/fluid/platform/dynload/CMakeFiles/dynamic_loader.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
我查看本机上的gcc定义的宏:
/opt/Paddle-1.8.3/build # cpp -dM /dev/null | grep "FLT_MAX"
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F
显示是有定义的