cpu2017的526.blender编译出错原因

结论先行: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……欢迎拍砖、补充^_^

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值