Mac OS capi编译错误
Created by: blinkblinkhl
- 版本、环境信息: 1)PaddlePaddle版本:release/1.5 2)CPU:Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz 3)GPU:无 4)系统环境:Mac OS 10.14
- 安装方式信息:
2)本地编译:
PADDLE_ROOT=/path/of/capi
git clone https://github.com/PaddlePaddle/Paddle.git
cd Paddle
mkdir build
cd build
cmake -DFLUID_INFERENCE_INSTALL_DIR=$PADDLE_ROOT
-DCMAKE_BUILD_TYPE=Release
-DWITH_PYTHON=OFF
-DWITH_MKL=OFF
-DWITH_GPU=OFF
-DON_INFER=ON
..
CMakeError.log如下:
Performing C++ SOURCE FILE Test AVX512F_FOUND failed with the following output:
Change Dir: /Users/heliang/Paddle/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_4884f/fast /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_4884f.dir/build.make CMakeFiles/cmTC_4884f.dir/build Building CXX object CMakeFiles/cmTC_4884f.dir/src.cxx.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DAVX512F_FOUND -mavx512f -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -o CMakeFiles/cmTC_4884f.dir/src.cxx.o -c /Users/heliang/Paddle/build/CMakeFiles/CMakeTmp/src.cxx Linking CXX executable cmTC_4884f /usr/local/Cellar/cmake/3.14.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4884f.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DAVX512F_FOUND -mavx512f -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_4884f.dir/src.cxx.o -o cmTC_4884f
...and run output: Illegal instruction Return value: FAILED_TO_RUN Source file was:
#include <immintrin.h> int main() { __m512i a = _mm512_set_epi32 (-1, 2, -3, 4, -1, 2, -3, 4, 13, -5, 6, -7, 9, 2, -6, 3); __m512i result = _mm512_abs_epi32 (a); return 0; } Determining size of pthread_spinlock_t failed with the following output: Change Dir: /Users/heliang/Paddle/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_83ff4/fast /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_83ff4.dir/build.make CMakeFiles/cmTC_83ff4.dir/build Building C object CMakeFiles/cmTC_83ff4.dir/SPINLOCK_FOUND.c.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -o CMakeFiles/cmTC_83ff4.dir/SPINLOCK_FOUND.c.o -c /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:26:12: error: use of undeclared identifier 'pthread_spinlock_t' ('0' + ((SIZE / 10000)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_spinlock_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:27:12: error: use of undeclared identifier 'pthread_spinlock_t' ('0' + ((SIZE / 1000)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_spinlock_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:28:12: error: use of undeclared identifier 'pthread_spinlock_t' ('0' + ((SIZE / 100)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_spinlock_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:29:12: error: use of undeclared identifier 'pthread_spinlock_t' ('0' + ((SIZE / 10)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_spinlock_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:30:12: error: use of undeclared identifier 'pthread_spinlock_t' ('0' + (SIZE % 10)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_spinlock_t)) ^ 5 errors generated. make[1]: *** [CMakeFiles/cmTC_83ff4.dir/SPINLOCK_FOUND.c.o] Error 1 make: *** [cmTC_83ff4/fast] Error 2
/Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/SPINLOCK_FOUND.c: #include <sys/types.h> #include <stdint.h> #include <stddef.h> #include "pthread.h"
#undef KEY #if defined(__i386)
define KEY '','','i','3','8','6'
#elif defined(__x86_64)
define KEY '','','x','8','6','_','6','4'
#elif defined(ppc)
define KEY '','','p','p','c','',''
#elif defined(ppc64)
define KEY '','','p','p','c','6','4','',''
#elif defined(aarch64)
define KEY '','','a','a','r','c','h','6','4','',''
#elif defined(ARM_ARCH_7A)
define KEY '','','A','R','M','','A','R','C','H','','7','A','',''
#elif defined(ARM_ARCH_7S)
define KEY '','','A','R','M','','A','R','C','H','','7','S','',''
#endif
#define SIZE (sizeof(pthread_spinlock_t)) char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%inference-subgraph-tester)), ('0' + ((SIZE / 1000)%inference-subgraph-tester)), ('0' + ((SIZE / 100)%inference-subgraph-tester)), ('0' + ((SIZE / 10)%inference-subgraph-tester)), ('0' + (SIZE % 10)), ']', #ifdef KEY ' ','k','e','y','[', KEY, ']', #endif '\0'};
#ifdef CLASSIC_C int main(argc, argv) int argc; char *argv[]; #else int main(int argc, char *argv[]) #endif { int require = 0; require += info_size[argc]; (void)argv; return require; }
Determining size of pthread_barrier_t failed with the following output: Change Dir: /Users/heliang/Paddle/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_f7b05/fast /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_f7b05.dir/build.make CMakeFiles/cmTC_f7b05.dir/build Building C object CMakeFiles/cmTC_f7b05.dir/BARRIER_FOUND.c.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -o CMakeFiles/cmTC_f7b05.dir/BARRIER_FOUND.c.o -c /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:26:12: error: use of undeclared identifier 'pthread_barrier_t' ('0' + ((SIZE / 10000)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_barrier_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:27:12: error: use of undeclared identifier 'pthread_barrier_t' ('0' + ((SIZE / 1000)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_barrier_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:28:12: error: use of undeclared identifier 'pthread_barrier_t' ('0' + ((SIZE / 100)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_barrier_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:29:12: error: use of undeclared identifier 'pthread_barrier_t' ('0' + ((SIZE / 10)%inference-subgraph-tester)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_barrier_t)) ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:30:12: error: use of undeclared identifier 'pthread_barrier_t' ('0' + (SIZE % 10)), ^ /Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c:24:22: note: expanded from macro 'SIZE' #define SIZE (sizeof(pthread_barrier_t)) ^ 5 errors generated. make[1]: *** [CMakeFiles/cmTC_f7b05.dir/BARRIER_FOUND.c.o] Error 1 make: *** [cmTC_f7b05/fast] Error 2
/Users/heliang/Paddle/build/CMakeFiles/CheckTypeSize/BARRIER_FOUND.c: #include <sys/types.h> #include <stdint.h> #include <stddef.h> #include "pthread.h"
#undef KEY #if defined(__i386)
define KEY '','','i','3','8','6'
#elif defined(__x86_64)
define KEY '','','x','8','6','_','6','4'
#elif defined(ppc)
define KEY '','','p','p','c','',''
#elif defined(ppc64)
define KEY '','','p','p','c','6','4','',''
#elif defined(aarch64)
define KEY '','','a','a','r','c','h','6','4','',''
#elif defined(ARM_ARCH_7A)
define KEY '','','A','R','M','','A','R','C','H','','7','A','',''
#elif defined(ARM_ARCH_7S)
define KEY '','','A','R','M','','A','R','C','H','','7','S','',''
#endif
#define SIZE (sizeof(pthread_barrier_t)) char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%inference-subgraph-tester)), ('0' + ((SIZE / 1000)%inference-subgraph-tester)), ('0' + ((SIZE / 100)%inference-subgraph-tester)), ('0' + ((SIZE / 10)%inference-subgraph-tester)), ('0' + (SIZE % 10)), ']', #ifdef KEY ' ','k','e','y','[', KEY, ']', #endif '\0'};
#ifdef CLASSIC_C int main(argc, argv) int argc; char *argv[]; #else int main(int argc, char *argv[]) #endif { int require = 0; require += info_size[argc]; (void)argv; return require; }
Performing C SOURCE FILE Test C_COMPILER_SUPPORT_FLAG__Wno_error_literal_suffix failed with the following output: Change Dir: /Users/heliang/Paddle/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_db53f/fast /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_db53f.dir/build.make CMakeFiles/cmTC_db53f.dir/build Building C object CMakeFiles/cmTC_db53f.dir/src.c.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wno-deprecated-register -DC_COMPILER_SUPPORT_FLAG__Wno_error_literal_suffix -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -Wno-error=literal-suffix -o CMakeFiles/cmTC_db53f.dir/src.c.o -c /Users/heliang/Paddle/build/CMakeFiles/CMakeTmp/src.c warning: unknown warning option '-Werror=literal-suffix'; did you mean '-Werror=literal-range'? [-Wunknown-warning-option] 1 warning generated. Linking C executable cmTC_db53f /usr/local/Cellar/cmake/3.14.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_db53f.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wno-deprecated-register -DC_COMPILER_SUPPORT_FLAG__Wno_error_literal_suffix -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_db53f.dir/src.c.o -o cmTC_db53f
Source file was: int main(void) { return 0; }