Windows编译OpenBLAS
在尝试用 LazyNet 时,由于原作者提供的OpenCV和OpenBLAS版本和我的环境不一样,考虑自行配置依赖。 OpenCV源码编译的文章很多,这里主要说一下OpenBLAS的编译。 cblas_sgemm crash 基于VS2017的MSVC编译器,编译安装openblas develop分支最新版,发现 LazyNet 代码有crash(access violation),而在Linux(ubuntu16.04,G++/Clang++-8)则运行正常。剥离出来的复现问题的最小化代码见下方,解决办法是 用clang-cl(Windows下和MSVC兼容的clang编译器)重新编译OpenBLAS , 讨论帖在此 。 #include <stdio.h> extern "C" { #include <cblas.h> } int main() { printf("OpenBLAS config info:\n%s\n", openblas_get_config()); #if 1 // will cause crash on VS2017 x64 with OpenBLAS latest const int M = 16; const int N = 676; const int K = 27; #else // won't crash const int M = 4;