I have C libs in ~/local/bin, which my LD_RUN_PATH and LIBRARY_PATH variables include (and CPATH gets ~/local/include For autoconf packages this does the job for preferring my locally installed versions of libs, but apparently not for nim, since I get broken binaries (e.g. Nimxapp from nimx) that I can then fix in place with e.g.
patchelf --set-rpath /home/bkerin/local/lib:/user/local/lib NimxApp
Is there a way to set up nimble to do what LD_RUN_PATH/LIBRARY_PATH/CPATH do for autoconf apps? I tried makeing a ~/.config/nim.cfg with these lines:
--path="/home/bkerin/local/lib"
--cincludes="/home/bkerin/local/include"
--clibdir="/home/bkerin/local/lib"
But I still get a binary with only /usr/local/lib in RPATH. How to do this?
Hmm, for ordinary nim binaries RPATH is right, as expected given the gcc command that --listCmd show. Thanks.
It seems like with nimx nimble just fetches things, and the build is done by nake, so I now I suspect with nimx the culprit is nake. The nimx package says the samples should be run like this:
cd $(nimble path nimx | tail -n 1)/test
nake # Build and run on the current platform
# or
nake js # Build and run in default web browser
Unfortunately nake doesn't appear to honor ~/.config/nim.cfg settings. It's definitely building things (including NimxApp, which doesn't exist before the nake command), but doesn't show the GCC command even with --listCmd in nim.cfg. Seems like maybe 2 nake bugs: ignoring environment that nim normally honors, and somehow not honoring ~/.config/nim.cfg.
Hint: cpuload [Processing] Hint: unsigned [Processing] Hint: typeinfo [Processing] Hint: intsets [Processing]
is deprecated [Deprecated]
is deprecated [Deprecated]
is deprecated [Deprecated]
is deprecated [Deprecated]
is deprecated [Deprecated]
is deprecated [Deprecated]
is deprecated [Deprecated]
Hint: glsl_codegen [Processing]
sample11_expanded_views.nim(40, 17) Hint: 'closeBttn' is declared but not used [XDeclaredButNotUsed] could not import: SDL_CaptureMouse Error: execution of an external program failed: './build/linux/NimxApp '
Take a look on this two pragmas, works for me:
https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-link-pragma
https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passl-pragma