sourceCpp 错误:不是 mach-o 或静态库文件 '/usr/local/lib/libgfortran.dylib'
我长期以来一直是 RcppArmadillo 的用户,但自从将我的操作系统升级到 Monterey 版本 12.3 以来,一直无法通过 sourceCpp 编译任何程序。
出现以下错误:
ld: malformed universal file: slice content is not mach-o or a static library file '/usr/local/lib/libgfortran.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sourceCpp_2.so] Error 1
I've long been a user of RcppArmadillo, but have been unable to compile any programs via sourceCpp since upgrading my OS to Monterey Version 12.3.
Getting the following error:
ld: malformed universal file: slice content is not mach-o or a static library file '/usr/local/lib/libgfortran.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sourceCpp_2.so] Error 1
It seems like this has something to do with static vs dynamic linking judging by the post here but I really have no idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当我升级到 Xcode 13.3 时,我遇到了同样的 ld 错误。我已经恢复到 13.2,并且我的项目构建没有错误。我将继续使用 13.2,直到看到更多有关导致此问题的原因的信息。
I got the same ld error when I upgraded to Xcode 13.3. I've reverted to 13.2 and my projects build with no errors. I'll stay with 13.2 until I see more information coming out on what's causing this problem.
重新安装 RcppArmadillo
-> install.packages("RcppArmadillo", type = "source")
如果出现问题,请尝试修改 makeconf 文件:
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin21/11.2.0
#-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
Reinstall RcppArmadillo
-> install.packages("RcppArmadillo", type = "source")
If something wrong, try to modify your makeconf file:
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin21/11.2.0
#-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
这是来自 XCode 13.3 发行说明。我想这个问题与此更改有关。
This is from the XCode 13.3 release notes. I guess the issue is related to this change.