3 #All contributions by the University of California:
4 #Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
7 #All other contributions:
8 #Copyright (c) 2014, 2015, the respective contributors
11 #Caffe uses a shared copyright model: each contributor holds copyright over
12 #their contributions to Caffe. The project versioning records all such
13 #contribution and copyright details. If a contributor wants to further mark
14 #their specific copyright on a particular contribution, they should indicate
15 #their copyright solely in the commit message of the change when it is
20 #Redistribution and use in source and binary forms, with or without
21 #modification, are permitted provided that the following conditions are met:
23 #1. Redistributions of source code must retain the above copyright notice, this
24 # list of conditions and the following disclaimer.
25 #2. Redistributions in binary form must reproduce the above copyright notice,
26 # this list of conditions and the following disclaimer in the documentation
27 # and/or other materials provided with the distribution.
29 #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30 #ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 #DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
33 #ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 #(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 #LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 #ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 #SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 #CONTRIBUTION AGREEMENT
42 #By contributing to the BVLC/caffe repository through pull-request, comment,
43 #or otherwise, the contributor releases their content to the
44 #license and copyright terms herein.
47 # Find the Atlas (and Lapack) libraries
49 # The following variables are optionally searched for defaults
50 # Atlas_ROOT_DIR: Base directory where all Atlas components are found
52 # The following are set after configuration is done:
56 # Atlas_LIBRARYRARY_DIRS
58 set(Atlas_INCLUDE_SEARCH_PATHS
60 /usr/include/atlas-base
62 $ENV{Atlas_ROOT_DIR}/include
65 set(Atlas_LIB_SEARCH_PATHS
69 $ENV{Atlas_ROOT_DIR}/lib
72 find_path(Atlas_CBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Atlas_INCLUDE_SEARCH_PATHS})
73 find_path(Atlas_CLAPACK_INCLUDE_DIR NAMES lapacke.h PATHS ${Atlas_INCLUDE_SEARCH_PATHS})
75 find_library(Atlas_CBLAS_LIBRARY NAMES ptcblas_r ptcblas cblas_r cblas PATHS ${Atlas_LIB_SEARCH_PATHS})
76 find_library(Atlas_BLAS_LIBRARY NAMES atlas_r atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
77 find_library(Atlas_LAPACK_LIBRARY NAMES lapack alapack_r alapack lapack_atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
80 Atlas_CBLAS_INCLUDE_DIR
81 Atlas_CLAPACK_INCLUDE_DIR
88 include(FindPackageHandleStandardArgs)
89 find_package_handle_standard_args(Atlas DEFAULT_MSG ${LOOKED_FOR})
92 set(Atlas_INCLUDE_DIR ${Atlas_CBLAS_INCLUDE_DIR} ${Atlas_CLAPACK_INCLUDE_DIR})
93 set(Atlas_LIBRARIES ${Atlas_LAPACK_LIBRARY} ${Atlas_CBLAS_LIBRARY} ${Atlas_BLAS_LIBRARY})
94 mark_as_advanced(${LOOKED_FOR})
96 message(STATUS "Found Atlas (include: ${Atlas_CBLAS_INCLUDE_DIR}, library: ${Atlas_BLAS_LIBRARY})")