pytorch/cmake/Modules/FindvecLib.cmake
Brian Wignall f326045b37 Fix typos, via a Levenshtein-type corrector (#31523)
Summary:
Should be non-semantic.

Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos, with https://github.com/bwignall/typochecker to help automate the checking.

Uses an updated version of the tool used in https://github.com/pytorch/pytorch/pull/30606 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31523

Differential Revision: D19216749

Pulled By: mrshenli

fbshipit-source-id: 7fd489cb9a77cd7e4950c1046f925d57524960ea
2020-01-17 16:03:19 -08:00

36 lines
1.3 KiB
CMake

# Find the vecLib libraries as part of Accelerate.framework or as standalone 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")
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}
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.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()