Error compiling Caffe on Mac OS X: cudnn_pooling_layer.cu

1,481 views
Skip to first unread message

Josh

unread,
May 11, 2015, 12:01:27 AM5/11/15
to caffe...@googlegroups.com
I am trying to setup Caffe on a clean install of Mac OS X (10.10.3).

When compiling Caffe I get the following error:
 
$ make all -j8
[... truncated ...] 
CXX src/caffe/util/io.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/upgrade_proto.cpp
NVCC src/caffe/layers/absval_layer.cu
NVCC src/caffe/layers/base_data_layer.cu
NVCC src/caffe/layers/bnll_layer.cu
NVCC src/caffe/layers/concat_layer.cu
NVCC src/caffe/layers/contrastive_loss_layer.cu
NVCC src/caffe/layers/conv_layer.cu
NVCC src/caffe/layers/cudnn_conv_layer.cu
NVCC src/caffe/layers/cudnn_pooling_layer.cu
/usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(27): error: expected a ";" 

/usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(29): error: inline specifier allowed on function declarations only 

/usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(29): error: incomplete type is not allowed 

[... truncated ...]

(See attached file make-out.txt for non-truncated output)

Does anyone have any ideas on what is causing this problem and how I can go about fixing it?


Below are the details of my dependency setup prior to building Caffe.

Manual installs:
  • Anaconda Python 2.2.0
  • CUDA toolkit 7.0.29
  • CUDA (standalone) driver 7.0.36
  • Intel MKL (via Intel Parallel Studio XE Composer, 2015.3.187)
  • cuDNN 6.5 v2
Homebrew installs (output of homebrew list --versions):
  • boost 1.58.0
  • boost-python 1.58.0
  • cloog 0.18.1
  • eigen 3.2.4
  • gcc 4.9.2_1
  • gflags 2.1.2
  • glog 0.3.4
  • gmp 6.0.0a
  • ilmbase 2.2.0
  • isl 0.12.2
  • jpeg 8d
  • leveldb 1.18
  • libmpc 1.0.3
  • libpng 1.6.17
  • libtiff 4.0.3
  • lmdb 0.9.14
  • mpfr 3.1.2-p11
  • numpy 1.9.2
  • opencv 2.4.11_1
  • openexr 2.2.0
  • protobuf 2.6.1
  • snappy 1.1.1
  • szip 2.1
Environment variables:
  • PATH: /Developer/NVIDIA/CUDA-7.0/bin/:/Users/josh/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  • DYLD_LIBRARY_PATH: /Developer/NVIDIA/CUDA-7.0/lib:
  • DYLD_FALLBACK_LIBRARY_PATH: /usr/local/cuda/lib:/Users/josh/anaconda/lib:/usr/local/lib:/usr/lib:/opt/intel/composer_xe_2015.3.187/compiler/lib:/opt/intel/composer_xe_2015.3.187/mkl/lib

Attached is my Makefile.config file and the complete output of running make all -j8.

Any help would be greatly appreciated!

Thanks,
Josh
Makefile.config
make-out.txt

梁宁清

unread,
May 11, 2015, 11:33:03 AM5/11/15
to caffe...@googlegroups.com
I got the same problem when compiling using cmake. During cmake configuration, all is fine except this word

"Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)", but the configuration then finished without big problems, which I guess is OK.

I would like to follow this post, and thank anyone who find the solution to this.

Adam Nelson

unread,
May 13, 2015, 1:01:41 AM5/13/15
to caffe...@googlegroups.com
I think there's some incompatibility between Caffe and the new version of Boost, 1.58.0.  I had this same problem on my Mac.  To work around it I forced Brew to use 1.57.00 instead.

To do that I did:

$ brew uninstall boost boost-python
$ cd $(brew --prefix)
$ git checkout ab47508 Library/Formula/boost.rb
$ git checkout 3141234 Library/Formula/boost-python.rb
brew install --build-from-source --fresh -vd boost boost-python
$ brew pin boost
$ brew pin boost-python

Make sure you do a 'make clean' in the Caffe root after this, then try again to build it.

KV

unread,
May 27, 2015, 2:32:55 PM5/27/15
to caffe...@googlegroups.com
I'm trying to follow these steps, and I'm getting an error in the third step.

"fatal: reference is not a tree: ab47508f0491a0acbce51a60ffd8da87991fd82a"

Am I messing up something here? or is this unavoidable? I'm pretty sure the problem I'm running into is boost version related.

Thanks!

Mohit Jain

unread,
May 27, 2015, 4:06:24 PM5/27/15
to caffe...@googlegroups.com
I had been facing similar issues for a lot of time. The right tweaks in Makefile.config for me were : (might not be the most optimised caffe installation, but sure does work)

[dont use Anaconda]
: set CPU_ONLY:=1
: unset USE_CUDNN (simply comment it out - "#USE_CUDNN:=1")
: set BLAS:=atlas (your macbook has this inbuilt - no need to use mkl or any other such support libraries)
: set PYTHON_INCLUDE := /usr/include/python2.7 \
        /usr/local/lib/python2.7/site-packages/numpy/core/include/    
(paths might be different for specific users - but for noobs (like me) - this is where it should be by default)

Hope this helps you guys. I've tested this on my MacBook Pro (OSX 10.10.3). Works smoothly via manual makefile.config edits as well cmake (tested both).

Cheers!
Mohit

KV

unread,
May 27, 2015, 4:40:00 PM5/27/15
to caffe...@googlegroups.com
Thanks for the tip. Actually I finally got it to work by just changing the boost.rb and boost-python.rb files used in homebrew (e.g. /usr/local/Library/Formula/boost.rb) to use the older versions in the download url. Hopefully that helps anyone else running into similar issues!

Eric Liu

unread,
May 28, 2015, 3:18:14 AM5/28/15
to caffe...@googlegroups.com
I encountered the same issue. The solution works perfectly! Thanks a million!

在 2015年5月27日星期三 UTC-7下午1:40:00,KV写道:

Mohit Jain

unread,
May 30, 2015, 4:39:21 PM5/30/15
to caffe...@googlegroups.com
Hello people!
    I've finally been able to get Caffe up and running with my required functionalities and I've written a Wiki to help out the people facing similar issues, http://installing-caffe-the-right-way.wikidot.com/ . Your suggestions are welcome.


Cheers!
Mohit

On Monday, May 11, 2015 at 9:31:27 AM UTC+5:30, Josh wrote:

Zhangzhen

unread,
Jun 1, 2015, 10:05:09 AM6/1/15
to caffe...@googlegroups.com
Could you tell me how to uninstall all boost related packages?
Thanks

在 2015年5月28日星期四 UTC+8上午4:40:00,KV写道:

Carlos Treviño

unread,
Jun 2, 2015, 3:40:33 AM6/2/15
to caffe...@googlegroups.com
Hi Zhangzhen,

you should use "brew uninstall ..." for all the package you don't want.

-Carlos

udibr

unread,
Jul 3, 2015, 9:36:59 AM7/3/15
to caffe...@googlegroups.com
I think this link gives more detail on how to install boost 1.57.00
http://itinerantbioinformaticist.blogspot.com/2015/05/caffe-incompatible-with-boost-1580.html?m=1

Zhangzhen

unread,
Jul 21, 2015, 9:39:45 AM7/21/15
to caffe...@googlegroups.com
Thanks!
Last time I installed succeed, forgot to thank you!

在 2015年6月2日星期二 UTC+8下午3:40:33,Carlos Treviño写道:

Mohit Jain

unread,
Jul 22, 2015, 7:27:05 AM7/22/15
to Zhangzhen, caffe...@googlegroups.com

Happy to be of help! :)

-Mohit


--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/fY2r6bO3_0w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/7e1a7194-36aa-4a14-b9ed-a6a26c1db26d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Umar Spa

unread,
Jul 24, 2015, 11:00:13 AM7/24/15
to Caffe Users, ane...@apocryph.org
omg Adam Nelson......it works.
thanks a lot !!!!!
Reply all
Reply to author
Forward
0 new messages