Linking with BLAS OS X
Linking with BLAS OS X
我目前正在尝试使用我不太熟悉的库编译程序。当我运行编译器时,我得到以下输出/错误:
Undefined symbols for architecture x86_64:
"_cblas_ddot", referenced from:
shark::LDA::train(shark::LinearClassifier<shark::blas::vector<double> >&, shark::LabeledData<shark::blas::vector<double>, unsigned int> const&) in libshark.a(LDA.cpp.o)
shark::LDA::train(shark::LinearClassifier<shark::blas::vector<double> >&, shark::WeightedLabeledData<shark::blas::vector<double>, unsigned int> const&) in libshark.a(LDA.cpp.o)
我目前的想法是,这是从丢失的BLAS库,我刚刚下载和编译(从fortran代码?)。
用于编译的命令行参数如下所示
g++ -o example -I/to/boost/include -I/to/shark/include -L/to/boost/lib -L/to/shark/lib -L/to/BLAS -lshark -lblas -l(boost_flags)
在/to/BLAS
中有一个libblas.a
,我运行nm libblas.a
,它给出了一行
libblas.a(ddot.o):
00000000000001c0 s EH_frame1
0000000000000000 T _ddot_
在不太安全的情况下,我假设这意味着库确实有该符号,但没有_cblas_
前缀。
从这一点我能做什么?我可以更改符号名称吗?或者我需要将这个库与其他东西连接起来吗?
我用的是OS X Mavericks
提前感谢:)
OS X已经安装了BLAS(包括cblas)(它是加速框架的一部分)。没有必要下载并构建自己的。链接到-lcblas
.
解决方案是由Logicrat建议的,我需要其他文件,我从这里下载了源代码,并使用cmake/make非常无缝地构建它。与由此产生的库链接解决了这个问题。
相关文章:
- "ostream &os"有什么用?
- libprotobuf 检查在 Mac OS 上执行程序时失败
- C++读取用户输入而不按回车键(Mac OS X),与Turbo Pascal中的读取键相同
- 如何在 MAC OS c/c++ 中阻止 USB 存储设备
- 编译 Boost 时在 OS X 上的"ld:未知选项:-soname"
- 在 c++ 中检查 Windows OS 服务器版本
- OS X: ld: 找不到 -lstdc++ 的库
- Python os.system() 返回错误值
- Mac os x app bundle 在下载并运行时崩溃,但在终端或更改 Info.plist 时运行良好
- const 如何防止写入特定内存 [Clang, Mac OS]
- 旧C++代码中的目录查找导致 OS X Catalina 10.15 中的目录错误
- 如何在 Mac OS 上安装 boost-mpi 及其对 clang 的依赖关系?
- 在 Mac OS 中将 QT 与 CMAKE 集成
- Homebrew OS X OpenCV - 在另一台Mac上运行时寻找dylib
- 使用C/C++访问OS X密钥链
- 谷歌测试编译错误 Os X:函数式转换从"int"到"internal::FloatingEq2Matcher"的模糊转换<float>
- 从我的2d数组中的一列返回的字符串值被压缩为一个字符串(在Mac os上打开Windows txt文件)
- VK_ERROR_INCOMPATIBLE_DRIVER with Mac OS and Vulkan MoltenVK
- 编译过程中无法从加速框架中链接BLAS -OS Yosemite 10.0.5
- Linking with BLAS OS X