英文:
CMake, Boost multiprecision float128 and Clang "fatal error: 'quadmath.h' file not found"
问题
我正在使用CMake在Ubuntu 22.04上使用Clang14编译我的项目。我在CMake方面不是很高级,但我勉强能够应付。
我刚刚从Boost版本1.74中添加了float128:
#include <boost/multiprecision/float128.hpp>
boost::multiprecision::float128 var = 0.1;
但不幸的是,我现在遇到了编译器错误:
/usr/include/boost/multiprecision/float128.hpp:40:10: 致命错误:找不到'quadmath.h'文件
我可以看到我的系统有这个库:/usr/lib/gcc/x86_64-linux-gnu/11/libquadmath.a
,但我不确定在我的CMake脚本中需要做什么。我尝试过:
find_library(quadmath NAMES quadmath.a)
但这没有起作用。我可能需要将头文件添加到包含路径,但我不确定它在哪里/如何添加?我还读到float128使用GCC或Intel的float128类型。这是否与问题相关?
英文:
I'm using CMake to compile my project with Clang14 on Ubuntu 22.04. I'm not very advanced with CMake, but I get by.
I've just added float128 from my Boost version 1.74:
#include <boost/multiprecision/float128.hpp>
boost::multiprecision::float128 var 0.1;
to my project but unfortunately I now get the compiler error:
/usr/include/boost/multiprecision/float128.hpp:40:10: fatal error: 'quadmath.h' file not found
I can see my system has the library: /usr/lib/gcc/x86_64-linux-gnu/11/libquadmath.a
but I am unsure what I need to do in my CMake script? I tried:
find_library(quadmath NAMES quadmath.a)
but this hasn't worked. I probably need to add the header to the include path but I'm not sure where it is/how to do this?
I have also read that float128 uses GCC or Intel float128 type. Is this related to the issue?
答案1
得分: 0
抱歉,clang不支持quadmath:github.com/boostorg/math/issues/181
英文:
Sadly, clang does not support quadmath: github.com/boostorg/math/issues/181
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论