Comments (9)
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.
The rpath is for libconfig.so, not libbear.so
from bear.
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.
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.
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.
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.
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.
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.
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)
- Empty file generated for out-of-tree kernel module HOT 3
- Add linking database HOT 1
- '--append' kills my build performance HOT 1
- Bear fails to build against latest fmt HOT 2
- build error: static assertion failed: Cannot format an argument
- Next-generation Intel compilers are not recognized by default HOT 3
- Bear exits without generating compile_commands.json HOT 1
- paths_to_include/exclude don't work if path ends in '/' HOT 1
- Bear can't out compile_commands.json in TI soc TDA4 c7 HOT 1
- Bear fails to build with fmt 10.1 HOT 5
- Bear produces empty compile_commands.json HOT 13
- Bear generates empty compile_commands.json when using VBCC frontend HOT 3
- Linking executable wrapper error HOT 1
- clang-check and clang-tidy broke down with compile_commands.json HOT 6
- bear -- make produces an empty compile_commands.json HOT 3
- bear not work HOT 2
- Bear intercept does not work with shell scripts HOT 5
- Build error: /bin/sh: 1: ctest: not found HOT 4
- Can cause link errors during cross compilation HOT 1
- Running 'nrfutil pkg' through bear won't find GLIBCXX_3.4.30 - add a "de-wrapper"? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bear.