[Trilinos-Users] Building against Trilinos

Ted Kord teddy.kord at gmail.com
Fri May 13 12:46:27 MDT 2011


Hi Kara,

Now I get:

==
  MyApp Error: cmake must define MYAPP_TRILINOS_DIR:

    (-D MYAPP_TRILINOS_DIR:FILEPATH=<trilinos_install_prefix>)!

==

On a related note, when I try to build didaskos ex1.cpp on its own (as a
test) using the do-cmake script, my Trilinos Build is located but when I
'make', I get undefined references:

<culled>
make[2]: Leaving directory `/home/tedkord/TESTS/build'
make -f CMakeFiles/MyApp.exe.dir/build.make CMakeFiles/MyApp.exe.dir/build
make[2]: Entering directory `/home/tedkord/TESTS/build'
/usr/bin/cmake -E cmake_progress_report /home/tedkord/TESTS/build/CMakeFiles
1
[100%] Building CXX object CMakeFiles/MyApp.exe.dir/ex1.o
/usr/bin/c++    -I/home/tedkord/trilinos-10.6.4-Source/packages/didasko/src
  -o CMakeFiles/MyApp.exe.dir/ex1.o -c /home/tedkord/TESTS/ex1.cpp
Linking CXX executable MyApp.exe
/usr/bin/cmake -E cmake_link_script CMakeFiles/MyApp.exe.dir/link.txt
--verbose=1
/usr/bin/c++      CMakeFiles/MyApp.exe.dir/ex1.o  -o MyApp.exe -rdynamic
libmyappLib.a
CMakeFiles/MyApp.exe.dir/ex1.o: In function `main':
ex1.cpp:(.text+0x21): undefined reference to `MPI_Init'
ex1.cpp:(.text+0x26): undefined reference to `ompi_mpi_comm_world'
ex1.cpp:(.text+0x35): undefined reference to
`Epetra_MpiComm::Epetra_MpiComm(ompi_communicator_t*)'
ex1.cpp:(.text+0xae): undefined reference to `Epetra_MpiComm::Barrier()
const'
ex1.cpp:(.text+0xe1): undefined reference to
`Epetra_MpiComm::Broadcast(double*, int, int) const'
ex1.cpp:(.text+0xfe): undefined reference to
`Epetra_MpiComm::Broadcast(int*, int, int) const'
ex1.cpp:(.text+0x11a): undefined reference to
`Epetra_MpiComm::GatherAll(double*, double*, int) const'
ex1.cpp:(.text+0x140): undefined reference to
`Epetra_MpiComm::SumAll(double*, double*, int) const'
ex1.cpp:(.text+0x15c): undefined reference to
`Epetra_MpiComm::MaxAll(double*, double*, int) const'
ex1.cpp:(.text+0x182): undefined reference to
`Epetra_MpiComm::ScanSum(double*, double*, int) const'
ex1.cpp:(.text+0x1fa): undefined reference to `MPI_Finalize'
ex1.cpp:(.text+0x20b): undefined reference to
`Epetra_MpiComm::~Epetra_MpiComm()'
ex1.cpp:(.text+0x227): undefined reference to
`Epetra_MpiComm::~Epetra_MpiComm()'
CMakeFiles/MyApp.exe.dir/ex1.o: In function `MPI::Intracomm::Intracomm()':
ex1.cpp:(.text._ZN3MPI9IntracommC2Ev[MPI::Intracomm::Intracomm()]+0x14):
undefined reference to `MPI::Comm::Comm()'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_contiguous(int) const':
ex1.cpp:(.text._ZNK3MPI8Datatype17Create_contiguousEi[MPI::Datatype::Create_contiguous(int)
const]+0x28): undefined reference to `MPI_Type_contiguous'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_vector(int, int, int) const':
ex1.cpp:(.text._ZNK3MPI8Datatype13Create_vectorEiii[MPI::Datatype::Create_vector(int,
int, int) const]+0x35): undefined reference to `MPI_Type_vector'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_indexed(int, int const*, int const*) const':
ex1.cpp:(.text._ZNK3MPI8Datatype14Create_indexedEiPKiS2_[MPI::Datatype::Create_indexed(int,
int const*, int const*) const]+0x38): undefined reference to
`MPI_Type_indexed'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_hindexed(int, int const*, long const*) const':
ex1.cpp:(.text._ZNK3MPI8Datatype15Create_hindexedEiPKiPKl[MPI::Datatype::Create_hindexed(int,
int const*, long const*) const]+0x38): undefined reference to
`MPI_Type_create_hindexed'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_hvector(int, int, long) const':
ex1.cpp:(.text._ZNK3MPI8Datatype14Create_hvectorEiil[MPI::Datatype::Create_hvector(int,
int, long) const]+0x36): undefined reference to `MPI_Type_create_hvector'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_indexed_block(int, int, int const*) const':
ex1.cpp:(.text._ZNK3MPI8Datatype20Create_indexed_blockEiiPKi[MPI::Datatype::Create_indexed_block(int,
int, int const*) const]+0x36): undefined reference to
`MPI_Type_create_indexed_block'
CMakeFiles/MyApp.exe.dir/ex1.o: In function
`MPI::Datatype::Create_resized(long, long) const':

</culled>

Ted


On 13 May 2011 15:49, Peterson, Kara J. <kjpeter at sandia.gov> wrote:

>  Hi Ted,
>
>  Try changing your do-cmake file to the following:
>
>  cmake \
>  -D Trilinos_PREFIX:PATH=/home/tedkord/TRILINOS/BUILD \
>  -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
>  ..
>
>  This should enable cmake to locate your Trilinos build.
>
>
>  Regards,
>
>  Kara
>
>
>
>   From: Ted Kord <teddy.kord at gmail.com>
> Date: Fri, 13 May 2011 14:45:44 +0100
> To: <trilinos-users at software.sandia.gov>
> Subject: [Trilinos-Users] Building against Trilinos
>
>  I'm trying to test this out but with no success so far. I've gone into
> the:
>
>  trilinos-10.6.4-Source/demos/buildAgainstTrilinos/build   directory.
>
>  I've modified the do-cmake script as follows:
>
>  <do-cmake>
> rm CMakeCache.txt
>
>  cmake \
>  -D MYAPP_TRILINOS_DIR:FILEPATH=/home/tedkord/TRILINOS/BUILD \
>  -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
>  ..
> </do-cmake>
>
>  When I run the do-cmake script, I get:
>
>  ====
> CMake Warning at CMakeLists.txt:12 (FIND_PACKAGE):
>    Could not find a configuration file for package Trilinos.
>
>    Set Trilinos_DIR to the directory containing a CMake configuration file
> for
>   Trilinos.  The file will have one of the following names:
>
>      TrilinosConfig.cmake
>     trilinos-config.cmake
>
>
>
>  CMake Error at CMakeLists.txt:15 (MESSAGE):
>   Could not find Trilinos!
>
>
>  -- Configuring incomplete, errors occurred!
> ====
>
>  TrilinosConfig.cmake is in "home/tedkord/TRILINOS" but Trilinos is
> installed in "home/tedkord/TRILINOS/BUILD". In any case, using both
> directories gives the same error as above.
>
>  --
> Best regards,
>
>  Theodore
>
>
>  _______________________________________________ Trilinos-Users mailing
> list Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>



-- 
Best regards,

Theodore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20110513/7d3a9902/attachment.html 


More information about the Trilinos-Users mailing list