nsight 使用caffe。

http://www.pittnuts.com/2015/06/build-and-debug-caffe-in-nsight/  参考博客 

不用配置,直接在nsight中导入原有工程caffe-master就可以了。。


Build and Debug Caffe in Eclipse Nsight

 

For those who want to debug and dig into the source code of Caffe, it may be better to build and debug it in a graphic IDE. This post records my success of building and debugging Caffe in Nvidia’s Eclipse Nsight.

I detoured far far away before figuring out this extremely simple solution:

Environment: Ubuntu 14.04

 

To build:

1. Follow Caffe Installation tutorial to install all prerequisites;

2. git clone Caffe to $CAFFE_ROOT;

git clone https://github.com/BVLC/caffe.git $CAFFE_ROOT

3. cp Makefile.config.example Makefile.config and configure your parameters (ex. turn debug mode by uncommenting DEBUG := 1);

4. run “nsight” in the terimal to launch Nsignt IDE;

5. in Nsight, File -> New -> Makefile Project with Existing Code, and browse $CAFFE_ROOT

6. Just build and all is done!!!

 

To debug

1. make sure you turned on DEBUG := 1 when you built Caffe;

2. open the source file of the executive binary you want to debug (generally, there is a main function);

3. click “Debug”!! (You may add a Debug Configuration for every executive program).
Debug Caffe in Eclipse Nsight

Fix includes and symbols unfound problem:

1. include all header folders in Properties -> General -> Paths and Symbols. Use following command to find the default header search paths and add them into the Includes tab
cpp -x c++ -Wp,-v # for cpp
cpp -x c -Wp,-v # for c

 


Archived (just for backup)


1. Follow Caffe Installation tutorial to install all prerequisites;

2. run “nsight” in the terimal to launch Nsignt IDE

3. new a Cuda c/c++ project in Nsight

4. git clone Caffe under Nsight project ($CAFFE_ROOT), and refresh the project folder in Nsight

git clone https://github.com/BVLC/caffe.git

5. configure “include path” of the compiler (During building, if any header file is unfound, just use “locate/find” command to check where it is and include its location in the build configuration)

6.generate caffe.pb.h manually

protoc src/caffe/proto/caffe.proto –cpp_out=.
mkdir include/caffe/proto
#mv src/caffe/proto/caffe.pb.h include/caffe/proto (unnecessary if you included $CAFFE_ROOT/src )

7. For following error, check if and where you install python, and include /usr/include/python2.7, in my case

../caffe/python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory

8. fatal error: src/caffe/proto/caffe.pb.h: No such file or directory (Fix it by including $CAFFE_ROOT)

9. ../caffe/matlab/+caffe/private/caffe_.cpp:16:17: fatal error: mex.h: No such file or directory

ensure you installed matlab, “locate” and include the path of mex.h (in my case, /usr/local/MATLAB/R2014b/extern/include)

(Just for backup)…

--------------------------------------------------

 加载工程 之后, 把脚本命令 放到 nsight 配置设置中去.如果在Linux下 编译好的话,在这里可以直接运行


配置文件 主要配置 程序运行的入口函数 和  配置参数 如下图所示:












  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值