Setting the search path environment variable for shared libraries
Steve the Fiddle
stevethefiddle at gmail.com
Mon Jun 29 23:12:52 BST 2020
On Mon, 29 Jun 2020 at 10:36, René J.V. Bertin <rjvbertin at gmail.com> wrote:
> On Monday June 29 2020 00:55:42 Steve the Fiddle wrote:
>
> >I'd prefer to avoid modifying CMakeLists.txt because it's under version
> >control (and I'm not yet familiar enough with cmake)
>
> No need for that! You just invoke cmake with
> `-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=list`
> where "list" is a semicolon-separated list of library install locations
> where you want ld.so to look for runtime libraries when the application
> starts.
Thanks for the suggestion, but I'd already tried this and it didn't fix the
problem. As we have only recently switched to cmake (from automake), it's
possible that the CMakeLists.txt may not be quite right for building this
way, so I've contacted the developer that wrote the CMakeLists.txt.
> NB, you can also use this just for a shared library.
>
>
> >I was guessing that I need to set it in:
> >"Settings > Configure kdevelop > Environment"
> >with:
> >Variable: LD_LIBRARY_PATH
> >Value: /opt/wxWidgets/lib/
> >
> >and then select that Environment Profile in:
> >"Run > Configure Launches"
> >
> >but that doesn't work.
>
> Yes, I'd expect that should work too.
>
> >
> >Unfortunately that does not work if I launch Audacity from a shell script
> >(the only way so far that I can get it to launch from within kdevelop).
>
> I don't see why it wouldn't, but then why launch from within KDevelop
> (other than via its built-in terminal emulator)?
>
Why does kdevelop provide "Execute" and "Debug" buttons? Are they not
expected features of an IDE?
>
> >Audacity should launch. Am I misunderstanding the "environment profile"
> >feature in kdevelop?
>
> I don't know :) Those profiles are set before invoking external commands,
> so that the variables in question are set in the child process. Do they
> work for you in builds and/or when invoking CMake?
>
> FWIW, I use KDevelop as little as possible as a full IDE and as much as
> possible as an editor with "intellisense" and VCS features.
Funnily enough, I'm more comfortable using Git from the command line, but
with over 8k files in the Audacity source tree I find that using and IDE is
extremely useful for understanding the code.
Steve
> It's tricky to get around automatic invocation of cmake (but I've been
> finding a way). I guess I'm a control freak and I find that letting the
> application do more makes it compete for resources with what is being done
> (I also use out-of-tree build dirs OR add the in-tree build dir to
> KDevelop's exclusion list so it doesn't waste cycles trying to reload that
> directory continuously during builds).
> Much as I appreciated graphical debuggers I also avoid to use those these
> days; with the average C++ application the debugger alone already requires
> so much RAM that I don't want another RAM hungry application competing for
> my measly 16Gb... Graphical debuggers are great in C and similar
> applications where they can help a lot exploring data structs. Doing that
> in the average modern C++ application is often a lot faster by recompiling
> with a few clever printfs at the right places (and here cmake's
> "install/fast" Makefile target is worth gold, executed in the appropriate
> build subdir).
>
> All that is not really a rant, just a reality check and a NB that I don't
> have any actual recent experience with the features we're discussing (I
> typically don't even load the debugging plugins).
>
> R.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20200629/d93524cb/attachment.htm>
More information about the KDevelop
mailing list