I've been trying to compile caffe on a mac with El Capitan.
git clone https://github.com/BVLC/caffe
mkdir build
cd build
cmake ..
The result was an error vecLib not found
The issue to solve this is to modify the file in cmake/Modules/FindvecLib.cmake
Line 19, replace
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
by
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
Don(t know if you can modify this in the master branch ?
Thanks
It sounds like a more general expression is needed that includes the OS X version number in the search path, be it 10.9, 10.11, or whatever.
Pull requests for build improvements are always welcome. Thanks for noting the issue.
open the CMakeCache.txt file,
find this line:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/System/Library/Frameworks/vecLib.framework/Headers
change to:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/vecLib.framework/Headers
work fine for me.
The general and correct expression is:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
It works if your system is not broken ;)
I have the same error popping up. And I using 'make all' command to build instead of 'came'. It gives me the following error.
clang: warning: argument unused during compilation: '-pthread'
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 changed the line 19 (putting MacOSX.sdk) as @JulianBlin had suggested but it still gives the same error. It would be a great help if someone can help me out. Thanks in advance :)
same error @Laknath1996.
But i solve by reinstall xcode command line tools by xcode-select --install
not found CMakeCache.txt
add to FindvecLib.cmake
set(vecLib_INCLUDE_DIR "PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/vecLib.framework/Headers")
I get another method: cmake/Modules/FindvecLib.cmake
find_path(vecLib_INCLUDE_DIR vecLib.h
DOC "vecLib include directory"
PATHS paths1 paths2 ...
NO_DEFAULT_PATH)
add your path where include vecLib.h to PATHS
In case this helps anyone, for macOS 10.14.6 (Mojave), I added /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/ to the find_path, like this:
find_path(vecLib_INCLUDE_DIR vecLib.h
DOC "vecLib include directory"
PATHS /System/Library/${__veclib_include_suffix}
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/
/System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/)
and it worked for me.
open the CMakeCache.txt file,
find this line:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/System/Library/Frameworks/vecLib.framework/Headerschange to:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/vecLib.framework/Headerswork fine for me.
I don't have Xcode.app in the Applications folder. Should I install it?
When I writexcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
returns.
Most helpful comment
open the CMakeCache.txt file,
find this line:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/System/Library/Frameworks/vecLib.framework/Headers
change to:
//vecLib include directory
vecLib_INCLUDE_DIR:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/vecLib.framework/Headers
work fine for me.