A problem occured when I make cafe .Any help? macOS 10.12

1,072 views
Skip to first unread message

steve...@gmail.com

unread,
Oct 21, 2016, 12:09:52 PM10/21/16
to Caffe Users
PROBLEM
SteveYangdeMacBook-Pro:caffe steveyyy$ make all
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
/bin/sh: line 0: [: -gt: unary operator expected
/bin/sh: line 0: [: -gt: unary operator expected
CXX src/caffe/blob.cpp
In file included from src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.sdk/usr/include/libkern/OSAtomicDeprecated.h:749:9: note: 'OSMemoryBarrier' has been explicitly marked deprecated here
void    OSMemoryBarrier( void );
        ^
In file included from src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.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 src/caffe/blob.cpp:4:
In file included from ./include/caffe/blob.hpp:9:
In file included from .build_release/src/caffe/proto/caffe.pb.h:22:
In file included from /usr/local/include/google/protobuf/arena.h:54:
In file included from /usr/local/include/google/protobuf/stubs/atomic_sequence_num.h:33:
In file included from /usr/local/include/google/protobuf/stubs/atomicops.h:199:
/usr/local/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.12.sdk/usr/include/libkern/OSAtomicDeprecated.h:645:9: note: 'OSAtomicCompareAndSwap64Barrier' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue,
        ^
In file included from src/caffe/blob.cpp:7:
In file included from ./include/caffe/util/math_functions.hpp:11:
./include/caffe/util/mkl_alternate.hpp:14:10: fatal error: 'cblas.h' file not found
#include <cblas.h>
         ^
11 warnings and 1 error generated.
make: *** [.build_release/src/caffe/blob.o] Error 1
SteveYangdeMacBook-Pro:caffe steveyyy$ cp Makefile.config.example Makefile.config


WHAT I DID

brew install -vd snappy leveldb gflags glog szip lmdb opencv hdf5
brew uninstall --force protobuf; brew install --with-python --fresh -vd protobuf
brew uninstall boost boost-python; brew install --fresh -vd boost boost-python
git clone https://github.com/BVLC/caffe.git
cd caffe
cp Makefile.config.example Makefile.config
change the config to CPU ONLY



Martin Hjelm

unread,
Nov 6, 2016, 6:17:55 AM11/6/16
to Caffe Users
You need to edit the Makefile to let Caffe know where cblas is. This is dependent on OSX version.

This line here 

else ifeq ($(OSX), 1)
# OS X packages atlas as the vecLib framework
LIBRARIES += cblas
# 10.10 has accelerate while 10.9 has veclib
XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.Xcode | grep 'version' | sed 's/[^0-9]*\([0-9]\).*/\1/')
XCODE_CLT_GEQ_6 := $(shell [ $(XCODE_CLT_VER) -gt 5 ] && echo 1)
ifeq ($(XCODE_CLT_GEQ_6), 1)
BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/
LDFLAGS += -framework Accelerate
else
BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
LDFLAGS += -framework vecLib
endif

Joshua peng

unread,
Nov 12, 2016, 9:34:41 AM11/12/16
to Caffe Users
Do you just copy and paste to the Makefile?

Joshua Peng

unread,
Nov 12, 2016, 2:37:54 PM11/12/16
to Caffe Users
Steven, did you solve the problem?

I am trying to install cafe on Mac 10.12.1 sierra using , it came to have the errors below while following the described steps above:

Joshuas-MacBook-Pro:caffe Books$ make all

PROTOC src/caffe/proto/caffe.proto

CXX .build_release/src/caffe/proto/caffe.pb.cc

CXX src/caffe/blob.cpp

In file included from src/caffe/blob.cpp:7:

In file included from ./include/caffe/util/math_functions.hpp:11:

./include/caffe/util/mkl_alternate.hpp:14:10: fatal error: 'cblas.h' file not found

#include <cblas.h>

         ^

1 error generated.

make: *** [.build_release/src/caffe/blob.o] Error 1


I have tried the ways you mentioned to fix it, but none worked, I also installed Anaconda Python,not sure that is needed. 


Any help would be greatly appreciated. 

Joshua Peng

unread,
Nov 12, 2016, 2:39:04 PM11/12/16
to Caffe Users
Can you show me more specifically how to let Caffe know where colas is ? thanks


On Sunday, November 6, 2016 at 6:17:55 AM UTC-5, Martin Hjelm wrote:

Wojciech Dziwulski

unread,
Jan 20, 2017, 4:39:29 AM1/20/17
to Caffe Users
If you installed everything via brew, like me, you should uncomment those lines:
# 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

Tom Wang

unread,
Mar 20, 2017, 1:14:57 PM3/20/17
to Caffe Users
Having similar issue(s), I am able to compile after changing "BLA_XXX" in "Makefile.config", 

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

HTH,

Reply all
Reply to author
Forward
0 new messages