rpath

Setting the RPATH for external projects?

左心房为你撑大大i 提交于 2019-12-25 04:15:28
问题 I'm trying to setup a project where my repository imports all dependencies as git submodules for easy development. My colleagues can simply clone the repo, git submodule update --init --recursive , cmake . and make and have a fully working dev environment in place. The directory structure is setup as a superbuild with a CMakeLists.txt at the top level that builds all the submodules using ExternalProject_Add , resulting in the following structure: root - CMakeLists.txt (superbuild) - git

How to link shared libraries in custom path directly without specifying RPATH?

强颜欢笑 提交于 2019-12-24 18:40:29
问题 I am on Ubuntu 16.04, and I am required to use an external library (MCR). It puts all of it's shared libraries inside the MATLAB/bin/glnxa64/ folder. I only need the libmx.so in there but there are libraries in there that has the exact same name as the ones in /usr/lib but they are actually different (because the file size is different), for example libtiff.so.5 . This becomes a problem because when I use the find_library function in CMake to add MATLAB/bin/glnxa64/ into RPATH in order to

Rust and loader paths (@rpath, @loader_path) on OS X

末鹿安然 提交于 2019-12-24 01:55:26
问题 I'm trying to solve a problem with foreign library loading with Rust. Inputs: I have an executable rtest and a dylib libcpp2rs.dylib . The library is linked to the executable through FFI: #[link(name="cpp2rs")] extern { ... } My build.rs file (I'm passing an extra argument with libcpp2rs.dylib location): pub fn main() { println!("cargo:rustc-link-search=native=./cpplib/bin"); } And my Cargo.toml file: [package] name = "rtest" version = "0.1.0" authors = ["astavonin"] build = "build.rs" rpath

How to create relocatable Apps

无人久伴 提交于 2019-12-24 01:39:38
问题 hope someone can help me. I have something programed in python. That uses a lot of libraries. So I created a virtual environment with virtualenv and copied every file is needed in this environment. Then I used Platypus to create an .app. Of corse the app isn't working, because if you use otool -L on a .so or .dylib then the linking points to the original install location. Know I can use install_name_tool and set the new absolute path, the app works now, but is not relocatable. After a bit

How to manually include a dynamic library in an iOS APP

人走茶凉 提交于 2019-12-24 00:04:39
问题 I have an iOS app (not made with xcode) and I need to include in it a dynamic library. I have this library on my computer: \webrtc \WebRTC.framework \Headers \*.h \Modules \module.modulemap \WebRTC \Info.plist and I deploy those files inside my app like this : ALLiveVideoChatClient.app \Frameworks \WebRTC.framework \Headers \*.h \Modules \module.modulemap \WebRTC \Info.plist when I do otool -L ALLiveVideoChatClient.app/ALLiveVideoChatClient it's return me: @rpath/WebRTC.framework/WebRTC

automake and custom rpath

非 Y 不嫁゛ 提交于 2019-12-22 12:17:36
问题 I have to ship a third-party library with an application. Because I don't want to set LD_LIBRARY_PATH by hand or require any wrapper script I want automake to set a custom rpath . Unfortunately libtool has its own -rpath option and adding -Wl,-rpath,/foo/bar to LDFLAGS only results in g++: unrecognized option '-rpath' because libtool seems to get confused with the command line options. The same happens with the alternative form -Wl,-rpath -Wl,/foo/bar . Is there any way to specify a custom

Shipping GNU/Linux Firefox plugin with shared libraries (for installation with no root access)

旧街凉风 提交于 2019-12-21 05:31:19
问题 The application is a Firefox plugin (loaded from $HOME/.mozilla/plugins), so wrapper script that sets LD_LIBRARY_PATH is not an easy option. RPATH, as far as I know, cannot refer to $HOME and can be only absolue path. Firefox tries to dlopen it's plugin from ~/.mozilla/plugins but fails (because it depends on shared libraries installed somewhere in the user home directory). Modifying Firefox menu item to provide a wrapper (with LD_LIBRARY_PATH) around Firefox is too hacky. What should

correct usage of rpath (relative vs absolute)

血红的双手。 提交于 2019-12-18 11:52:47
问题 When building a binary or library, specifying the rpath , i.e. -Wl,rpath,<path/to/lib> tells the linker where to find the required library at runtime of the binary. What is the UNIX philosphy regarding absolute and relative paths here? Is it better to use an absolute path so the lib can be found from everywhere? Or is it better to make it relative so copying an entire directory or renaming a higher level path won't render the binary unusable? Update Using $ORIGIN is usually the preferred way

correct usage of rpath (relative vs absolute)

谁说胖子不能爱 提交于 2019-12-18 11:52:08
问题 When building a binary or library, specifying the rpath , i.e. -Wl,rpath,<path/to/lib> tells the linker where to find the required library at runtime of the binary. What is the UNIX philosphy regarding absolute and relative paths here? Is it better to use an absolute path so the lib can be found from everywhere? Or is it better to make it relative so copying an entire directory or renaming a higher level path won't render the binary unusable? Update Using $ORIGIN is usually the preferred way

How to get RPATH with $ORIGIN to work on Code::Blocks GCC?

雨燕双飞 提交于 2019-12-18 11:08:04
问题 I'm trying to link an RPATH containing the special string $ORIGIN into an executable built using GCC with the Code::Blocks IDE. I've specified -Wl,-R$ORIGIN in the linker options for the project, but the command line output to GCC is wrong (stripped for clarity): g++ -Wl,-R What is the correct way to specify this argument for Code::Blocks? 回答1: Whoever decided to make the token $ORIGIN is an evil bastard who deserves a special place in programmer hell. Since '$' is a special character for