[Trilinos-Users] Building against Trilinos

Ted Kord teddy.kord at gmail.com
Fri May 13 18:12:37 MDT 2011


Hi Kara,

I've managed to test it successfully with didasko ex1.cpp. All works fine
now.

Thank you.

Ted


On 13 May 2011 23:46, Ted Kord <teddy.kord at gmail.com> wrote:

> Hi Kara,
>
> TrilinosConfig.cmake is in /home/tedkord/TRILINOS . It works if I set
> Trilinos_PREFIX:PATH to /home/tedkord/TRILINOS:
>
> -D Trilinos_PREFIX:PATH=/home/tedkord/TRILINOS
>
> but not if I set it to:
>
> -D Trilinos_PREFIX:PATH=/home/tedkord/TRILINOS/BUILD
>
> Thanks.
>
> Now, when trying to build didasko ex1.cpp as a test, right at the end of
> running do-cmake, I get:
>
> ==
> -- Looking for Epetra: -- found, compiling with -DMYAPP_EPETRA
> CMake Error at CMakeLists.txt:70 (ADD_SUBDIRECTORY):
>   add_subdirectory given source "src" which is not an existing directory.
>
> CMake Error at CMakeLists.txt:74 (ADD_SUBDIRECTORY):
>   add_subdirectory given source "test" which is not an existing directory.
>
> -- Configuring incomplete, errors occurred!
> ===
>
> What I did was:
>
> Created a directory TEST
> Created TEST/build
> Created TEST/src
> Cread TEST/test
> Copied the do-cmake script to TEST/build
> Copied ex1.cpp to TEST/src
> ./do-cmake in TEST/build
>
>
> Ted
>
>
> On 13 May 2011 22:13, Peterson, Kara J. <kjpeter at sandia.gov> wrote:
>
>>  Hi Ted,
>>
>>  Can you double check that you have the following line set to the path to
>> your build directory of Trilinos? There should be a TrilinosConfig.cmake
>> file in the top level of that directory.
>>
>>   -D Trilinos_PREFIX:PATH=/home/tedkord/TRILINOS/BUILD
>>
>>  I can reproduce the error you got below when I point to a directory
>> other than the build directory, such as the directory containing the
>> Trilinos source.
>>
>>  Regards,
>>
>>  Kara
>>
>>
>>   From: Ted Kord <teddy.kord at gmail.com>
>> Date: Fri, 13 May 2011 21:39:13 +0100
>> To: Kara Peterson <kjpeter at sandia.gov>
>> Cc: "trilinos-users at software.sandia.gov" <
>> trilinos-users at software.sandia.gov>
>> Subject: Re: [Trilinos-Users] Building against Trilinos
>>
>>  Hi Kara,
>>
>>  I've replaced the CMakeLists.txt in the directory above the build
>> directory. The output from running the do-cmake script is now:
>>
>>  CMake Error at CMakeLists.txt:11 (FIND_PACKAGE):
>>   Could not find module FindTrilinos.cmake or a configuration file for
>>   package Trilinos.
>>
>>    Adjust CMAKE_MODULE_PATH to find FindTrilinos.cmake or 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
>>
>>  Found Trilinos!  Here are the details:
>>    Trilinos_DIR = Trilinos_DIR-NOTFOUND
>>    Trilinos_VERSION =
>>    Trilinos_PACKAGE_LIST =
>>    Trilinos_LIBRARIES =
>>    Trilinos_INCLUDE_DIRS =
>>    Trilinos_LIBRARY_DIRS =
>>    Trilinos_TPL_LIST =
>>    Trilinos_TPL_INCLUDE_DIRS =
>>    Trilinos_TPL_LIBRARIES =
>>    Trilinos_TPL_LIBRARY_DIRS =
>>    Trilinos_BUILD_SHARED_LIBS =
>> End of Trilinos details
>>
>>  -- The C compiler identification is GNU
>> -- The CXX compiler identification is GNU
>> -- Check for working C compiler: /usr/bin/gcc
>> -- Check for working C compiler: /usr/bin/gcc -- works
>> -- Detecting C compiler ABI info
>> -- Detecting C compiler ABI info - done
>> -- Check for working CXX compiler: /usr/bin/c++
>> -- Check for working CXX compiler: /usr/bin/c++ -- works
>> -- Detecting CXX compiler ABI info
>> -- Detecting CXX compiler ABI info - done
>> -- Checking if MPI is enabled in Trilinos:
>> -- Checking if MPI is enabled in Trilinos: MPI NOT ENABLED
>> -- Looking for Epetra:
>> -- Looking for Epetra: -- not found.
>> -- Configuring incomplete, errors occurred!
>>
>>
>>  do-cmake script:
>> =============
>>  cmake \
>>  -D Trilinos_PREFIX:PATH=/home/tedkord/TRILINOS/BUILD \
>>  -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
>>  ..
>>
>>  Ted
>>
>>
>> On 13 May 2011 21:25, Peterson, Kara J. <kjpeter at sandia.gov> wrote:
>>
>>>   Hi Ted,
>>>
>>>  The problem is apparently in the CMakeLists.txt file in the
>>> buildAgainstTrilinos directory, which I believe is looking for an installed
>>> Trilinos based on how it is searching. I've attached a revised
>>> CMakeLists.txt file that should work with the do-cmake that I suggested
>>> below, which defines Trilinos_PREFIX and not MYAPP_TRILINOS_DIR.   Just
>>> replace the CMakeLists.txt in the directory above the build directory with
>>> the one attached.
>>>
>>>  Regarding the errors you are getting when you try to compile the
>>> Didasko example, it looks like the code is not linking to your MPI library
>>> correctly. Try again once you get the do-cmake working correctly. Hopefully,
>>> when the do-cmake finds Trilinos all the dependencies will be treated
>>> correctly automatically.
>>>
>>>  Kara
>>>
>>>   From: Ted Kord <teddy.kord at gmail.com>
>>>  Date: Fri, 13 May 2011 20:58:13 +0100
>>> To: Kara Peterson <kjpeter at sandia.gov>
>>>  Cc: "trilinos-users at software.sandia.gov" <
>>> trilinos-users at software.sandia.gov>
>>> Subject: Re: [Trilinos-Users] Building against Trilinos
>>>
>>>  On reflection, this still means my Trilinos build is still not being
>>> found. What could be the problem?
>>>
>>>  Ted
>>>
>>>
>>> On 13 May 2011 19:46, Ted Kord <teddy.kord at gmail.com> wrote:
>>>
>>>> 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
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Best regards,
>>>
>>>  Theodore
>>>
>>>
>>>
>>
>>
>> --
>> Best regards,
>>
>>  Theodore
>>
>>
>>
>
>
> --
> 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/20110514/7fe1922d/attachment-0001.html 


More information about the Trilinos-Users mailing list