Caffe Installation Problem

4,936 views
Skip to first unread message

David Chik

unread,
Sep 10, 2014, 10:45:01 AM9/10/14
to caffe...@googlegroups.com
Dear all,

I am trying to install Caffe but got this problem:

$ make all

clang++ -shared -o .build_release/lib/libcaffe.so .build_release/src/caffe/proto/caffe.pb.o .build_release/src/caffe/proto/caffe_pretty_print.pb.o .build_release/src/caffe/blob.o .build_release/src/caffe/common.o .build_release/src/caffe/layer_factory.o .build_release/src/caffe/layers/accuracy_layer.o .build_release/src/caffe/layers/argmax_layer.o .build_release/src/caffe/layers/bnll_layer.o .build_release/src/caffe/layers/concat_layer.o .build_release/src/caffe/layers/conv_layer.o .build_release/src/caffe/layers/data_layer.o .build_release/src/caffe/layers/dropout_layer.o .build_release/src/caffe/layers/dummy_data_layer.o .build_release/src/caffe/layers/eltwise_layer.o .build_release/src/caffe/layers/euclidean_loss_layer.o .build_release/src/caffe/layers/flatten_layer.o .build_release/src/caffe/layers/hdf5_data_layer.o .build_release/src/caffe/layers/hdf5_output_layer.o .build_release/src/caffe/layers/hinge_loss_layer.o .build_release/src/caffe/layers/im2col_layer.o .build_release/src/caffe/layers/image_data_layer.o .build_release/src/caffe/layers/infogain_loss_layer.o .build_release/src/caffe/layers/inner_product_layer.o .build_release/src/caffe/layers/loss_layer.o .build_release/src/caffe/layers/lrn_layer.o .build_release/src/caffe/layers/memory_data_layer.o .build_release/src/caffe/layers/multinomial_logistic_loss_layer.o .build_release/src/caffe/layers/neuron_layer.o .build_release/src/caffe/layers/pooling_layer.o .build_release/src/caffe/layers/power_layer.o .build_release/src/caffe/layers/relu_layer.o .build_release/src/caffe/layers/sigmoid_cross_entropy_loss_layer.o .build_release/src/caffe/layers/sigmoid_layer.o .build_release/src/caffe/layers/slice_layer.o .build_release/src/caffe/layers/softmax_layer.o .build_release/src/caffe/layers/softmax_loss_layer.o .build_release/src/caffe/layers/split_layer.o .build_release/src/caffe/layers/tanh_layer.o .build_release/src/caffe/layers/threshold_layer.o .build_release/src/caffe/layers/window_data_layer.o .build_release/src/caffe/net.o .build_release/src/caffe/solver.o .build_release/src/caffe/syncedmem.o .build_release/src/caffe/util/benchmark.o .build_release/src/caffe/util/im2col.o .build_release/src/caffe/util/insert_splits.o .build_release/src/caffe/util/io.o .build_release/src/caffe/util/math_functions.o .build_release/src/caffe/util/upgrade_proto.o -stdlib=libstdc++ -fPIC -DCPU_ONLY -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/octave/3.8.0/include -Wall -Wno-sign-compare -Wno-unneeded-internal-declaration -framework vecLib -L/usr/lib -L/usr/local/lib -L/usr/lib -lglog -lgflags -lpthread -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lcblas
ld: framework not found vecLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so] Error 1

I am using Mac OS X 10.9.4. I checked that vecLib.h can be found in:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers

Any ideas how to fix this?
Thank you very much.


Robert Dionne

unread,
Sep 10, 2014, 11:28:57 AM9/10/14
to David Chik, caffe...@googlegroups.com
I had the same issue last night. Here is a quick patch that should resolve the problem temporarily:

--- a/Makefile
+++ b/Makefile
@@ -265,9 +265,9 @@ else
                endif
        else ifeq ($(OSX), 1)
                # OS X packages atlas as the vecLib framework
-               BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Vers
ions/Current/Headers/
+               BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platf
orms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Acc
elerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
                LIBRARIES += cblas
-               LDFLAGS += -framework vecLib
+               LDFLAGS += -framework Accelerate
        endif
 endif
 INCLUDE_DIRS += $(BLAS_INCLUDE)


--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, 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/685eed33-839a-4b75-98ed-0ad4eab381de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Chik

unread,
Sep 11, 2014, 12:57:23 AM9/11/14
to caffe...@googlegroups.com
Thank you very much. It solved the problem for now.

Lin ZHANG

unread,
Nov 3, 2014, 10:59:42 AM11/3/14
to caffe...@googlegroups.com, dr.dav...@googlemail.com
Hi, can you tell me how to use it? Paste it on the Makefile directly?
Thanks.

在 2014年9月10日星期三UTC-4上午11时28分57秒,Robert Dionne写道:

Lin ZHANG

unread,
Nov 3, 2014, 11:03:48 AM11/3/14
to caffe...@googlegroups.com
Hi, how do you solve the problem? I have the same one.
I have no idea how to use the solution. Please give me some hint. Thanks.



--- a/Makefile
+++ b/Makefile
@@ -265,9 +265,9 @@ else
                endif
        else ifeq ($(OSX), 1)
                # OS X packages atlas as the vecLib framework
-               BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Vers
ions/Current/Headers/
+               BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platf
orms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Acc
elerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
                LIBRARIES += cblas
-               LDFLAGS += -framework vecLib
+               LDFLAGS += -framework Accelerate
        endif
 endif
 INCLUDE_DIRS += $(BLAS_INCLUDE)


在 2014年9月11日星期四UTC-4上午12时57分23秒,David Chik写道:

David Chik

unread,
Nov 3, 2014, 9:46:38 PM11/3/14
to caffe...@googlegroups.com
Are you using Mac? You need to find the path of vecLib in your machine and then modify the Makefile.

But now I no longer use Mac to run Caffe. Please use Ubuntu 14.04.

Xianxu Hou

unread,
Jun 24, 2015, 8:21:46 PM6/24/15
to caffe...@googlegroups.com


在 2014年11月3日星期一 UTC下午4:03:48,Lin ZHANG写道:
Hi, how do you solve the problem? I have the same one.
I have no idea how to use the solution. Please give me some hint. Thanks.

I am the same problem as you, and it bothered me for two days. You just need to change BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platf
orms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Acc
elerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
   to one line, not tree line. 
 
  However, after fixing this problem, there is another error happened when compiling. /usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(27): error: explicit type is missing ("int" assumed)

Rong Luo

unread,
Jul 2, 2015, 4:57:59 AM7/2/15
to caffe...@googlegroups.com
I have the same problem.
/opt/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(27): error: explicit type is missing ("int" assumed)
Have you fix the problem? Is there any idea to resolve it ?

在 2015年6月25日星期四 UTC+8上午8:21:46,Xianxu Hou写道:

Serge Helfrich

unread,
Jul 16, 2015, 7:12:46 AM7/16/15
to caffe...@googlegroups.com
On Thursday, July 2, 2015 at 10:57:59 AM UTC+2, Rong Luo wrote:
I have the same problem.
/opt/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(27): error: explicit type is missing ("int" assumed)
Have you fix the problem? Is there any idea to resolve it ?

Caffe appears to be incompatible with the latest version of Boost. This should solve your problem:

-- 
Serge Helfrich

Roberto

unread,
Oct 9, 2015, 7:31:26 AM10/9/15
to Caffe Users
I had the same issue. The problem seems that the FindvecLib.cmake module is linking against the vecLib library
instead of the Accelerate framework. I solved by commenting out the check for vecLib, i.e. changing the bottom FindvecLib.cmake
(you can find in cmake/Modules) from:

if(VECLIB_FOUND)
  if(vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
    set(vecLib_LINKER_LIBS -lcblas "-framework vecLib")
    message(STATUS "Found standalone vecLib.framework")
  else()
    set(vecLib_LINKER_LIBS -lcblas "-framework Accelerate")
    message(STATUS "Found vecLib as part of Accelerate.framework")
endif()


into

if(VECLIB_FOUND)
#  if(vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
#    set(vecLib_LINKER_LIBS -lcblas "-framework vecLib")
#    message(STATUS "Found standalone vecLib.framework")
#  else()
    set(vecLib_LINKER_LIBS -lcblas "-framework Accelerate")
    message(STATUS "Found vecLib as part of Accelerate.framework")
endif()

I hope this helps.
Reply all
Reply to author
Forward
0 new messages