File: FindGloo.cmake

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (49 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Try to find the Gloo library and headers.
#  Gloo_FOUND        - system has Gloo lib
#  Gloo_INCLUDE_DIRS - the Gloo include directory
#  Gloo_LIBRARY/Gloo_NATIVE_LIBRARY    - libraries needed to use Gloo

find_path(Gloo_INCLUDE_DIR
  NAMES gloo/common/common.h
  DOC "The directory where Gloo includes reside"
)

find_library(Gloo_NATIVE_LIBRARY
  NAMES gloo
  DOC "The Gloo library (without CUDA)"
)

find_library(Gloo_CUDA_LIBRARY
  NAMES gloo_cuda
  DOC "The Gloo library (with CUDA)"
)

set(Gloo_INCLUDE_DIRS ${Gloo_INCLUDE_DIR})

# use the CUDA library depending on the Gloo_USE_CUDA variable
if (DEFINED Gloo_USE_CUDA)
  if (${Gloo_USE_CUDA})
    set(Gloo_LIBRARY ${Gloo_CUDA_LIBRARY})
    set(Gloo_NATIVE_LIBRARY ${Gloo_NATIVE_LIBRARY})
  else()
    set(Gloo_LIBRARY ${Gloo_NATIVE_LIBRARY})
    set(Gloo_NATIVE_LIBRARY ${Gloo_NATIVE_LIBRARY})
  endif()
else()
  # else try to use the CUDA library if found
  if (${Gloo_CUDA_LIBRARY} STREQUAL "Gloo_CUDA_LIBRARY-NOTFOUND")
    set(Gloo_LIBRARY ${Gloo_NATIVE_LIBRARY})
    set(Gloo_NATIVE_LIBRARY ${Gloo_NATIVE_LIBRARY})
  else()
    set(Gloo_LIBRARY ${Gloo_CUDA_LIBRARY})
    set(Gloo_NATIVE_LIBRARY ${Gloo_NATIVE_LIBRARY})
  endif()
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gloo
  FOUND_VAR Gloo_FOUND
  REQUIRED_VARS Gloo_INCLUDE_DIR Gloo_LIBRARY
)

mark_as_advanced(Gloo_FOUND)