简体   繁体   中英

NVCC and Boost 1.60 error: identifier "__float128" is undefined

I am trying to compile caffe from BVLC ( https://github.com/BVLC/caffe ) but I run into a peculiar error:

NVCC src/caffe/util/math_functions.cu
/usr/local/boost/config/suffix.hpp(510): error: identifier "__float128" is undefined

It appears to be that when running nvcc on boost it is complaining about the __float128 type.

I googled around and found a devtalk.nvidia forum post but I do not really understand how to solve this issue.

I even opened a github issue but have not as of yet gotten a reply.

I am using nvcc-6.5 boost 1.60 with gcc-4.8.4 on Debian 8 (I manually installed boost) and the offending line seems to be at line #510:

 506 // same again for __float128:                                                                                                          
 507 #if defined(BOOST_HAS_FLOAT128) && defined(__cplusplus)                                                                                
 508 namespace boost {                                                                                                                      
 509 #  ifdef __GNUC__                                                                                                                      
 510    __extension__ typedef __float128 float128_type;                                                                                     
 511 #  else                                                                                                                                
 512    typedef __float128 float128_type;                                                                                                   
 513 #  endif                                                                                                                               
 514 }                                                                                                                                      
 515 #endif    

A similar issue in fftw3 seems to suggest that nvcc self-identifies as __GNUC__ thereby creating he problem?

Is there some work-around for this?

According to a bug report for boost this is actually a problem of boost 1.60.

You have several options:

  • in the link it is mentioned that nvcc (from CUDA 7.5) can deal with __float128 if you use -std=c++11 . You need to check if that is an option for caffee .
  • you might try downgrading boost to 1.59 (the problematic line was introduced with 1.60).
  • apply the patch that is mentioned in the link.

I had the same issue. Building and installing boost 1.61 solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM