File: FindNVPL.cmake

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (78 lines) | stat: -rw-r--r-- 2,639 bytes parent folder | download | duplicates (3)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# (C) Copyright 2011- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

# - Try to find NVPL
# Once done this will define
#
#  NVPL_FOUND         - system has Nvidia Performance Libraries
#  NVPL_INCLUDE_DIRS  - the NVPL include directories
#  NVPL_LIBRARIES     - link these to use NVPL
#
# The following paths will be searched with priority if set in CMake or env
#
#  NVPLROOT           - root directory of the NVPL installation
#  NVPL_PATH          - root directory of the NVPL installation
#  NVPL_ROOT          - root directory of the NVPL installation

option( NVPL_PARALLEL "if nvpl shoudl be parallel" OFF )

if( NVPL_PARALLEL )

  set( __nvpl_lib_suffix  "_gomp" )

  find_package(Threads)

else()

  set( __nvpl_lib_suffix "_seq" )

endif()

# Search with priority for NVPLROOT, NVPL_PATH and NVPL_ROOT if set in CMake or env
find_path(NVPL_INCLUDE_DIR nvpl_blas.h
          PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
          PATH_SUFFIXES include NO_DEFAULT_PATH)

find_path(NVPL_INCLUDE_DIR_FFTW fftw3.h
          PATH_SUFFIXES include/nvpl_fftw)

if( NVPL_INCLUDE_DIR ) # use include dir to find libs

  set( NVPL_INCLUDE_DIRS ${NVPL_INCLUDE_DIR} ${NVPL_INCLUDE_DIR_FFTW} )


  #  set(CMAKE_FIND_DEBUG_MODE TRUE)
  find_library( NVPL_LIB_BLAS_CORE
                PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
		PATH_SUFFIXES "lib" 
                NAMES nvpl_blas_core )

  find_library( NVPL_LIB_BLAS
                PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
		PATH_SUFFIXES "lib" 
                NAMES nvpl_blas_lp64${__nvpl_lib_suffix} )

  find_library( NVPL_LIB_FFTW
                PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
		PATH_SUFFIXES "lib" 
                NAMES nvpl_fftw )

	#  set(CMAKE_FIND_DEBUG_MODE FALSE)

  if( NVPL_LIB_BLAS_CORE AND NVPL_LIB_BLAS AND NVPL_LIB_FFTW )
      set( NVPL_LIBRARIES ${NVPL_LIB_BLAS_CORE} ${NVPL_LIB_BLAS} ${NVPL_LIB_FFTW}  )
  endif()

endif()

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args( NVPL DEFAULT_MSG
                                   NVPL_LIBRARIES NVPL_INCLUDE_DIRS )

mark_as_advanced( NVPL_INCLUDE_DIR NVPL_LIB_BLAS NVPL_LIB_FFTW )