How to use boost::multiprecision::float128 in with Xcode

痴心易碎 提交于 2021-01-27 12:11:25

问题


I am trying to use boost::multiprecision::float128 in xCode project.

My compiler version is Apple clang version 11.0.0 (clang-1100.0.20.17) Target: x86_64-apple-darwin18.7.0 Thread model: posix

I am using boost.1.71.0

I am getting following compile error

'quadmath.h' file not found

in float128.hpp

extern "C" {
#include <quadmath.h>
}

I saw several threads regarding to this issue

  • https://svn.boost.org/trac10/ticket/8265

    19 months ago by John Maddock (clang has no support for float128 and libquadmath, so you're out of luck: that header is supported by gcc and Intel compilers only.)

  • https://forums.developer.apple.com/thread/44405

As discussion threads I have find are few years old

  • so is it still true that I can't use boost::multiprecision::float128 in xCode project ?
  • might it be something missing during boost setup, it has lib folder and during boost set up something get lost ?
  • Is there any workaround for this problem, with my current compiler version?

回答1:


Sadly, it's still not supported. There is more hope for "vanilla clang", than for Apple clang, but still, there's a lot of work to be done to make sure all the pieces are in place.

The issue to follow is here, and work has been done to get it to compile with clang >=8. But Apple Clang still doesn't work.

As a workaround, you can use boost::multiprecision::cpp_bin_float_quad.



来源:https://stackoverflow.com/questions/57755032/how-to-use-boostmultiprecisionfloat128-in-with-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!