Code Monkey home page Code Monkey logo

Comments (9)

rizsotto avatar rizsotto commented on May 9, 2024

sorry, but i don't see why it needs to set LD_LIBRARY_PATH. the bear executable does not link against the libear.so file.

from bear.

btorpey avatar btorpey commented on May 9, 2024

The rpath is for libconfig.so, not libbear.so

from bear.

rizsotto avatar rizsotto commented on May 9, 2024

okay, but from the report you sent i could not figure out why it is an issue. but now i understand that libconfig.so is installed under /usr/local/lib* and it is not by default in the loader search path. and i think this case you should use LD_LIBRARY_PATH or teach your dynamic loader another way to find the dependencies. what OS/distro do you use anyway?

from bear.

btorpey avatar btorpey commented on May 9, 2024

This is plain vanilla CentOS 6.5. By default, /usr/local/lib is not searched for dependencies:

/home/btorpey/Bear-master $ cmake .
-- Looking for scons
-- Looking for qmake
-- Looking for qmake -- found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/btorpey/Bear-master
/home/btorpey/Bear-master $ make clean; make
[ 10%] Building C object src/CMakeFiles/bear.dir/stringarray.c.o
[ 20%] Building C object src/CMakeFiles/bear.dir/protocol.c.o
[ 30%] Building C object src/CMakeFiles/bear.dir/main.c.o
[ 40%] Building C object src/CMakeFiles/bear.dir/output.c.o
[ 50%] Building C object src/CMakeFiles/bear.dir/filter.c.o
[ 60%] Building C object src/CMakeFiles/bear.dir/json.c.o
Linking C executable bear
[ 60%] Built target bear
[ 70%] Building C object src/CMakeFiles/ear.dir/stringarray.c.o
[ 80%] Building C object src/CMakeFiles/ear.dir/protocol.c.o
[ 90%] Building C object src/CMakeFiles/ear.dir/environ.c.o
[100%] Building C object src/CMakeFiles/ear.dir/execs.c.o
Linking C shared library libear.so
[100%] Built target ear
/home/btorpey/Bear-master $ su
[root@nydevd015 Bear-master]# make install
[ 60%] Built target bear
[100%] Built target ear
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/share/doc/bear/COPYING
-- Up-to-date: /usr/local/share/doc/bear/README.md
-- Up-to-date: /usr/local/share/doc/bear/ChangeLog.md
-- Installing: /usr/local/bin/bear
-- Removed runtime path from "/usr/local/bin/bear"
-- Installing: /usr/local/lib64/libear.so
-- Up-to-date: /usr/local/etc/bear.conf
-- Up-to-date: /usr/local/share/man/man1/bear.1
[root@nydevd015 Bear-master]# exit
exit
/home/btorpey/Bear-master $ ldd `which bear`
    linux-vdso.so.1 =>  (0x00007fffce9b3000)
    libconfig.so.9 => not found
    libc.so.6 => /lib64/libc.so.6 (0x0000003b20400000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003b1fc00000)
/home/btorpey/Bear-master $ 

from bear.

rizsotto avatar rizsotto commented on May 9, 2024

understand. i would prefer not to make any changes (specially not rpath) into Bear build process to fix this issue. if i were you i would put LD_LIBRARY_PATH initialization into my shell profile, or if you are root on that machine you could edit /etc/ld.so.conf to make it system wide.

from bear.

btorpey avatar btorpey commented on May 9, 2024

OK. Ideally any package (e.g., libconfig) that installs itself in a non-default location would manipulate ld.so.conf as part of installing itself. (I notice that on my machine, mysql, oprofile, and qt all do that).

Still, it might be worth pointing out in your docs -- I'm generally happy to rtfm when installing something like bear, but I also generally don't bother doing that with dependencies.

Thanks again!

from bear.

btorpey avatar btorpey commented on May 9, 2024

Also, while I understand this topic is somewhat controversial, there is at least one project that seems to feel that rpath is OK:

/home/btorpey $ readelf -d which clang | grep RPATH
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../lib]

from bear.

kprav33n avatar kprav33n commented on May 9, 2024

Use of rpath vs LD_LIBRARY_PATH is debatable. IMO, under certain circumstances, using rpath is better than using LD_LIBRARY_PATH.

In my case, I'm installing Bear in a non standard location, and I don't have root access on the build machine, that I'm on. I can't manipulate ld.so.conf. I prefer rpath over LD_LIBRARY_PATH. Here is the tweak that I used to retain the rpath in the bear binary. YMMV.

PKG_CONFIG_PATH=/your/custom/prefix/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=/your/custom/prefix -DCMAKE_SKIP_RPATH=YES -DCMAKE_EXE_LINKER_FLAGS="-Wl,-R/your/custom/prefix/lib" ../Bear

from bear.

rizsotto avatar rizsotto commented on May 9, 2024

Thanks you Kumar for sharing your thoughts. I'm happy to see that current makefile allows to use rpath when that demanded, but also leave the option not to use it. Your tweak might go into the readme file. Thanks a lot!

from bear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.