caffe下使用g++编译cpp文件时 遇到 fatal error: cublas_v2.h: 没有那个文件或目录
2017-09-18 23:31
996 查看
一、前言
在caffe下使用g++编译cpp文件生成bin文件时突然遇到 fatal error: cublas_v2.h: 没有那个文件或目录 这个吐血问题,通过查找资料找到解决的方法了
二、g++编译生成bin文件
本人的编译命令是 g++ ***.cpp -o ***.bin -I /caffe-root/include -I /caffe-root/.build_release/src/ -L /caffe-root/build/lib/ -lcaffe -lcuda -lglog -lboost_system `pkg-config opencv --libs --cflags` ;不好意思有点长了,不过我是故意的,运行遇到报错如下:
通过查找资料,发现需要将cublas_v2.h 所在的 include 和lib 路径加入到链接中去,我的路径在 /usr/local/cuda-7.5/targets/x86_64-linux/include/ 以及/usr/local/cuda-7.5/targets/x86_64-linux/lib/ ,故将其加入至原来的编译命令链接中去,如下:
g++ ***.cpp -o ***.bin -I /caffe-root/include -I /caffe-root/.build_release/src/ -I /usr/local/cuda/targets/x86_64-linux/include/ -L /usr/local/cuda-7.5/targets/x86_64-linux/lib/ -L /caffe-root/build/lib/ -lcaffe
-lcuda -lglog -lboost_system `pkg-config opencv --libs --cflags`
运行则无错误,参考自这篇博文http://blog.csdn.net/vbskj/article/details/52120475
在caffe下使用g++编译cpp文件生成bin文件时突然遇到 fatal error: cublas_v2.h: 没有那个文件或目录 这个吐血问题,通过查找资料找到解决的方法了
二、g++编译生成bin文件
本人的编译命令是 g++ ***.cpp -o ***.bin -I /caffe-root/include -I /caffe-root/.build_release/src/ -L /caffe-root/build/lib/ -lcaffe -lcuda -lglog -lboost_system `pkg-config opencv --libs --cflags` ;不好意思有点长了,不过我是故意的,运行遇到报错如下:
通过查找资料,发现需要将cublas_v2.h 所在的 include 和lib 路径加入到链接中去,我的路径在 /usr/local/cuda-7.5/targets/x86_64-linux/include/ 以及/usr/local/cuda-7.5/targets/x86_64-linux/lib/ ,故将其加入至原来的编译命令链接中去,如下:
g++ ***.cpp -o ***.bin -I /caffe-root/include -I /caffe-root/.build_release/src/ -I /usr/local/cuda/targets/x86_64-linux/include/ -L /usr/local/cuda-7.5/targets/x86_64-linux/lib/ -L /caffe-root/build/lib/ -lcaffe
-lcuda -lglog -lboost_system `pkg-config opencv --libs --cflags`
运行则无错误,参考自这篇博文http://blog.csdn.net/vbskj/article/details/52120475
相关文章推荐
- ubuntu16.04 cuda8.0 caffe 编译时遇到 caffe fatal error: cublas_v2.h 没有那个文件或目录
- python/caffe/_caffe.cpp:47:31: fatal error: numpy/arrayobject.h: 没有那个文件或目录
- 解决ubuntu下编译安装Lua时提示lua.c:80:31: fatal error: readline/readline.h: 没有那个文件或目录
- Android的编译时遇到 gcc: error trying to exec 'cc1plus': execvp: 没有那个文件或目录 ...
- 编译lua.c:80:31: fatal error: readline/readline.h: 没有那个文件或目录
- g++: error: simple_net.cpp: 没有那个文件或目录
- 编译 pycaffe时报错:fatal error: numpy/arrayobject.h没有那个文件或目录
- 编译 pycaffe时报错:fatal error: numpy/arrayobject.h没有那个文件或目录
- 解决ubuntu下编译安装Lua时提示lua.c:80:31: fatal error: readline/readline.h: 没有那个文件或目录
- 64位Ubuntu14.04编译busybox: fatal error: curses.h:没有那个文件或目录
- ./include/caffe/common.hpp:4:32: fatal error: boost/shared_ptr.hpp: 没有那个文件或目录
- ubunutu下使用g++ 编译错误之没有那个文件或目录
- linux下用gcc编译c程序时遇到的问题: error: stdio.h: 没有那个文件或目录
- ./include/caffe/common.hpp:4:32: fatal error: boost/shared_ptr.hpp: 没有那个文件或目录
- 编译 pycaffe时报错:fatal error: numpy/arrayobject.h没有那个文件或目录
- ubuntu编译android,遇到asm/byteorder.h:没有那个文件或目录
- caffe 编译中出现的错误——fatal error: hdf5.h: 没有那个文件或目录
- g++: error trying to exec 'cc1plus': execvp: 没有那个文件或目录
- ubuntu编译android2.2.1,遇到asm/byteorder.h:没有那个文件或目录
- make menuconfig时出现致命错误:fatal error: curses.h: 没有那个文件或目录