在 CMake 中,我使用find_package(BLAS REQUIRED)并酌情使用BLAS_FOUND, BLAS_LINKER_FLAGS,BLAS_LIBRARIES变量。
我的问题是,我如何根据已选择的 BLAS 实现,找到应包含在 CMake 中的包含目录?
BLAS_INCLUDE_DIR没有在 macOS 上为 Accelerate 框架或 OpenBLAS 设置。它也不是 FindBLAS 文档的一部分。
我现在花了太多时间试图让下面的代码不是段错误.有人可以解释我为什么会这样做吗?
我知道问题出在某个未初始化的内存中.
#include <iostream>
#include <vector>
using namespace std;
struct node {
vector<int> parents;
};
int main() {
vector<node> nodedb;
{
node df;
nodedb.push_back(move(df));
}
{
node &existing_node = nodedb[0];
for (int i = 0; i < 100; ++i) {
node df;
nodedb.push_back(move(df));
existing_node.parents.push_back(0);
}
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)