Build Caffe on macOS Sierra 10.12.2 and 2016 MacBook Pro with OpenCL support

232 views
Skip to first unread message

Christoph

unread,
Jan 1, 2017, 3:03:25 PM1/1/17
to Caffe Users
Hello together,
I am new to caffe and try to get things setup. I try to build caffe from the OpenCL branch at 


The build breaks as soon as the first .cu file shall be compiled.  Seems that the stdlib is not found. However, for cpp files this seems not to be an issue. From the build order the file absval_layer.cu (see command line below) is the first cu file which shall be compiled. I suspect that clang needs to be made aware that a cu file has to be interpreted as a c++ file. However, I have no idea how this could be done. It would be great if someone could give me some hints on how to proceed from here. Even better would be if someone is aware of an description on how to setup caffe with OpenCL support on a new Mac book pro with amd graphics and OpenCL support. It would be great if you could share the link.
Thanks.

Best regards,
 Christoph

 Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/absval_layer.cu.o

cd /usr/local/caffe/build/src/caffe && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -DBOOST_ALL_NO_LIB -DCAFFE_VERSION=1.0.0-rc3 -DGTEST_USE_OWN_TR1_TUPLE -DUSE_ACCELERATE -DUSE_GREENTEA -DUSE_LEVELDB -DUSE_LIBDNN -DUSE_LMDB -DUSE_OPENCV -DVIENNACL_WITH_OPENCL -DWITH_PYTHON_LAYER -Dcaffe_EXPORTS -I/usr/local/caffe/src -isystem /usr/local/caffe/PUBLIC -isystem /usr/local/include -I/usr/local/caffe/build/include -isystem /usr/local/Cellar/hdf5/1.8.18/include -isystem /usr/local/opt/szip/include -I/usr/local/include/opencv -I/usr/local/caffe/PRIVATE -I/usr/local/caffe/viennacl-dev -I/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers -I/usr/include/python2.7 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/caffe/include -I/usr/local/caffe/build  -fPIC -Wall -std=c++11 -DCMAKE_BUILD -Wno-sign-compare -Wno-uninitialized -O3 -DNDEBUG -fPIC   -o CMakeFiles/caffe.dir/layers/absval_layer.cu.o -c /usr/local/caffe/src/caffe/layers/absval_layer.cu

/usr/local/caffe/src/caffe/layers/absval_layer.cu:1:10: fatal error: 'vector' file not found

#include <vector>

         ^

1 error generated.

fatal error: cannot open file '/var/folders/zj/tcr0d7td73l2djfx52v2ps000000gn/T/absval_layer-812081.fatbin': No such file or directory

1 error generated.

make[2]: *** [src/caffe/CMakeFiles/caffe.dir/layers/absval_layer.cu.o] Error 1

make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2

make: *** [all] Error 2

Reply all
Reply to author
Forward
0 new messages