Error with MNIST example (Mac, library not found)

129 views
Skip to first unread message

alan

unread,
Apr 5, 2017, 11:53:28 AM4/5/17
to Caffe Users
Hi,

When running create_mnist.sh, I get the following error:

Creating lmdb...
dyld: Library not loaded: @rpath/./libhdf5_hl.10.dylib
  Referenced from: /Users/alan/caffe/build/examples/mnist/convert_mnist_data.bin
  Reason: image not found
./create_mnist.sh: line 18: 79755 Trace/BPT trap: 5       $BUILD/convert_mnist_data.bin $DATA/train-images-idx3-ubyte $DATA/train-labels-idx1-ubyte $EXAMPLE/mnist_train_${BACKEND} --backend=${BACKEND}

This is odd, because I got the exact same error during the installation during make test, but managed to fix it by running:

install_name_tool -change @rpath/./libhdf5_hl.10.dylib ~/anaconda/lib/libhdf5_hl.10.dylib ~/caffe/.build_release/tools/caffe

install_name_tool -change @rpath/./libhdf5.10.dylib ~/anaconda/lib/libhdf5.10.dylib ~/caffe/.build_release/tools/caffe

Pycaffe works fine (it doesn't crash when I import it, maybe there is something else that doesn't work...?) However, trying to run caffe gives me this error:

dyld: Library not loaded: @rpath/libcaffe.1.0.0-rc5.dylib
  Referenced from: /usr/local/bin/caffe
  Reason: image not found
Trace/BPT trap: 5

Which is very similar, and I'm guessing I need to relink this library as well. The odd thing is, I can't seem to be able to find this file on my computer.

When I run make runtest, I get:

[==========] Running 1104 tests from 150 test cases.
[----------] Global test environment set-up.
[----------] 4 tests from BlobSimpleTest/0, where TypeParam = f
[ RUN      ] BlobSimpleTest/0.TestLegacyBlobProtoShapeEquals
[       OK ] BlobSimpleTest/0.TestLegacyBlobProtoShapeEquals (1 ms)
[ RUN      ] BlobSimpleTest/0.TestReshape
[       OK ] BlobSimpleTest/0.TestReshape (0 ms)
[ RUN      ] BlobSimpleTest/0.TestReshapeZero
[       OK ] BlobSimpleTest/0.TestReshapeZero (0 ms)
[ RUN      ] BlobSimpleTest/0.TestInitialization
[       OK ] BlobSimpleTest/0.TestInitialization (0 ms)
[----------] 4 tests from BlobSimpleTest/0 (1 ms total)

[----------] 26 tests from NetTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN      ] NetTest/1.TestAllInOneNetVal
[       OK ] NetTest/1.TestAllInOneNetVal (7 ms)
[ RUN      ] NetTest/1.TestSharedWeightsResume
[       OK ] NetTest/1.TestSharedWeightsResume (1 ms)
[ RUN      ] NetTest/1.TestGetLayerByName
[       OK ] NetTest/1.TestGetLayerByName (1 ms)
[ RUN      ] NetTest/1.TestBottomNeedBackwardForce
[       OK ] NetTest/1.TestBottomNeedBackwardForce (1 ms)
[ RUN      ] NetTest/1.TestAllInOneNetDeploy
[       OK ] NetTest/1.TestAllInOneNetDeploy (1 ms)
[ RUN      ] NetTest/1.TestBottomNeedBackwardTricky
[       OK ] NetTest/1.TestBottomNeedBackwardTricky (1 ms)
[ RUN      ] NetTest/1.TestSharedWeightsDataNet
[       OK ] NetTest/1.TestSharedWeightsDataNet (0 ms)
[ RUN      ] NetTest/1.TestBottomNeedBackward
[       OK ] NetTest/1.TestBottomNeedBackward (1 ms)
[ RUN      ] NetTest/1.TestParamPropagateDown
[       OK ] NetTest/1.TestParamPropagateDown (2 ms)
[ RUN      ] NetTest/1.TestFromTo
[       OK ] NetTest/1.TestFromTo (2 ms)
[ RUN      ] NetTest/1.TestBackwardWithAccuracyLayer
[       OK ] NetTest/1.TestBackwardWithAccuracyLayer (1 ms)
[ RUN      ] NetTest/1.TestSharedWeightsUpdate
[       OK ] NetTest/1.TestSharedWeightsUpdate (1 ms)
[ RUN      ] NetTest/1.TestLossWeightMidNet
[       OK ] NetTest/1.TestLossWeightMidNet (4 ms)
[ RUN      ] NetTest/1.TestUnsharedWeightsDiffNet
[       OK ] NetTest/1.TestUnsharedWeightsDiffNet (0 ms)
[ RUN      ] NetTest/1.TestSharedWeightsDiffNet
[       OK ] NetTest/1.TestSharedWeightsDiffNet (1 ms)
[ RUN      ] NetTest/1.TestAllInOneNetTrain
[       OK ] NetTest/1.TestAllInOneNetTrain (1 ms)
[ RUN      ] NetTest/1.TestSkipPropagateDown
[       OK ] NetTest/1.TestSkipPropagateDown (1 ms)
[ RUN      ] NetTest/1.TestForcePropagateDown
[       OK ] NetTest/1.TestForcePropagateDown (0 ms)
[ RUN      ] NetTest/1.TestBottomNeedBackwardEuclideanForce
[       OK ] NetTest/1.TestBottomNeedBackwardEuclideanForce (1 ms)
[ RUN      ] NetTest/1.TestReshape
[       OK ] NetTest/1.TestReshape (1 ms)
[ RUN      ] NetTest/1.TestHasBlob
[       OK ] NetTest/1.TestHasBlob (1 ms)
[ RUN      ] NetTest/1.TestLossWeight
[       OK ] NetTest/1.TestLossWeight (2 ms)
[ RUN      ] NetTest/1.TestHasLayer
[       OK ] NetTest/1.TestHasLayer (0 ms)
[ RUN      ] NetTest/1.TestUnsharedWeightsDataNet
[       OK ] NetTest/1.TestUnsharedWeightsDataNet (1 ms)
[ RUN      ] NetTest/1.TestGetBlob
[       OK ] NetTest/1.TestGetBlob (0 ms)
[ RUN      ] NetTest/1.TestComboLossWeight
[       OK ] NetTest/1.TestComboLossWeight (2 ms)
[----------] 26 tests from NetTest/1 (34 ms total)

[----------] 12 tests from ArgMaxLayerTest/0, where TypeParam = f
[ RUN      ] ArgMaxLayerTest/0.TestCPUAxis
[       OK ] ArgMaxLayerTest/0.TestCPUAxis (10 ms)
[ RUN      ] ArgMaxLayerTest/0.TestCPUMaxValTopK
[       OK ] ArgMaxLayerTest/0.TestCPUMaxValTopK (1 ms)
[ RUN      ] ArgMaxLayerTest/0.TestCPUMaxVal
[       OK ] ArgMaxLayerTest/0.TestCPUMaxVal (4 ms)
[ RUN      ] ArgMaxLayerTest/0.TestCPU
[       OK ] ArgMaxLayerTest/0.TestCPU (1 ms)
[ RUN      ] ArgMaxLayerTest/0.TestSetupAxisNegativeIndexing
[       OK ] ArgMaxLayerTest/0.TestSetupAxisNegativeIndexing (0 ms)
[ RUN      ] ArgMaxLayerTest/0.TestCPUAxisTopK
[       OK ] ArgMaxLayerTest/0.TestCPUAxisTopK (26 ms)
[ RUN      ] ArgMaxLayerTest/0.TestSetupMaxVal
[       OK ] ArgMaxLayerTest/0.TestSetupMaxVal (1 ms)
[ RUN      ] ArgMaxLayerTest/0.TestSetup
[       OK ] ArgMaxLayerTest/0.TestSetup (0 ms)
[ RUN      ] ArgMaxLayerTest/0.TestCPUAxisMaxValTopK
[       OK ] ArgMaxLayerTest/0.TestCPUAxisMaxValTopK (27 ms)
[ RUN      ] ArgMaxLayerTest/0.TestSetupAxis
[       OK ] ArgMaxLayerTest/0.TestSetupAxis (1 ms)
[ RUN      ] ArgMaxLayerTest/0.TestCPUTopK
[       OK ] ArgMaxLayerTest/0.TestCPUTopK (1 ms)
[ RUN      ] ArgMaxLayerTest/0.TestSetupAxisMaxVal
[       OK ] ArgMaxLayerTest/0.TestSetupAxisMaxVal (0 ms)
[----------] 12 tests from ArgMaxLayerTest/0 (72 ms total)

[----------] 8 tests from Im2colLayerTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN      ] Im2colLayerTest/1.TestForward
[       OK ] Im2colLayerTest/1.TestForward (1 ms)
[ RUN      ] Im2colLayerTest/1.TestGradientForceND
[       OK ] Im2colLayerTest/1.TestGradientForceND (430 ms)
[ RUN      ] Im2colLayerTest/1.TestGradient
[       OK ] Im2colLayerTest/1.TestGradient (284 ms)
[ RUN      ] Im2colLayerTest/1.TestDilatedGradientForceND
[       OK ] Im2colLayerTest/1.TestDilatedGradientForceND (1335 ms)
[ RUN      ] Im2colLayerTest/1.TestRect
[       OK ] Im2colLayerTest/1.TestRect (0 ms)
[ RUN      ] Im2colLayerTest/1.TestRectGradient
[       OK ] Im2colLayerTest/1.TestRectGradient (256 ms)
[ RUN      ] Im2colLayerTest/1.TestDilatedGradient
[       OK ] Im2colLayerTest/1.TestDilatedGradient (901 ms)
[ RUN      ] Im2colLayerTest/1.TestSetup
[       OK ] Im2colLayerTest/1.TestSetup (0 ms)
[----------] 8 tests from Im2colLayerTest/1 (3207 ms total)

[----------] 3 tests from BatchNormLayerTest/0, where TypeParam = N5caffe9CPUDeviceIfEE
[ RUN      ] BatchNormLayerTest/0.TestForward
[       OK ] BatchNormLayerTest/0.TestForward (2 ms)
[ RUN      ] BatchNormLayerTest/0.TestGradient
[       OK ] BatchNormLayerTest/0.TestGradient (238 ms)
[ RUN      ] BatchNormLayerTest/0.TestForwardInplace
[       OK ] BatchNormLayerTest/0.TestForwardInplace (0 ms)
[----------] 3 tests from BatchNormLayerTest/0 (240 ms total)

[----------] 1 test from MultinomialLogisticLossLayerTest/1, where TypeParam = d
[ RUN      ] MultinomialLogisticLossLayerTest/1.TestGradientCPU
[       OK ] MultinomialLogisticLossLayerTest/1.TestGradientCPU (1 ms)
[----------] 1 test from MultinomialLogisticLossLayerTest/1 (1 ms total)

[----------] 9 tests from AccuracyLayerTest/0, where TypeParam = f
[ RUN      ] AccuracyLayerTest/0.TestSetupOutputPerClass
[       OK ] AccuracyLayerTest/0.TestSetupOutputPerClass (0 ms)
[ RUN      ] AccuracyLayerTest/0.TestForwardCPUPerClassWithIgnoreLabel
[       OK ] AccuracyLayerTest/0.TestForwardCPUPerClassWithIgnoreLabel (0 ms)
[ RUN      ] AccuracyLayerTest/0.TestSetup
[       OK ] AccuracyLayerTest/0.TestSetup (0 ms)
[ RUN      ] AccuracyLayerTest/0.TestForwardCPUPerClass
[       OK ] AccuracyLayerTest/0.TestForwardCPUPerClass (0 ms)
[ RUN      ] AccuracyLayerTest/0.TestForwardCPU
[       OK ] AccuracyLayerTest/0.TestForwardCPU (0 ms)
[ RUN      ] AccuracyLayerTest/0.TestSetupTopK
[       OK ] AccuracyLayerTest/0.TestSetupTopK (0 ms)
[ RUN      ] AccuracyLayerTest/0.TestForwardCPUTopK
[       OK ] AccuracyLayerTest/0.TestForwardCPUTopK (2 ms)
[ RUN      ] AccuracyLayerTest/0.TestForwardIgnoreLabel
[       OK ] AccuracyLayerTest/0.TestForwardIgnoreLabel (1 ms)
[ RUN      ] AccuracyLayerTest/0.TestForwardWithSpatialAxes
[       OK ] AccuracyLayerTest/0.TestForwardWithSpatialAxes (0 ms)
[----------] 9 tests from AccuracyLayerTest/0 (3 ms total)

[----------] 3 tests from BlobMathTest/0, where TypeParam = N5caffe9CPUDeviceIfEE
[ RUN      ] BlobMathTest/0.TestSumOfSquares
[       OK ] BlobMathTest/0.TestSumOfSquares (0 ms)
[ RUN      ] BlobMathTest/0.TestScaleData
[       OK ] BlobMathTest/0.TestScaleData (1 ms)
[ RUN      ] BlobMathTest/0.TestAsum
[       OK ] BlobMathTest/0.TestAsum (0 ms)
[----------] 3 tests from BlobMathTest/0 (1 ms total)

[----------] 6 tests from FlattenLayerTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN      ] FlattenLayerTest/1.TestSetupWithStartAndEndAxis
[       OK ] FlattenLayerTest/1.TestSetupWithStartAndEndAxis (0 ms)
[ RUN      ] FlattenLayerTest/1.TestGradient
[       OK ] FlattenLayerTest/1.TestGradient (2 ms)
[ RUN      ] FlattenLayerTest/1.TestSetupWithAxis
[       OK ] FlattenLayerTest/1.TestSetupWithAxis (0 ms)
[ RUN      ] FlattenLayerTest/1.TestSetupWithEndAxis
[       OK ] FlattenLayerTest/1.TestSetupWithEndAxis (0 ms)
[ RUN      ] FlattenLayerTest/1.TestForward
[       OK ] FlattenLayerTest/1.TestForward (0 ms)
[ RUN      ] FlattenLayerTest/1.TestSetup
[       OK ] FlattenLayerTest/1.TestSetup (0 ms)
[----------] 6 tests from FlattenLayerTest/1 (3 ms total)

[----------] 2 tests from SoftmaxLayerTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN      ] SoftmaxLayerTest/1.TestForward
[       OK ] SoftmaxLayerTest/1.TestForward (0 ms)
[ RUN      ] SoftmaxLayerTest/1.TestGradient
[       OK ] SoftmaxLayerTest/1.TestGradient (162 ms)
[----------] 2 tests from SoftmaxLayerTest/1 (162 ms total)

[----------] 5 tests from BenchmarkTest/0, where TypeParam = N5caffe9CPUDeviceIfEE
[ RUN      ] BenchmarkTest/0.TestTimerConstructor
[       OK ] BenchmarkTest/0.TestTimerConstructor (0 ms)
[ RUN      ] BenchmarkTest/0.TestTimerStop
[       OK ] BenchmarkTest/0.TestTimerStop (0 ms)
[ RUN      ] BenchmarkTest/0.TestTimerMilliSeconds
[       OK ] BenchmarkTest/0.TestTimerMilliSeconds (304 ms)
[ RUN      ] BenchmarkTest/0.TestTimerSeconds
[       OK ] BenchmarkTest/0.TestTimerSeconds (301 ms)
[ RUN      ] BenchmarkTest/0.TestTimerStart
[       OK ] BenchmarkTest/0.TestTimerStart (0 ms)
[----------] 5 tests from BenchmarkTest/0 (605 ms total)

[----------] 4 tests from ContrastiveLossLayerTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN      ] ContrastiveLossLayerTest/1.TestForwardLegacy
[       OK ] ContrastiveLossLayerTest/1.TestForwardLegacy (0 ms)
[ RUN      ] ContrastiveLossLayerTest/1.TestGradientLegacy
[       OK ] ContrastiveLossLayerTest/1.TestGradientLegacy (132 ms)
[ RUN      ] ContrastiveLossLayerTest/1.TestGradient
[       OK ] ContrastiveLossLayerTest/1.TestGradient (126 ms)
[ RUN      ] ContrastiveLossLayerTest/1.TestForward
[       OK ] ContrastiveLossLayerTest/1.TestForward (0 ms)
[----------] 4 tests from ContrastiveLossLayerTest/1 (259 ms total)

[----------] 5 tests from DeconvolutionLayerTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN      ] DeconvolutionLayerTest/1.TestGradient
[       OK ] DeconvolutionLayerTest/1.TestGradient (493 ms)
[ RUN      ] DeconvolutionLayerTest/1.TestNDAgainst2D
[       OK ] DeconvolutionLayerTest/1.TestNDAgainst2D (704 ms)
[ RUN      ] DeconvolutionLayerTest/1.TestSimpleDeconvolution
[       OK ] DeconvolutionLayerTest/1.TestSimpleDeconvolution (1 ms)
[ RUN      ] DeconvolutionLayerTest/1.TestGradient3D
[       OK ] DeconvolutionLayerTest/1.TestGradient3D (152 ms)
[ RUN      ] DeconvolutionLayerTest/1.TestSetup
[       OK ] DeconvolutionLayerTest/1.TestSetup (0 ms)
[----------] 5 tests from DeconvolutionLayerTest/1 (1350 ms total)

[----------] 9 tests from AdaGradSolverTest/0, where TypeParam = N5caffe9CPUDeviceIfEE
[ RUN      ] AdaGradSolverTest/0.TestAdaGradLeastSquaresUpdateLROneHundredth
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.10.0, library is 1.8.15
   SUMMARY OF THE HDF5 CONFIGURATION
   =================================

General Information:
-------------------
  HDF5 Version: 1.8.15-patch1
 Configured on: Wed Oct 14 16:52:15 CDT 2015
Configure mode: production
   Host system: i386-apple-darwin11.4.2
     Uname information: Darwin osxbuild.corp.continuum.io 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
      Byte sex: little-endian
     Libraries: shared
    Installation point: /Users/ilan/minonda/envs/_build

Compiling Options:
------------------
               Compilation Mode: production
                     C Compiler: /usr/bin/clang ( Apple LLVM version 4.2 )
                         CFLAGS: -arch x86_64
                      H5_CFLAGS:  -O3
                      AM_CFLAGS:
                       CPPFLAGS:
                    H5_CPPFLAGS:   -DNDEBUG -UH5_DEBUG_API
                    AM_CPPFLAGS:
               Shared C Library: yes
               Static C Library: no
  Statically Linked Executables: no
                        LDFLAGS: -arch x86_64
                     H5_LDFLAGS:
                     AM_LDFLAGS:
  Extra libraries: -lz -ldl -lm
        Archiver: ar
  Ranlib: ranlib
       Debugged Packages:
   API Tracing: no

Languages:
----------
                        Fortran: no

                            C++: yes
                   C++ Compiler: /usr/bin/clang++ ( Apple LLVM version 4.2 )
                      C++ Flags: -arch x86_64
                   H5 C++ Flags:  -O3
                   AM C++ Flags:
             Shared C++ Library: yes
             Static C++ Library: no

Features:
---------
                  Parallel HDF5: no
             High Level library: yes
                   Threadsafety: no
            Default API Mapping: v18
 With Deprecated Public Symbols: yes
         I/O filters (external): deflate(zlib)
                            MPE: no
                     Direct VFD: no
                        dmalloc: no
Clear file buffers before write: yes
           Using memory checker: no
         Function Stack Tracing: no
      Strict File Format Checks: no
   Optimization Instrumentation: no
Bye...
*** Aborted at 1491406895 (unix time) try "date -d @1491406895" if you are using GNU date ***
PC: @     0x7fff8b1def06 __pthread_kill
*** SIGABRT (@0x7fff8b1def06) received by PID 80047 (TID 0x7fff78f26000) stack trace: ***
    @     0x7fff961c452a _sigtramp
    @                0x2 (unknown)
    @     0x7fff9bdce6e7 abort
    @        0x107229323 H5check_version
    @        0x107c88af2 caffe::HDF5DataLayer<>::LoadHDF5FileData()
    @        0x107c87f21 caffe::HDF5DataLayer<>::LayerSetUp()
    @        0x107ceb97f caffe::Net<>::Init()
    @        0x107cea6be caffe::Net<>::Net()
    @        0x107d035ba caffe::Solver<>::InitTrainNet()
    @        0x107d02940 caffe::Solver<>::Init()
    @        0x107d02645 caffe::Solver<>::Solver()
    @        0x106854fe6 caffe::SGDSolver<>::SGDSolver()
    @        0x10686212b caffe::AdaGradSolverTest<>::InitSolver()
    @        0x10684fec2 caffe::GradientBasedSolverTest<>::InitSolverFromProtoString()
    @        0x106850a5d caffe::GradientBasedSolverTest<>::RunLeastSquaresSolver()
    @        0x10685028c caffe::GradientBasedSolverTest<>::TestLeastSquaresUpdate()
    @        0x106a9760c testing::internal::HandleExceptionsInMethodIfSupported<>()
    @        0x106a86c2a testing::Test::Run()
    @        0x106a87a12 testing::TestInfo::Run()
    @        0x106a88113 testing::TestCase::Run()
    @        0x106a8dd5b testing::internal::UnitTestImpl::RunAllTests()
    @        0x106a97e04 testing::internal::HandleExceptionsInMethodIfSupported<>()
    @        0x106a8da59 testing::UnitTest::Run()
    @        0x10670f025 main
    @     0x7fff8fb425ad start
    @                0x4 (unknown)
make: *** [runtest] Abort trap: 6

So it seems as if I still have library issues. Here is my makefile:

# 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

# 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.
# 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)/anaconda
PYTHON_INCLUDE := /Users/alan/anaconda/include/python2.7 \
 /Users/alan/anaconda/pkgs/numpy-1.10.4-py27_0/lib/python2.7/site-packages/numpy/core/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 := /Users/alan/anaconda/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 ?= @





I am somewhat of a novice to mac development, so I have the following questions:
1) What exactly is the the linking issue I'm looking at? What's this rpath thing?
2) How exactly do the libraries (dylibs) work? I don't really get what they are.
3) Where is @rpath/libcaffe.1.0.0-rc5.dylib supposed to be located?
4) How can I fix this?

yuzy...@gmail.com

unread,
Mar 17, 2018, 10:55:48 AM3/17/18
to Caffe Users
Hi friend, have you solved your problem? I face the same problem but  I do not know haw to fix it? would you please tell me your solution?

在 2017年4月5日星期三 UTC+8下午11:53:28,alan写道:
Reply all
Reply to author
Forward
0 new messages