|
| 1 | +# |
| 2 | +# Cherche les composants de Trilinos nécessaires pour Aleph. |
| 3 | +# |
| 4 | +# Afin de ne pas interférer avec la package Trilinos, on nomme ce |
| 5 | +# package 'TrilinosAleph'. Il n'est utilisé que pour Aleph |
| 6 | +# |
| 7 | +# À la date de novembre 2023, L'utilisation de CMake |
| 8 | +# avec Trilinos est assez compliqué car Trilinos fournit |
| 9 | +# des fichiers de configuration CMake pour chaque composant |
| 10 | +# mais ces derniers ne sont pas facilement utilisables pour deux raisons: |
| 11 | +# - le nom de la cible peut varier suivant l'installation. |
| 12 | +# Par exemple, pour un composant 'ifpack', le nom |
| 13 | +# de la cible peut être 'ifpack' (si compilé avec Spack) |
| 14 | +# ou 'trilinos_ifpack' (si package système ubuntu) |
| 15 | +# - la cible importée ne contient pas la liste des fichiers |
| 16 | +# d'en-tête nécessaires. |
| 17 | +# |
| 18 | +# Le seul moyen qui semble identique quelles que soient les |
| 19 | +# installations est d'utilier les variables '<pkg>_INCLUDE_DIRS' |
| 20 | +# et '<pkg>_LIBRARIES'. On utilise donc ce mécanisme. |
| 21 | +# |
| 22 | +arccon_return_if_package_found(TrilinosAleph) |
| 23 | + |
| 24 | +set(Trilinos_TARGETS_IMPORTED 1) |
| 25 | +find_package(AztecOO QUIET) |
| 26 | +find_package(ML QUIET) |
| 27 | +find_package(Ifpack QUIET) |
| 28 | +find_package(Epetra QUIET) |
| 29 | + |
| 30 | +message(STATUS "AztecOO_FOUND " ${AztecOO_FOUND}) |
| 31 | +message(STATUS "ML_FOUND " ${ML_FOUND}) |
| 32 | +message(STATUS "Ifpack_FOUND " ${Ifpack_FOUND}) |
| 33 | +message(STATUS "Epetra_FOUND " ${Epetra_FOUND}) |
| 34 | + |
| 35 | +set(TrilinosAleph_FOUND "NO") |
| 36 | + |
| 37 | +if (AztecOO_FOUND AND ML_FOUND AND Ifpack_FOUND AND Epetra_FOUND) |
| 38 | + message(STATUS "Found Trilinos components for Aleph") |
| 39 | + SET(TrilinosAleph_INCLUDE_DIRS "${AztecOO_INCLUDE_DIRS}" "${ML_INCLUDE_DIRS}" "${Ifpack_INCLUDE_DIRS}" "${Epetra_INCLUDE_DIRS}") |
| 40 | + SET(TrilinosAleph_LIBRARIES "${AztecOO_LIBRARIES}" "${ML_LIBRARIES}" "${Ifpack_LIBRARIES}" "${Epetra_LIBRARIES}") |
| 41 | + if (TrilinosAleph_INCLUDE_DIRS AND TrilinosAleph_LIBRARIES) |
| 42 | + set(TrilinosAleph_FOUND YES) |
| 43 | + endif() |
| 44 | +endif() |
| 45 | + |
| 46 | +# Remove duplicate libraries, keeping the last (for linking) |
| 47 | +if (TrilinosAleph_FOUND) |
| 48 | + set(TrilinosAleph_FOUND TRUE) |
| 49 | + LIST(REVERSE TrilinosAleph_LIBRARIES) |
| 50 | + LIST(REMOVE_DUPLICATES TrilinosAleph_LIBRARIES) |
| 51 | + LIST(REVERSE TrilinosAleph_LIBRARIES) |
| 52 | + arccon_register_package_library(TrilinosAleph TrilinosAleph) |
| 53 | +endif () |
| 54 | + |
| 55 | +message(STATUS "TrilinosAleph_LIBRARIES = ${TrilinosAleph_LIBRARIES}") |
| 56 | +message(STATUS "TrilinosAleph_INCLUDE_DIRS = '${TrilinosAleph_INCLUDE_DIRS}'") |
| 57 | +message(STATUS "TrilinosAleph_FOUND = '${TrilinosAleph_FOUND}'") |
| 58 | + |
| 59 | +if (NOT TrilinosAleph_FOUND) |
| 60 | + unset(TrilinosAleph_INCLUDE_DIRS) |
| 61 | + unset(TrilinosAleph_LIBRARIES) |
| 62 | +endif() |
| 63 | + |
| 64 | +# ---------------------------------------------------------------------------- |
| 65 | +# Local Variables: |
| 66 | +# tab-width: 2 |
| 67 | +# indent-tabs-mode: nil |
| 68 | +# coding: utf-8-with-signature |
| 69 | +# End: |
0 commit comments