2016-11-18 19 views
0

MacにCaffe(CPUのみ)をインストールする手順に従った場合、「make -j」を実行するとエラーが発生します。 Mac OSでCaffeをインストール中に「cblas.h」エラーが発生しました

In file included from src/caffe/util/blocking_queue.cpp:5: 
In file included from ./include/caffe/layers/base_data_layer.hpp:9: 
In file included from ./include/caffe/layer.hpp:12: 
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/util/blocking_queue.o] Error 1 

は、私は行を追加しmakefile.configを修正:

USE_BLAS = apple 
ADD_LDFLAGS = -I/usr/local/opt/openblas/lib 
ADD_CFLAGS = -I/usr/local/opt/openblas/include 

が、それは問題を解決していませんでした。

ご協力いただきありがとうございます。

答えて

2

試用:brew uninstall openblas; brew install --fresh -vd openblas。次

、2つのビルドフラグを追加します(私が行ったように)

LDFLAGS: -L/usr/local/opt/openblas/lib 

CPPFLAGS: -I/usr/local/opt/openblas/include 
+3

これは私のために働いた。 'Makefile.config'で' BLAS_INCLUDE'と 'BLAS_LIB'の行を編集して、2つのビルドフラグを追加します。 – Peter

4

Z.Kalの答えは、私の場合には助けにはならなかったが、私は場合には、あなたが自作を通じて依存関係をインストールしていることに気づいた、これらの2行のコメントを解除する必要があります。

# 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 

後で私の魅力のように働いた!

cmake -DCMAKE_CXX_FLAGS=-I/usr/local/opt/openblas/include .. 

それは私のために非常にうまく機能:これは誰か:)

+1

これは私のために働く!また、「アトラス」ではなく「オープン」を選択してください。 – alanwsx

0

あなたは以下のように試すことができますが、お役に立てば幸いです。

関連する問題