CMakeLists.txt 3.85 KB
Newer Older
1 2 3
cmake_minimum_required(VERSION 2.8)
project(TEST_MORSE_CMAKE_MODULES_FIND Fortran C CXX)

4
# location of find package modules
5 6 7 8
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../")

# main variable: control the list of libraries to find thanks to find_package
# pay attention that package names must be given with capital letters
9
set(PACKAGES "" CACHE STRING "List of packages to find, ex: BLAS;STARPU;PASTIX")
10 11

# specific components to look for with packages
12
set(LAPACKE_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with LAPACKE, ex: TMG")
13 14 15 16 17 18 19 20 21 22
set(QUARK_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with QUARK, ex: HWLOC")
set(PASTIX_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with PASTIX, ex: MPI;SEQ;STARPU;STARPU_CUDA;STARPU_FXT;SCOTCH;PTSCOTCH;METIS")
set(PETSC_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with PETSc, ex: CXX|C")
set(FFTW_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with FFTW, ex: MKL;ESSL;THREADS;OMP;SIMPLE;LONG;QUAD")
set(MUMPS_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with MUMPS, ex: MPI;SEQ;SCOTCH;PTSCOTCH;METIS;PARMETIS;OPENMP")
set(CHAMELEON_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with CHAMELEON, ex: STARPU;QUARK;CUDA;MPI;FXT")
set(STARPU_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with STARPU, ex: HWLOC;CUDA;MPI;BLAS;MAGMA;FXT;SIMGRID")
set(PARSEC_COMPONENTS "" CACHE STRING "List of specific dependencies to look for with PARSEC, ex: HWLOC;CUDA;MPI;AYUDAME")

# to enable ctests
PRUVOST Florent's avatar
PRUVOST Florent committed
23
option(ENABLE_CTEST "Enable Testing: will test all supported packages" OFF)
24

25
foreach(_library ${PACKAGES})
26

27 28 29 30 31
  if (${_library}_COMPONENTS)
    find_package(${_library} COMPONENTS ${${_library}_COMPONENTS})
  else()
    find_package(${_library})
  endif()
32 33 34 35
  if (${_library}_FOUND)
    if (${_library}_LIBRARIES)
      message(STATUS "${_library}_LIBRARIES found: ${${_library}_LIBRARIES}")
    else()
36
      message(WARNING "${_library}_LIBRARIES not found: ${${_library}_LIBRARIES}")
37
    endif()
38 39 40
    if (${_library}_LIBRARIES_DEP)
      message(STATUS "${_library}_LIBRARIES_DEP found: ${${_library}_LIBRARIES_DEP}")
    endif()
41 42 43 44 45
    if (${_library}_LIBRARY_DIRS)
      message(STATUS "${_library}_LIBRARY_DIRS found: ${${_library}_LIBRARY_DIRS}")
    else()
      message(WARNING "${_library}_LIBRARY_DIRS not found: ${${_library}_LIBRARY_DIRS}")
    endif()
46 47 48
    if (${_library}_LIBRARY_DIRS_DEP)
      message(STATUS "${_library}_LIBRARY_DIRS_DEP found: ${${_library}_LIBRARY_DIRS_DEP}")
    endif()
49 50 51 52 53
    if (${_library}_INCLUDE_DIRS)
      message(STATUS "${_library}_INCLUDE_DIRS found: ${${_library}_INCLUDE_DIRS}")
    else()
      message(WARNING "${_library}_INCLUDE_DIRS not found: ${${_library}_INCLUDE_DIRS}")
    endif()
54 55 56
    if (${_library}_INCLUDE_DIRS_DEP)
      message(STATUS "${_library}_INCLUDE_DIRS_DEP found: ${${_library}_INCLUDE_DIRS_DEP}")
    endif()
57
  else()
58
    message(FATAL_ERROR "${_library} NOT FOUND !!")
59 60 61 62
  endif()

endforeach()

PRUVOST Florent's avatar
PRUVOST Florent committed
63 64 65 66 67 68 69 70 71 72 73 74 75
# Add CTest rules
if (ENABLE_CTEST)

  enable_testing()
  include(CTest)

  set(CTEST_PACKAGES_LIST
      BLAS
      BLASEXT
      CBLAS
      CHAMELEON
      CPPCHECK
      EZTRACE
76
      #FABULOUS see https://gitlab.inria.fr/solverstack/fabulous/issues/1
PRUVOST Florent's avatar
PRUVOST Florent committed
77 78 79 80 81
      FFTW
      FXT
      GTG
      HQR
      HWLOC
82
      #HYPRE module not ready TODO: complete it
PRUVOST Florent's avatar
PRUVOST Florent committed
83 84 85 86 87 88
      LAPACK
      LAPACKE
      LAPACKEXT
      METIS
      MPIEXT
      MUMPS
89
      #PAMPA not able to install it, link problem with ptscotch
PRUVOST Florent's avatar
PRUVOST Florent committed
90 91 92 93
      PAPI
      PARMETIS
      PARSEC
      PASTIX
94
      PETSC
PRUVOST Florent's avatar
PRUVOST Florent committed
95 96 97 98 99 100 101 102 103 104
      PTSCOTCH
      QUARK
      SCALAPACK
      SCOTCH
      SIMGRID
      STARPU
      SUITESPARSE
      TMG)

  foreach(_package ${CTEST_PACKAGES_LIST})
105
    add_test(FIND${_package} cmake ${CMAKE_SOURCE_DIR} -DPACKAGES=${_package})
PRUVOST Florent's avatar
PRUVOST Florent committed
106 107 108 109
  endforeach()

endif()

110 111 112
###
### END CMakeLists.txt
###