2 下载Caffe
https://github.com/BVLC/caffe
git clone https://github.com/BVLC/caffe
3 配置编译(切换到caffe根目录)
cd caffe
cp Makefile.config.example Makefile.config
gedit Makefile.config(打开Makefile.config文件)
找到# CPU_ONLY := 1 并去掉#号,因为现在只有cpu。最后结果为:
CPU_ONLY := 1
其他默认就可以了。
4 编译
mkdir build && cd build && cmake .. && make -j4
我的编译过程中在make的时候出现下面的错误。
/usr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libgflags.a: 无法添加符号: 错误的值
查了git上面caffe包的issue,才知道出现这个问题是因为我的gflags安装的动态链接库没有设置成fPIC。
5 解决方法
gflags是我之前编译安装的,现在我需要安装caffe的要求重新在源码包中再安装一次。
具体还是,
git clone https://github.com/gflags/gflags
cd gflags
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make && make install
这样就ok了!成功将gflags的动态链接库设置成了fPIC方式。
下面再让我们切换到caffe中进行编译吧。
http://blog.csdn.net/u010402483/article/details/51506616
https://github.com/BVLC/caffe/issues/2171
https://www.cnblogs.com/cswuyg/p/3830703.html
http://caffe.berkeleyvision.org/install_apt.html
想要实现环境:ubuntu16.04 + CPU +caffe 由于课题需要一直说要在自己电脑上面配置一下caffe库,自己电脑只有CPU,中间遇到了一些小问题,现总结一下,方便以后使用。1 安装依赖项1 sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libh
1.error while loading shared libraries: .so: cannot open shared object file: No such file or directory
可
使用
ldd查看依赖库的信息
然后可以sudo cp (lib_path)/.so. /usr/local/lib/so. && sudo ldconfig
"libgflags." a: 无法添加符号: 错误的值0.introduction1.solved2.install
0.introduction
Ubuntu
16.04
带cuda10.1安装opencv4.1.0.编译的时候报错:
libgflags nothreads.a: 无法添加符号: 错误的值
查了半天还真没找到解决方案.可能key words不对.
1.solved
看到名字就想着...
编译PCL时遇到CMake Error at /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:45 (message):common is required but boost was not found解决办法
昨天修改代码,编译的时候遇到/usr/bin/ld: 找不到 -lopencv_xphoto/usr/lib/x86_64-linux-gnu/libboost_system.so collect2: error: ld returned 1
编译
caffe
需要安装的东西:
install libatlas-base-dev
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev
sudo apt-get install libgflags-dev libgoog...
在issue下找到同样
问题
https://github.com/flexible-collision-library/fcl/issues/226https://github.com/flexible-collision-library/fcl/issues/226原因,这个ccd的库在编译时不能
使用
静态的方式直接把libccd.a 拷贝到/usr/local/lib/目录下,解决办法,参考github上几个人说的还有
c++ - What is the idiomatic way in CMAKE
错误是这样的:
/usr/local/lib/libgflags.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status
glog是通过下面方式安装的:
sudo apt-get install build-essential
sudo apt-get install vim cmake
在安装
caffe
的过程中,遇到了很多
问题
,网上都能找到答案,记录以下几个网上没有直接答案的
问题
。
nvcc fatal : Unknown option ‘f
PIC
’
nvcc本身不支持-f
PIC
编译参数,但是却提供了-Xcompiler
用途上,
使用
nvcc -h可以发现,这是提供了向低级编译工具(gcc)传递编译参数的功能,因此在编译.cu文件时...
编译报错:/usr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32S against `.rodata‘
这两天在
ubuntu
14.04的环境中,由于gflags的错误安装导致
caffe
编译的时候
出现
如下错误:
这里涉及到gflags的安装,原来
使用
sudo apt-get install libgflags-dev
但是后面有人在环境中下载安装了libgflags的安装包,解压后直接安装:
mkdir build
cd build
cmake ..
make test
NVCC src/
caffe
/layers/absval_layer.cu
nvcc fatal : Unsupported gpu architecture 'compute_20'
Makefile:604: recipe for target '.build_release/cuda/src/
caffe
/layers/absval_layer.o' failed
make: ***...
ubuntu
14.04安装
配置
FFmpeg+opencv-3.1.0+python 调用opencv模块
这次因为写python时候要调opencv的函数,在
ubuntu
14.04安装了opencv,中间
出现
一个安装错误:
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against ...