【问题标题】:Problem installing QuantLib on MacOS Big Sur: ./configure cannot find boost header/library在 MacOS Big Sur 上安装 QuantLib 时出现问题:./configure 找不到 boost header/library
【发布时间】:2021-03-30 17:11:01
【问题描述】:

您好 QuantLib 用户,

我正在尝试在运行 Big Sur 的 iMac 上安装 QuantLib,按照此处的(有点过时?)步骤:https://www.quantlib.org/install/macosx.shtml

问题

尽管安装了 boost,但我收到以下错误:

checking for Boost development files... no
configure: error: Boost development files not found

有人知道我为什么会得到这个吗?

背景

我跑了brew install boost,并验证了这一点

  • /usr/local/lib 下是boost 库文件,例如libboost_chrono-mt.a 符号链接到../Cellar/boost/1.75.0/lib/ 中的位置
  • 符号链接/usr/local/include/boost 指向/usr/local/Cellar/boost/1.75.0/include/boost 中的头文件

我运行的配置命令是:

./configure --disable-shared --with-boost-include=/usr/local/include/ --with-boost-lib=/usr/local/lib/ --prefix=/usr/local/ CXXFLAGS='-O3 -stdlib=libc++ -mmacosx-version-min=11’ LDFLAGS='-stdlib=libc++’

为了确定,我也运行了以下命令,但得到了同样的错误:

./configure --disable-shared --with-boost-include=/usr/local/Cellar/boost/1.75.0/include/ --with-boost-lib=/usr/local/Cellar/boost/1.75.0/lib/ --prefix=/usr/local/ CXXFLAGS='-O3 -stdlib=libc++ -mmacosx-version-min=11’ LDFLAGS='-stdlib=libc++’

提前感谢任何见解!!!

###############下面回复Luigi的建议################

我按照你的建议查看了 config.log,有一堆失败但没有提到boost

第一个是:

#1

configure:4324: g++ -c -O3 -stdlib=libc++ -mmacosx-version-min=11’ LDFLAGS=-stdlib=libc++’  -I/usr/local/include conftest.cpp >&5
clang: error: no such file or directory: 'LDFLAGS=-stdlib=libc++’'
clang: error: invalid version number in '-mmacosx-version-min=11’'
configure:4324: $? = 1

这 --> 我对 Big Sur 所需的原始指令的修改可能不正确的猜测(顺便说一句,知道正确的修改应该是什么吗?)

还有另外 3 种失败类型(每种都会重复),它们是:

#2

configure:4290: g++ -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:4301: $? = 1

#3

configure:4604: gcc -E  -I/usr/local/include conftest.c
conftest.c:11:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
configure:4604: $? = 1

#4

configure:6395: ar cru libconftest.a @conftest.lst >&5
ar: @conftest.lst: No such file or directory
configure:6398: $? = 1

这些有没有给你一些线索?

【问题讨论】:

  • 您可以查看生成的config.log 文件吗?它可能会显示编译器报告的实际错误。
  • 谢谢路易吉!我无法将内容以正确的格式作为评论...让我尝试将我的回复放在我的原始帖子中
  • #3 没问题,因为它必须是“不存在的”:-) unix.stackexchange.com/questions/360506/…

标签: boost quantlib macos-big-sur


【解决方案1】:

如果您完全按照您在问题中复制的方式运行配置命令,即

./configure --disable-shared --with-boost-include=/usr/local/include/ --with-boost-lib=/usr/local/lib/ --prefix=/usr/local/ CXXFLAGS='-O3 -stdlib=libc++ -mmacosx-version-min=11’ LDFLAGS='-stdlib=libc++’

您正在关闭应该是 CXXFLAGS,而不是 '。这意味着它并没有真正关闭,它运行到下一个';您可以在上面的格式中看到,它以绿色显示字符串。对于应该关闭LDFLAGS 也是如此。相反,使用

./configure --disable-shared --with-boost-include=/usr/local/include/ --with-boost-lib=/usr/local/lib/ --prefix=/usr/local/ CXXFLAGS='-O3 -stdlib=libc++ -mmacosx-version-min=11' LDFLAGS='-stdlib=libc++'

现在,为了确保这对其他人来说不是问题:我检查了 QuantLib 站点,那里的命令似乎是正确的。我猜您的浏览器或您的编辑器试图对引号进行一些花哨的格式设置。如果您编写了如何将命令从指令复制到终端,这将很有用,因此我们可以警告它。谢谢!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-28
    • 2021-03-11
    • 2021-06-19
    • 2021-08-04
    • 2021-05-31
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多