lars$ make all
LD -o .build_release/lib/libcaffe.so.1.0.0
ld: cannot link directly with /System/Library/Frameworks//vecLib.framework/vecLib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
```
This appears to be a common problem [1,2]. Despite providing the explicit paths to the Accelerate and non-Accelerate version of vecLib in cmake [3], I cannot get past this linker error. System re-installation as in [1] is no option.
Any advice?
[1]ย https://github.com/BVLC/caffe/issues/6781
[2]ย https://medium.com/@buffaloal/build-caffe-with-anaconda-on-macos-1070a8d0a9fe
[3]ย https://github.com/BVLC/caffe/blob/master/cmake/Modules/FindvecLib.cmake#L18
Below my complete FindvecLib.cmake with the absolute path to vecLib.
--------------------------------------------------
# Find the vecLib libraries as part of Accelerate.framework or as standalon framework
#
# The following are set after configuration is done:
#ย VECLIB_FOUND
#ย vecLib_INCLUDE_DIR
#ย vecLib_LINKER_LIBS
if(NOT APPLE)
ย return()
endif()
set(__veclib_include_suffix "Frameworks/vecLib.framework/Versions/Current/Headers")
exec_program(xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
find_path(vecLib_INCLUDE_DIR vecLib.h
ย ย ย ย ย DOC "vecLib include directory"
PATHS
#/System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
ย ย ย ย ย ย ย ย /System/Library/${__veclib_include_suffix}
# ${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
ย ย ย ย ย ย /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers
ย ย ย ย ย NO_DEFAULT_PATH)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(vecLib DEFAULT_MSG vecLib_INCLUDE_DIR)
if(VECLIB_FOUND)
#ย if(vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
#ย ย set(vecLib_LINKER_LIBS -lcblas "-framework vecLib")
#ย ย message(STATUS "Found standalone vecLib.framework")
#ย else()
ย ย set(vecLib_LINKER_LIBS -lcblas "-framework Accelerate")
ย ย message(STATUS "Found vecLib as part of Accelerate.framework")
#ย endif()
ย mark_as_advanced(vecLib_INCLUDE_DIR)
endif()
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep 'version' | sed 's/[^0-9]*\([0-9]\).*/\1/'
1
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep 'version' | sed 's/[^0-9]*\([^\.]*\).*/\1/'
10
$ย
ย XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep 'version' | sed 's/[^0-9]*\([^\.]*\).*/\1/')