Unable to build Caffe on Mac 10.14.1

935 views
Skip to first unread message

Pablo Vela

unread,
Oct 31, 2018, 12:46:20 PM10/31/18
to Caffe Users
So I've been trying to build Caffe for the past two days or so but haven't had much success, Here is what I've done so far:

using Anaconda I made an environment with python 2.7 and using the following Make.config file

## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# This code is taken from https://github.com/sh1r0/caffe-android-lib
# USE_HDF5 := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
# For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas

# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
# PYTHON_INCLUDE := /usr/include/python2.7 \
# /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := $(HOME)/miniconda3/envs/ganerated
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python2.7 \
$(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
# /usr/lib/python3.5/dist-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
# PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib

# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# NCCL acceleration switch (uncomment to build with NCCL)
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
# USE_NCCL := 1

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
Q ?= @

get the following error:

PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/layers/tanh_layer.cpp
src/caffe/common.cpp:1:10: fatal error: 'boost/thread.hpp' file not found
#include <boost/thread.hpp>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/common.o] Error 1
make: *** Waiting for unfinished jobs....
src/caffe/data_transformer.cpp:2:10: fatal error: 'opencv2/core/core.hpp' file not found
#include <opencv2/core/core.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/data_transformer.o] Error 1
In file included from src/caffe/layers/tanh_layer.cpp:6:
In file included from ./include/caffe/layers/tanh_layer.hpp:6:
In file included from ./include/caffe/blob.hpp:8:
./include/caffe/common.hpp:4:10: fatal error: 'boost/shared_ptr.hpp' file not found
#include <boost/shared_ptr.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/layers/tanh_layer.o] Error 1
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:9:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/common.h:52:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/mutex.h:50:20: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions]
  WrappedMutex() = default;
                   ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/mutex.h:61:15: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using Mutex = WrappedMutex;
              ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:23:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:51:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena_impl.h:303:22: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  ArenaImpl(ArenaImpl&&) = delete;
                     ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena_impl.h:303:28: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
  ArenaImpl(ArenaImpl&&) = delete;
                           ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena_impl.h:304:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  ArenaImpl& operator=(ArenaImpl&&) = delete;
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena_impl.h:304:39: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
  ArenaImpl& operator=(ArenaImpl&&) = delete;
                                      ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:23:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:293:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:295:25: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, Args&&... args) {
                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:320:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:322:64: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
                                                           Args&&... args) {
                                                               ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:442:23: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
    template <typename... Args>
                      ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:443:40: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
    static T* Construct(void* ptr, Args&&... args) {
                                       ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:471:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:473:25: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, Args&&... args) {
                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:500:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:502:25: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, Args&&... args) {
                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:541:35: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename Msg, typename... Args>
                                  ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:543:41: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, std::true_type, Args&&... args) {
                                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:547:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:549:42: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, std::false_type, Args&&... args) {
                                         ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:553:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:555:25: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, Args&&... args) {
                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:560:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:562:41: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, std::true_type, Args&&... args) {
                                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:569:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:571:42: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Arena* arena, std::false_type, Args&&... args) {
                                         ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:591:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:593:41: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      bool skip_explicit_ownership, Args&&... args) {
                                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:597:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
  template <typename T, typename... Args>
                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/arena.h:598:66: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* DoCreateMessage(Args&&... args) {
                                                                 ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:25:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/map.h:49:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/map_type_handler.h:35:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/wire_format_lite_inl.h:43:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:45:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:88:19: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using once_flag = std::once_flag;
                  ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:89:19: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template <typename... Args>
                  ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:90:20: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
void call_once(Args&&... args ) {
                   ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:97:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using ProtobufOnceType = internal::once_flag;
                         ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:25:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/map.h:49:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/map_type_handler.h:35:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/wire_format_lite_inl.h:43:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:117:3: error: unknown type name 'constexpr'
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:117:13: error: expected member name or ';' after declaration specifiers
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ~~~~~~~~~ ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:110:11: error: use of undeclared identifier 'union_'
    new (&union_) T();
          ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:114:5: error: use of undeclared identifier 'get_mutable'
    get_mutable()->~T();
    ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:131:48: error: found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?
LIBPROTOBUF_EXPORT extern ExplicitlyConstructed<::std::string> fixed_address_empty_string;
                                               ^~~
                                               < ::
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/message_lite.h:137:37: error: no member named 'get' in 'google::protobuf::internal::ExplicitlyConstructed<std::__1::basic_string<char> >'
  return fixed_address_empty_string.get();
         ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:25:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/map.h:49:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/map_type_handler.h:35:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/wire_format_lite_inl.h:44:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:112:21: warning: 'final' keyword is a C++11 extension [-Wc++11-extensions]
class RepeatedField final {
                    ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:123:30: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  RepeatedField(RepeatedField&& other) noexcept;
                             ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:123:39: error: expected ';' at end of declaration list
  RepeatedField(RepeatedField&& other) noexcept;
                                      ^
                                      ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:124:41: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  RepeatedField& operator=(RepeatedField&& other) noexcept;
                                        ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:124:50: error: expected ';' at end of declaration list
  RepeatedField& operator=(RepeatedField&& other) noexcept;
                                                 ^
                                                 ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:468:38: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  void Add(typename TypeHandler::Type&& value,
                                     ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:736:49: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  static inline string* New(Arena* arena, string&& value) {
                                                ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:766:24: warning: 'final' keyword is a C++11 extension [-Wc++11-extensions]
class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
                       ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:778:36: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  RepeatedPtrField(RepeatedPtrField&& other) noexcept;
                                   ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:778:45: error: expected ';' at end of declaration list
  RepeatedPtrField(RepeatedPtrField&& other) noexcept;
                                            ^
                                            ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:779:47: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept;
                                              ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:779:56: error: expected ';' at end of declaration list
  RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept;
                                                       ^
                                                       ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:787:19: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
  void Add(Element&& value);
                  ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1090:59: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
                                                          ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1090:32: error: out-of-line declaration of a member must be a definition [-Wout-of-line-declaration]
inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
       ~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1090:68: error: expected ';' at end of declaration
inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
                                                                   ^
                                                                   ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1090:69: error: unknown type name 'noexcept'
inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
                                                                    ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1091:5: error: expected unqualified-id
    : RepeatedField() {
    ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1103:18: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
    RepeatedField&& other) noexcept {
                 ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1102:56: error: out-of-line declaration of a member must be a definition [-Wout-of-line-declaration]
inline RepeatedField<Element>& RepeatedField<Element>::operator=(
                               ~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1103:27: error: expected ';' at end of declaration
    RepeatedField&& other) noexcept {
                          ^
                          ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1103:28: error: C++ requires a type specifier for all declarations
    RepeatedField&& other) noexcept {
                           ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1103:36: error: expected ';' after top level declarator
    RepeatedField&& other) noexcept {
                                   ^
                                   ;
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1928:21: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
    RepeatedPtrField&& other) noexcept
                    ^
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/repeated_field.h:1927:35: error: out-of-line declaration of a member must be a definition [-Wout-of-line-declaration]
inline RepeatedPtrField<Element>::RepeatedPtrField(
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
46 warnings and 20 errors generated.
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1


I thought maybe this was because I was using libprotobuf 3.6.0 so I downgraded to 2.6.1

but after doing that I get this error 

PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/layers/tanh_layer.cpp
src/caffe/common.cpp:1:10: fatal error: 'boost/thread.hpp' file not found
#include <boost/thread.hpp>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/common.o] Error 1
make: *** Waiting for unfinished jobs....
src/caffe/data_transformer.cpp:2:10: fatal error: 'opencv2/core/core.hpp' file not found
#include <opencv2/core/core.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/data_transformer.o] Error 1
In file included from src/caffe/layers/tanh_layer.cpp:6:
In file included from ./include/caffe/layers/tanh_layer.hpp:6:
In file included from ./include/caffe/blob.hpp:8:
./include/caffe/common.hpp:4:10: fatal error: 'boost/shared_ptr.hpp' file not found
#include <boost/shared_ptr.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/layers/tanh_layer.o] Error 1
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:47:9: warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
    if (OSAtomicCompareAndSwap32(old_value, new_value,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:502:9: note: 'OSAtomicCompareAndSwap32' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:61:13: warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
  } while (!OSAtomicCompareAndSwap32(old_value, new_value,
            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:502:9: note: 'OSAtomicCompareAndSwap32' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:68:10: warning: 'OSAtomicAdd32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
  return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr));
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:146:9: note: 'OSAtomicAdd32' has been explicitly marked deprecated here
int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue );
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:73:10: warning: 'OSAtomicAdd32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
  return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr));
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:161:9: note: 'OSAtomicAdd32Barrier' has been explicitly marked deprecated here
int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue );
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:77:3: warning: 'OSMemoryBarrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_thread_fence() from <atomic> instead [-Wdeprecated-declarations]
  OSMemoryBarrier();
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:749:9: note: 'OSMemoryBarrier' has been explicitly marked deprecated here
void    OSMemoryBarrier( void );
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:85:9: warning: 'OSAtomicCompareAndSwap32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
    if (OSAtomicCompareAndSwap32Barrier(old_value, new_value,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:518:9: note: 'OSAtomicCompareAndSwap32Barrier' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:138:9: warning: 'OSAtomicCompareAndSwap64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
    if (OSAtomicCompareAndSwap64(old_value, new_value,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:628:9: note: 'OSAtomicCompareAndSwap64' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:152:13: warning: 'OSAtomicCompareAndSwap64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
  } while (!OSAtomicCompareAndSwap64(old_value, new_value,
            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:628:9: note: 'OSAtomicCompareAndSwap64' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:159:10: warning: 'OSAtomicAdd64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
  return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr));
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:231:9: note: 'OSAtomicAdd64' has been explicitly marked deprecated here
int64_t OSAtomicAdd64( int64_t __theAmount,
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:164:10: warning: 'OSAtomicAdd64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
  return OSAtomicAdd64Barrier(increment,
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:247:9: note: 'OSAtomicAdd64Barrier' has been explicitly marked deprecated here
int64_t OSAtomicAdd64Barrier( int64_t __theAmount,
        ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/generated_message_util.h:44:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/once.h:81:
In file included from /Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops.h:184:
/Users/pablo/miniconda3/envs/ganerated/include/google/protobuf/stubs/atomicops_internals_macosx.h:173:9: warning: 'OSAtomicCompareAndSwap64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
    if (OSAtomicCompareAndSwap64Barrier(
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libkern/OSAtomicDeprecated.h:645:9: note: 'OSAtomicCompareAndSwap64Barrier' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue,
        ^
11 warnings generated.

I know that I can use docker to install Caffe but I need the use of my webcam which can't be passed into docker on Mac

I've been ripping my hair out with this installation, any help would be greatly appreciated

Thanks

Robin East

unread,
Nov 13, 2018, 5:39:34 AM11/13/18
to Caffe Users
Been 'enjoying' similar problems. The problem is the compiler is looking for boost/thread.hpp (and some OpenCV headers) and can't find them. Do you know where these files are - should be in /usr/local/include. I had a similar issue in that I had an old version of boost (1.60) installed by brew and then overwrote it with a newer version. To fix another issue I removed the old boost but what I did didn't update the links in the /usr/local/include directory. Once I figured this out and fixed (using brew link boost) I got past this problem.

jiagen...@gmail.com

unread,
Mar 7, 2019, 8:09:30 PM3/7/19
to Caffe Users
Same suffering man, have you solved that? 

在 2018年10月31日星期三 UTC下午4:46:20,Pablo Vela写道:

Sam P

unread,
Mar 8, 2019, 1:29:12 PM3/8/19
to Caffe Users
Having the same issue.
Reply all
Reply to author
Forward
0 new messages