结论先行:Ubuntu版本较高带来的问题,Ubuntu18.04(4.18.0) fail,Ubuntu16.04(4.8.0) pass。
1.已知的invalid use of ‘__builtin_va_arg_pack ()’问题
拿到CPU2017,直接使用示例文件Example-gcc-linux-x86.cfg进行test时,肯定会fail,部分原因,这篇文章已经提到一部分:https://blog.csdn.net/yi_1973/article/details/83150183,我这里的处理方法是先把216行开始的两部分合并,有啥负面影响再看吧
216 intrate,intspeed=base: # flags for integer base
217 #%if %{bits} == 32
218 EXTRA_COPTIMIZE = -fgnu89-inline -fno-strict-aliasing
219 #%else
220 # EXTRA_COPTIMIZE = -fno-strict-aliasing
221 LDCFLAGS = -z muldefs
222 #%endif
2.526.blender编译时struct timespec无定义问题
测试时发现了一个526.blender编译的新问题,log如下:
blender/source/blender/blenlib/intern/threads.c:845:33: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
static void wait_timeout(struct timespec *timeout, int ms)
^~~~~~~~
blender/source/blender/blenlib/intern/threads.c: In function 'wait_timeout':
blender/source/blender/blenlib/intern/threads.c:868:9: error: dereferencing pointer to incomplete type 'struct timespec'
timeout->tv_sec = sec + div_result.quot;
^~
blender/source/blender/blenlib/intern/threads.c: In function 'BLI_thread_queue_pop_timeout':
blender/source/blender/blenlib/intern/threads.c:884:18: error: storage size of 'timeout' isn't known
struct timespec timeout;
大概就是说struct timespec没有定义。事实上,该结构体是一个系统变量,其定义在<time.h>中,即/usr/include/time.h。
查看出错文件./benchspec/CPU/526.blender_r/src/blender/source/blender/blenlib/intern/threads.c,包含的系统头文件主要有:
#ifdef WIN32
# include <windows.h>
# include <sys/timeb.h>
#elif defined(__APPLE__)
# include <sys/types.h>
# include <sys/sysctl.h>
#else
# include <unistd.h>
# include <sys/time.h>
#endif
有关的就是<sys/time.h>,我们查看下该文件:
A. Ubuntu18.04:
#include <bits/types.h>
#include <bits/types/time_t.h>
#include <bits/types/struct_timeval.h>
#ifndef __suseconds_t_defined
typedef __suseconds_t suseconds_t;
# define __suseconds_t_defined
#endif
#include <sys/select.h>
B. Ubuntu16.04的如下:
#include <bits/types.h>
#define __need_time_t
#include <time.h> /* 这里包含了/usr/include/time.h文件 */
#define __need_timeval
#include <bits/time.h>
#include <sys/select.h>
可见,Ubuntu18.04的版本里,移除了该头文件,其它包含文件中也没有包含。
知道了这个原因,直接修改threads.c文件,添加#include <time.h>,结果又产生新的错误,尚未解决……
目前的做法就是换成了Ubuntu16.04继续玩~
done for now……欢迎拍砖、补充^_^