caffe boost cuda __float128 undefined

本文解决在Ubuntu14.04下使用CUDA7.5.18, Boost1.60, GCC4.8, OpenCV3.1编译Caffe时遇到的__float128未定义错误。通过修改boost/gcc.hpp文件中的定义解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载:https://blog.youkuaiyun.com/thesby/article/details/50512886

 

编译caffe-master时遇到的问题,__float128未定义,使用到cuda版本为7.5.18,boost为1.60,gcc为4.8,opencv为3.1,操作系统为ubuntu14.04,报错如下:

/usr/local/include/boost/config/suffix.hpp(510): error: identifier "__float128" is undefined

1 error detected in the compilation of "/tmp/tmpxft_00003571_00000000-16_threshold_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/threshold_layer.o] Error 1
make: *** Waiting for unfinished jobs....
/usr/local/include/boost/config/suffix.hpp(510): error: identifier "__float128" is undefined

1 error detected in the compilation of "/tmp/tmpxft_00003578_00000000-16_batch_reindex_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/batch_reindex_layer.o] Error 1
/usr/local/include/boost/config/suffix.hpp(510): error: identifier "__float128" is undefined

1 error detected in the compilation of "/tmp/tmpxft_0000357f_00000000-16_reduction_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/reduction_layer.o] Error 1
/usr/local/include/boost/config/suffix.hpp(510): error: identifier "__float128" is undefined

1 error detected in the compilation of "/tmp/tmpxft_00003588_00000000-16_softmax_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/softmax_layer.o] Error 1

 


问题在于boost到gcc.h头文件定义存在bug。解决方法就是:

sudo gedit /usr/local/include/boost/config/compiler/gcc.hpp
1
把第156行到内容由

#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
1
修改为:

#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__) && !defined(__CUDACC__)
---------------------

转载于:https://www.cnblogs.com/haiyang21/p/9928853.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值