Mac OSX 10.13安装RQuantLib时出现Non Zero excess status错误求助
Hey Rory, sorry to hear you're stuck getting RQuantLib up and running—let's walk through the most common fixes for this issue, since you already have your Homebrew dependencies set up. Here are actionable steps to try:
Verify QuantLib version compatibility
RQuantLib has strict version matching rules with the underlying QuantLib library. First, check which version of QuantLib Homebrew installed:brew list --versions quantlibFor R 3.4.3, you’ll likely need an older QuantLib release (e.g., 1.15.x—newer versions often don’t play nice with older R builds). If you have a newer QuantLib installed, downgrade it with:
brew install quantlib@1.15 brew link --force quantlib@1.15Set environment variables to help R locate QuantLib
Sometimes R can’t find Homebrew-installed libraries by default. Before installing RQuantLib, run these commands in your terminal (then launch R from that same terminal session):export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" export DYLD_LIBRARY_PATH="/usr/local/lib"Alternatively, set these directly in R before running the install command:
Sys.setenv(PKG_CONFIG_PATH="/usr/local/lib/pkgconfig") Sys.setenv(DYLD_LIBRARY_PATH="/usr/local/lib")Install from source with explicit library paths
Force a source install and tell R exactly where to find QuantLib’s headers and libraries (Homebrew defaults to/usr/local):install.packages("RQuantLib", type = "source", configure.args = "--with-quantlib-include=/usr/local/include --with-quantlib-lib=/usr/local/lib")Check Xcode Command Line Tools
macOS High Sierra needs compatible Xcode Command Line Tools. Verify they’re installed and up-to-date:xcode-select --installIf you already have them installed, make sure they match your OS version—you might need to download an older XCLT build from Apple’s developer site if the current one is too new.
Clear old build caches
Residual files from failed installs can cause weird issues. First, remove any partial RQuantLib installation:remove.packages("RQuantLib")Then clean up Homebrew’s cached files:
brew cleanup quantlibAlso, delete leftover build files in R’s temporary directory (you can find this path with
tempdir()in R).
If you’re still hitting errors, sharing the exact error message from R (especially the compilation logs at the bottom) would help narrow things down even further!
内容的提问来源于stack exchange,提问作者Rory Mcstay

