[Trilinos-Users] Linking path to Trilinos?

Perschbacher, Brent M bmpersc at sandia.gov
Thu Jun 9 12:00:45 MDT 2011


Sensei,
  There are actually a couple ways to get just the specific packages you
want. The easiest is probably to do the find_package for Trilinos as you are
now and then use the package specific variables. For pretty much every
Trilinos_* variable exposed with the export system there is a <package
name>_* variable. For example if you want just Epetra you can use
"Epetra_LIBRARY_DIRS" and "Epetra_TPL_LIBRARY_DIRS" instead of the Trilinos
equivalents.

The other way to do this would be instead of using find_package for
Trilinos, you can use find_package to find just Epetra(or which ever
packages you want). If you do this there will only be the Epetra_* variables
for you to get the information you want.

If you are planning on using more than one Trilinos package I would suggest
using the first option since you would only need to do one find_package call
that way. All of the variables for all the packages will be available to
you, but you can choose to just use the ones you need to reduce your link
dependencies. 


I should also note that there will be some changes coming in the next
release of Trilinos that will make it so you won't have to explicitly
specify the paths to libraries by hand. It won't hurt to do so and for now
it is necessary, but the next release will handle the find_package call more
elegantly thanks to the Kitware folks.

Brent


On 6/9/11 10:55 AM, "Sensei" <senseiwa at gmail.com> wrote:

> 
> On Jun 9, 2011, at 5:50pm, Salinger, Andrew wrote:
> 
>> 
>> Sensei,
>> 
>> I see there is a line in demos/buildAgainstTrilinos/src/CMakLists.txt:
>> 
>> LINK_DIRECTORIES (${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
>> 
>> That is meant to take care of this.
> 
> Great! That seems to work, thanks!
> 
> 
> Another question: is there a way of not linking every package from trilinos?
> Right now it's linking everything:
> 
> mpiCC     -O3  -I /shared/sw/devel/trilinos/10.6.4/include
> CMakeFiles/ex1.exe.dir/src/ex1.cpp.o  -o ex1.exe -rdynamic
> -L/shared/sw/devel/trilinos/10.6.4/lib
> -L/shared/sw/devel/qt/4.7.2/gnu/4.5.0/lib -lmsqutil -lmesquite -loptika
> -lpytrilinos -lfortrilinos -lctrilinos -lsundanceStdFwk -lsundanceStdMesh
> -lsundanceCore -lsundanceInterop -lTSFExtended -lsundanceUtils -lpiro
> -lstokhos -lmoochothyra -lmoocho -lrythmos -ltrilinoscouplings -lmoertelmesh
> -lmoertel -llocathyra -llocaepetra -lloca -lnoxthyra -lnoxepetra -lnox
> -lphalanx -lintrepid -lstk_search -lstk_linsys -lstk_mesh_fixtures
> -lstk_mesh_fem -lstk_mesh_base -lstk_util_use_cases -lstk_util_parallel
> -lstk_util_diag -lstk_util_env -lstk_util_util -lteko -lanasazitpetra
> -lModeLaplace -lanasaziepetra -lanasazi -lfei_test_utils -lfei_trilinos
> -lfei_base -lstratimikos -lstratimikosbelos -lstratimikosaztecoo
> -lstratimikosamesos -lstratimikosml -lstratimikosifpack -lifpack2
> -lbelostpetra -lbelosepetra -lbelos -lml -lkomplex -li!
>  fpack -lpamgen_extras -lpamgen -lamesos -lgaleri -laztecoo -ldpliris
> -lisorropia -loptipack -lthyratpetra -lthyraepetraext -lthyraepetra -lthyra
> -lepetraext -ltpetrainout -ltpetra -ltriutils -lglobipack -lshards -lzoltan
> -lepetra -lkokkoslinalg -lkokkosnodeapi -lkokkos -lrtop -lsacado -ltpi
> -lteuchos /shared/sw/devel/qt/4.7.2/gnu/4.5.0/lib/libQtCore.so
> /shared/sw/devel/qt/4.7.2/gnu/4.5.0/lib/libQtGui.so
> /shared/sw/devel/acml/4.4.0/gfortran64/lib/libacml.a
> /shared/sw/devel/acml/4.4.0/gfortran64/lib/libacml.a
> -Wl,-rpath,/shared/sw/devel/trilinos/10.6.4/lib:/shared/sw/devel/qt/4.7.2/gnu/
> 4.5.0/lib 
> 
> I can always do something by hand, like:
> 
> SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -lepetra -L
> ${Trilinos_LIBRARY_DIRS}")
> 
> 
> But it's ugly! :)
> 
> 
> 
> Thanks & Cheers!
> 
> 
> 
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users




More information about the Trilinos-Users mailing list