Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtpetraclassic.so misses dependency information #933

Closed
nschloe opened this issue Dec 15, 2016 · 5 comments
Closed

libtpetraclassic.so misses dependency information #933

nschloe opened this issue Dec 15, 2016 · 5 comments

Comments

@nschloe
Copy link
Member

nschloe commented Dec 15, 2016

When building just Tpetra, e.g., like so

make \
  -DTrilinos_ENABLE_Tpetra:BOOL=ON \
  -DBUILD_SHARED_LIBS:BOOL=ON \
  ../../source-upstream/

everything seems to be going fine. However, the two libraries libtpetraclassic.so and libtpetraclassiclinalg.so come without dependency information:

ldd ./packages/tpetra/classic/src/libtpetraclassic.so
	statically linked

All other libraries seem fine:

ldd ./packages/tpetra/core/src/libtpetra.so
	linux-vdso.so.1 =>  (0x00007fff44bbd000)
	libtrilinos_tpetrakernels.so.12 => /usr/lib/x86_64-linux-gnu/libtrilinos_tpetrakernels.so.12 (0x00007f0ffa397000)
	libtrilinos_tpetraclassicnodeapi.so.12 => /usr/lib/x86_64-linux-gnu/libtrilinos_tpetraclassicnodeapi.so.12 (0x00007f0ffa187000)
	libtrilinos_epetra.so.12 => /usr/lib/x86_64-linux-gnu/libtrilinos_epetra.so.12 (0x00007f0ff9e2d000)
        [...]

I can't quite see what's going wrong yet. Any ideas? @mhoemmen @bartlettroscoe

@mhoemmen
Copy link
Contributor

@nschloe Could you please explain how this affects build correctness? Thanks!

@nschloe
Copy link
Member Author

nschloe commented Dec 15, 2016

Well, this means that if you try to link an executable against that library, you'll have to explicitly link all its dependent libraries as well (although you're not directly using them). Typically, you'll find that only some dynamic library link info is missing (and can be detected with -Wl,--no-undefined), but here, something more fishy seems to be going on. The link line for libtpetraclassic.so is

/usr/bin/c++
-fPIC   -pedantic
-Wall -Wno-long-long -Wwrite-strings 
-std=c++11 -O3 -DNDEBUG
-Wl,--no-undefined
-shared
-Wl,-soname,libtpetraclassic.so.12
-o libtpetraclassic.so.12.11 
CMakeFiles/tpetraclassic.dir/Kokkos_Version.cpp.o 
../../../teuchos/kokkoscomm/src/libteuchoskokkoscomm.so.12.11 ../../../teuchos/remainder/src/libteuchosremainder.so.12.11 ../../../teuchos/numerics/src/libteuchosnumerics.so.12.11 ../../../teuchos/comm/src/libteuchoscomm.so.12.11 ../../../teuchos/kokkoscompat/src/libteuchoskokkoscompat.so.12.11 ../../../teuchos/parameterlist/src/libteuchosparameterlist.so.12.11 ../../../teuchos/core/src/libteuchoscore.so.12.11 ../../../kokkos/core/src/libkokkoscore.so.12.11 /usr/lib/x86_64-linux-gnu/libdl.so -lpthread /usr/lib/liblapack.so /usr/lib/libblas.so -Wl,-rpath,/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/kokkoscomm/src:/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/remainder/src:/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/numerics/src:/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/comm/src:/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/kokkoscompat/src:/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/parameterlist/src:/home/nschloe/software/trilinos/build/tpetra/packages/teuchos/core/src:/home/nschloe/software/trilinos/build/tpetra/packages/kokkos/core/src: 

i.e., there's only one object in there: CMakeFiles/tpetraclassic.dir/Kokkos_Version.cpp.o . And guess what: It contains no symbols at all:

nm -D CMakeFiles/tpetraclassic.dir/Kokkos_Version.cpp.o
nm: CMakeFiles/tpetraclassic.dir/Kokkos_Version.cpp.o: no symbols

Indeed, libtpetraclassic.so only contains no interesting symbols:

nm libtpetraclassic.so.12.11 
0000000000201020 B __bss_start
0000000000201020 b completed.7585
                 w __cxa_finalize
00000000000004a0 t deregister_tm_clones
0000000000000530 t __do_global_dtors_aux
0000000000200e78 t __do_global_dtors_aux_fini_array_entry
0000000000201018 d __dso_handle
0000000000200e88 d _DYNAMIC
0000000000201020 D _edata
0000000000201028 B _end
00000000000005a0 T _fini
0000000000000570 t frame_dummy
0000000000200e70 t __frame_dummy_init_array_entry
00000000000005b0 r __FRAME_END__
0000000000201000 d _GLOBAL_OFFSET_TABLE_
                 w __gmon_start__
0000000000000460 T _init
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
0000000000200e80 d __JCR_END__
0000000000200e80 d __JCR_LIST__
                 w _Jv_RegisterClasses
00000000000004e0 t register_tm_clones
0000000000201020 d __TMC_END__

That can't be right, can it?

@tawiesn
Copy link
Contributor

tawiesn commented Dec 15, 2016

It's my understanding that TpetraClassic is a placeholder, that we need for backwards compatibility, during the transition to the new Tpetra stack (which is rather complete?). Looking at the TpetraClassic code your observations are not surprising. I guess, TpetraClassic will go away at some point.
@mhoemmen Can you comment on this?

@mhoemmen
Copy link
Contributor

@tawiesn wrote:

It's my understanding that TpetraClassic is a placeholder, that we need for backwards compatibility, during the transition to the new Tpetra stack (which is rather complete?). Looking at the TpetraClassic code your observations are not surprising. I guess, TpetraClassic will go away at some point.

That's correct. It doesn't have any meaningful contents, except perhaps for an enum definition and some headers that remain for backwards compatibility. It will go away at some point.

@nschloe
Copy link
Member Author

nschloe commented Dec 16, 2016

Alright, I guess the Debian warnings are safe to ignore. Thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants