在 macOS 10.12 Sierra 上安装 QuantLib

QuantLib Installation on macOS 10.12 Sierra

我正在尝试在 macOS Sierra 上安装 QuantLib,但是当我 运行 最后检查时:

g++ -I/usr/local/include/ -I/usr/local/include/boost BermudanSwaption.cpp \
    -o bermudanswaption -L/usr/local/lib/ -lQuantLib

我收到以下错误。

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我通过 Homebrew 安装了 boost。当我 运行 brew install boost 时,我收到 boost-1.63.0 already installed。我最初使用 Homebrew 选项按照说明 here 进行操作,但在编译时收到了相同的最终错误和弃用警告:

warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9

我将命令更改为以下内容,弃用警告消失了,但最后的错误仍然存​​在。

./configure --with-boost-include=/usr/local/include/ \
            --with-boost-lib=/usr/local/lib/ --prefix=/usr/local/ \
            CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
            LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9'

make && sudo make install

目前我发现最好的是 运行 brew install quantlib