aushani / tsf

Temporal Scene Flow (ICRA 2017)
http://www.aushani.com/pdfs/aushani-2017a.pdf
7 stars 4 forks source link

Compiling error with bazel #3

Closed GMNetto closed 3 years ago

GMNetto commented 4 years ago

Hi,

When compiling I am getting the following error, I am running on ubuntu 18.04 and bazel 1.2.1

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/home/gustavo/tsf/cc/tools/bazel.rc
ERROR: /home/gustavo/tsf/cc/WORKSPACE:31:1: name 'new_http_archive' is not defined
ERROR: /home/gustavo/tsf/cc/WORKSPACE:39:1: name 'new_git_repository' is not defined
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
INFO: Elapsed time: 0.042s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
aushani commented 4 years ago

Can you please try building with bazel 0.4.5?

GMNetto commented 4 years ago

Hi, I was able to compile it, however, when trying to run viewer, i get the error

bazel-bin/app/flow/viewer
bazel-bin/app/flow/viewer: error while loading shared libraries: libosgUtil.so.130: cannot open shared object file: No such file or directory

However, I checked, and the .so is there

gustavo@neumann:~/tsf/OpenSceneGraph/build/local_install/lib64$ ls libosgUtil.so.130
libosgUtil.so.130
aushani commented 4 years ago

Could you please try adding it to your LD_LIBRARY_PATH? If that works we can then figure out the right way to address that issue.

GMNetto commented 4 years ago

Hi, it worked, thank you. However, I am not sure what would be the best way to address this issue.

aushani commented 4 years ago

Can you please provide the output of

$ readelf -d ./bazel-bin/app/flow/viewer

GMNetto commented 4 years ago
Dynamic section at offset 0x5d5bb8 contains 43 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libgsl.so.23]
 0x0000000000000001 (NEEDED)             Shared library: [libgslcblas.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libosg.so.130]
 0x0000000000000001 (NEEDED)             Shared library: [libosgDB.so.130]
 0x0000000000000001 (NEEDED)             Shared library: [libosgGA.so.130]
 0x0000000000000001 (NEEDED)             Shared library: [libosgQt.so.130]
 0x0000000000000001 (NEEDED)             Shared library: [libosgViewer.so.130]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libcudart.so.9.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libQtGui.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libQtCore.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libglib-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../../_solib_local/_U@gsl_S_S_Cgsl___Uexternal_Sgsl_Slib_Sx86_U64-linux-gnu:$ORIGIN/../../_solib_local/_U@openscenegraph_S_S_Copenscenegraph___Uexternal_Sopenscenegraph_Slib64:/usr/lib/cuda/lib64]
 0x000000000000000c (INIT)               0x31738
 0x000000000000000d (FINI)               0x14dff0
 0x0000000000000019 (INIT_ARRAY)         0x7c9fb8
 0x000000000000001b (INIT_ARRAYSZ)       504 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x7ca1b0
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x298
 0x0000000000000005 (STRTAB)             0x7f88
 0x0000000000000006 (SYMTAB)             0xf20
 0x000000000000000a (STRSZ)              50240 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x7d5ea8
 0x0000000000000002 (PLTRELSZ)           11808 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x2e918
 0x0000000000000007 (RELA)               0x14ea8
 0x0000000000000008 (RELASZ)             105072 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW PIE
 0x000000006ffffffe (VERNEED)            0x14d28
 0x000000006fffffff (VERNEEDNUM)         6
 0x000000006ffffff0 (VERSYM)             0x143c8
 0x000000006ffffff9 (RELACOUNT)          3050
 0x0000000000000000 (NULL)               0x0
aushani commented 4 years ago

Can you confirm that the so is in the rpath? For example, for me this is what I see:

aushani@dk-blast:~/tsf/cc/bazel-bin/app/flow]
Wed 12/11/19 20:25:16 $ ls ../../_solib_local/_U@openscenegraph_S_S_Copenscenegraph___Uexternal_Sopenscenegraph_Slib64
libosgAnimation.so        libosgManipulator.so.3.4.0   libosgSim.so.130        libosgUtil.so
libosgAnimation.so.130    libosgParticle.so            libosgSim.so.3.4.0      libosgUtil.so.130
libosgAnimation.so.3.4.0  libosgParticle.so.130        libosg.so               libosgUtil.so.3.4.0
libosgDB.so               libosgParticle.so.3.4.0      libosg.so.130           libosgViewer.so
libosgDB.so.130           libosgPresentation.so        libosg.so.3.4.0         libosgViewer.so.130
libosgDB.so.3.4.0         libosgPresentation.so.130    libosgTerrain.so        libosgViewer.so.3.4.0
libosgFX.so               libosgPresentation.so.3.4.0  libosgTerrain.so.130    libosgVolume.so
libosgFX.so.130           libosgQt.so                  libosgTerrain.so.3.4.0  libosgVolume.so.130
libosgFX.so.3.4.0         libosgQt.so.130              libosgText.so           libosgVolume.so.3.4.0
libosgGA.so               libosgQt.so.3.4.0            libosgText.so.130       libosgWidget.so
libosgGA.so.130           libosgShadow.so              libosgText.so.3.4.0     libosgWidget.so.130
libosgGA.so.3.4.0         libosgShadow.so.130          libosgUI.so             libosgWidget.so.3.4.0
libosgManipulator.so      libosgShadow.so.3.4.0        libosgUI.so.130
libosgManipulator.so.130  libosgSim.so                 libosgUI.so.3.4.0
GMNetto commented 4 years ago

Hi, yes it is

gustavo@neumann:~/tsf/cc/bazel-bin/app/flow$ chrpath -l viewer
viewer: RUNPATH=$ORIGIN/../../_solib_local/_U@gsl_S_S_Cgsl___Uexternal_Sgsl_Slib_Sx86_U64-linux-gnu:$ORIGIN/../../_solib_local/_U@openscenegraph_S_S_Copenscenegraph___Uexternal_Sopenscenegraph_Slib64:/usr/lib/cuda/lib64
gustavo@neumann:~/tsf/cc/bazel-bin/app/flow$ ls ../../_solib_local/_U@gsl_S_S_Cgsl___Uexternal_Sgsl_Slib_Sx86_U64-linux-gnu
libgslcblas.so  libgsl.so
gustavo@neumann:~/tsf/cc/bazel-bin/app/flow$ ls ../../_solib_local/_U@openscenegraph_S_S_Copenscenegraph___Uexternal_Sopenscenegraph_Slib64
libosgAnimation.so        libosgManipulator.so.3.4.0   libosgSim.so.130        libosgUtil.so
libosgAnimation.so.130    libosgParticle.so            libosgSim.so.3.4.0      libosgUtil.so.130
libosgAnimation.so.3.4.0  libosgParticle.so.130        libosg.so               libosgUtil.so.3.4.0
libosgDB.so               libosgParticle.so.3.4.0      libosg.so.130           libosgViewer.so
libosgDB.so.130           libosgPresentation.so        libosg.so.3.4.0         libosgViewer.so.130
libosgDB.so.3.4.0         libosgPresentation.so.130    libosgTerrain.so        libosgViewer.so.3.4.0
libosgFX.so               libosgPresentation.so.3.4.0  libosgTerrain.so.130    libosgVolume.so
libosgFX.so.130           libosgQt.so                  libosgTerrain.so.3.4.0  libosgVolume.so.130
libosgFX.so.3.4.0         libosgQt.so.130              libosgText.so           libosgVolume.so.3.4.0
libosgGA.so               libosgQt.so.3.4.0            libosgText.so.130       libosgWidget.so
libosgGA.so.130           libosgShadow.so              libosgText.so.3.4.0     libosgWidget.so.130
libosgGA.so.3.4.0         libosgShadow.so.130          libosgUI.so             libosgWidget.so.3.4.0
libosgManipulator.so      libosgShadow.so.3.4.0        libosgUI.so.130
libosgManipulator.so.130  libosgSim.so                 libosgUI.so.3.4.0
aushani commented 4 years ago

I'm sorry, I'm a bit stumped as I cannot recreate this error on my end. As far as I know, the shared library seems to be in the RPATH for the executable, but for some reason it cannot be loaded. The fact that adding it to the your LD_LIBRARY_PATH fixes the issue is both good as it lets you run the executable, and puzzling since that means the shared library is loading correctly once it can be found. I'll keeping thinking about this but as of now I'm not sure what's going on and I cannot recreate it.