[Trilinos-Users] MueLU example - compilation
Martin Vymazal
martin.vymazal at vki.ac.be
Fri May 27 09:36:05 EDT 2016
Hello,
I can't link an example that is provided with Trilinos sources (source
file name is Simple-Complex.cpp, trilinos 12.6.3) to Trilinos. My
CMakeLists.txt is as follows:
CMAKE_MINIMUM_REQUIRED(VERSION 3.2 FATAL_ERROR)
project(MUELU_TEST CXX)
ADD_DEFINITIONS(-std=c++11)
SET( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
${CMAKE_MODULE_PATH})
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/local/gcc/openmpi")
find_package(MPI)
include_directories( ${MPI_CXX_INCLUDE_PATH} )
FIND_PACKAGE(Trilinos PATHS
$ENV{HOME}/local/gcc/trilinos-12.6.3/lib/cmake/Trilinos )
SET(MY_SOURCES src/Simple-Complex.cpp)
INCLUDE_DIRECTORIES(${Trilinos_INCLUDE_DIRS}
${Ttrilinos_TPL_INCLUDE_DIRS})
LINK_DIRECTORIES(${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
ADD_EXECUTABLE(muelu_test ${MY_SOURCES})
TARGET_LINK_LIBRARIES(muelu_test ${Trilinos_LIBRARIES}
${Trilinos_TPL_LIBRARIES} ${MPI_CXX_LIBRARIES})
and I see the following error (I pasted only the first part):
CMakeFiles/muelu_test.dir/src/Simple-Complex.cpp.o: In function `main':
Simple-Complex.cpp:(.text+0x7c2): undefined reference to
`MueLu::Hierarchy<std::complex<double>, int, int,
Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial,
Kokkos::HostSpace>
>::Hierarchy(Teuchos::RCP<Xpetra::Matrix<std::complex<double>, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace> > > const&)'
Simple-Complex.cpp:(.text+0xb1a): undefined reference to
`MueLu::TrilinosSmoother<std::complex<double>, int, int,
Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial,
Kokkos::HostSpace> >::TrilinosSmoother(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
Teuchos::ParameterList const&, int const&)'
Simple-Complex.cpp:(.text+0xbaf): undefined reference to
`MueLu::SmootherFactory<std::complex<double>, int, int,
Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial,
Kokkos::HostSpace>
>::SmootherFactory(Teuchos::RCP<MueLu::SmootherPrototype<std::complex<double>, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace> > >)'
Simple-Complex.cpp:(.text+0xc38): undefined reference to
`MueLu::FactoryManager<std::complex<double>, int, int,
Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial,
Kokkos::HostSpace> >::SetFactory(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
Teuchos::RCP<MueLu::FactoryBase const> const&)'
To make sure that muelu is specified to link to the executable, I also
tried
TARGET_LINK_LIBRARIES(muelu_test muelu muelu-adapters muelu-interface
${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${MPI_CXX_LIBRARIES})
but this does not change anything. The libraries libmuelu.so
libmuelu-interface.so and libmuelu-adapters.so are all present in the
lib folder where Trilinos is installed. I have no problems compiling and
linking other code (of my own, does not use MueLU) to Trilinos. Could
you please advise how to resolve this? Thank you.
Best regards,
Martin
More information about the Trilinos-Users
mailing list