CMakeLists: funny Trilinos ${${package}_LIBRARIES}

Asked by Nico Schlömer

In the Trilinos detection section of Dolfin's main CMakeLists.txt, you'll find the loop

  foreach (lib ${${package}_LIBRARIES})

that is supposed to iterate over.. Well, I don't know. The variable ${${package}_LIBRARIES} (where ${package} assumes the values Epetra, ML, and so forth) is always empty for me, and skimming through the file I don't see where it's supposed to be set.
Anyways, this then results in the variable DOLFIN_TRILINOS_LIBRARIES to be empty, which causes errors when manipulating that (nonexistant) list further down with

      list(REVERSE DOLFIN_TRILINOS_LIBRARIES)
      list(REMOVE_DUPLICATES DOLFIN_TRILINOS_LIBRARIES)
      list(REVERSE DOLFIN_TRILINOS_LIBRARIES)

What's the purpose of that code? I could try and fix it.

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Nico Schlömer
Solved:
Last query:
Last reply:
Revision history for this message
Johannes Ring (johannr) said :
#1

The variables Epetra_LIBRARIES, ML_LIBRARIES, etc. are set in the CMake files installed by Trilinos. For instance, ML_LIBRARIES is defined in <Trilinos_install_dir>/lib/cmake/ML/MLConfig.cmake by the following line:

SET(ML_LIBRARIES "ml;ifpack;amesos;galeri-xpetra;galeri;aztecoo;isorropia;epetraext;tpetraext;tpetrainout;tpetra;triutils;zoltan;epetra;kokkosdisttsqr;kokkosnodetsqr;kokkoslinalg;kokkosnodeapi;kokkos;tpi;teuchos")

Which version of Trilinos do you have? At least version 11 is required in the current trunk.

Revision history for this message
Nico Schlömer (nschloe) said :
#2

I'm using Trilinos 11.0.2 from https://launchpad.net/~nschloe/+archive/numerical which installs the CMake configuration files under /usr/lib/cmake/, e.g.,

  /usr/lib/cmake/ML/MLConfig.cmake.

The SET(ML_LIBRARIES) line you mentioned is contained in the file, but still it doesn't seem to get properly initialized. Looking at Dolfin's main CMakeLists.txt, I don't see either where it's supposed to be included.

Revision history for this message
Johannes Ring (johannr) said :
#3

It works fine for me with Trilinos 11.0.3 built from source. If I add this line:

  message(STATUS "${package}_LIBRARIES = ${${package}_LIBRARIES}")

in the for loop starting at line #357, I get the following output:

-- Checking for Trilinos
-- Trilinos version 11.0.3 found. Checking for components
-- Epetra found
-- Zoltan found
-- ML found
-- Ifpack found
-- Amesos found
-- All necessary Trilinos components found. Trilinos will be enabled.
-- Epetra_LIBRARIES = epetra
-- Zoltan_LIBRARIES = zoltan
-- ML_LIBRARIES = ml;ifpack;amesos;galeri-xpetra;galeri;aztecoo;isorropia;epetraext;tpetraext;tpetrainout;tpetra;triutils;zoltan;epetra;kokkosdisttsqr;kokkosnodetsqr;kokkoslinalg;kokkosnodeapi;kokkos;tpi;teuchos
-- Ifpack_LIBRARIES = ifpack;amesos;aztecoo;epetraext;triutils;epetra;teuchos
-- Amesos_LIBRARIES = amesos;epetraext;triutils;epetra;teuchos

I haven't looked closely at it but I guess these variables are defined when calling find_package(Trilinos ...).

Revision history for this message
Nico Schlömer (nschloe) said :
#4

Thanks for checking. I'm getting

-- Checking for Trilinos
-- Trilinos version 11.0.3 found. Checking for components
-- Epetra found
-- Zoltan found
-- ML found
-- Ifpack found
-- Amesos found
-- All necessary Trilinos components found. Trilinos will be enabled.
-- Epetra_LIBRARIES =
-- Zoltan_LIBRARIES =
-- ML_LIBRARIES =
-- Ifpack_LIBRARIES =
-- Amesos_LIBRARIES =

Revision history for this message
Nico Schlömer (nschloe) said :
#5

Okay, I got it.
The problem was that the default (working) Trilinos installation was skipped because of the broken version installed by Dorsal (which went into /usr/local/, and thus took precedence). I'll disable the explicit building of Trilinos in Dorsal for me.
Probably somebody should have to look into how Dorsal builds Trilinos.