Skip to content

libproj: Add proper rpath for linux and macOS#4725

Closed
mwestphal wants to merge 2 commits intoOSGeo:masterfrom
mwestphal:add_rpath
Closed

libproj: Add proper rpath for linux and macOS#4725
mwestphal wants to merge 2 commits intoOSGeo:masterfrom
mwestphal:add_rpath

Conversation

@mwestphal
Copy link

@mwestphal mwestphal commented Mar 23, 2026

This add proper rpath in order to be able to use libsqlite not from system.

  • AI (Copilot or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated.
  • Closes #xxxx
  • Tests added
  • Added clear title that can be used to generate release notes
  • Fully documented, including updating docs/source/*.rst for new API

@mwtoews
Copy link
Member

mwtoews commented Mar 23, 2026

Have you checked if setting built-in -D CMAKE_BUILD_RPATH_USE_ORIGIN=ON? More docs on BUILD_RPATH_USE_ORIGIN.

I've tried it locally with Ubuntu, but I don't see anything with objdump -x /tmp/inst/lib/libproj.so | grep 'R.*PATH', so perhaps I'm missing something. I've also checked this PR too, also nothing found in libproj.so with objdump. This PR has expected:

$ objdump -x /tmp/pr4725/lib/libproj.so | grep 'R.*PATH'
  RUNPATH              $ORIGIN

@mwtoews
Copy link
Member

mwtoews commented Mar 23, 2026

I was unsuccessfully checking to see if built-in CMAKE variables could be used for this feature, but I can't see any. This PR does enable the feature. Could it be documented here?

@jjimenezshaw
Copy link
Contributor

I've tried it locally with Ubuntu, but I don't see anything with objdump -x /tmp/inst/lib/libproj.so | grep 'R.*PATH',

Have you tried readelf -d /tmp/inst/lib/libproj.so ?

@mwtoews
Copy link
Member

mwtoews commented Mar 23, 2026

@jjimenezshaw yes, tried that too. I believe that readelf -d and objdump -x are equivalent for inspecting RPATH/RUNPATH.

@mwestphal
Copy link
Author

BUILD_RPATH_USE_ORIGIN is for build rpath, not install rpath.

@mwestphal
Copy link
Author

I was unsuccessfully checking to see if built-in CMAKE variables could be used for this feature, but I can't see any. This PR does enable the feature. Could it be documented here?

done.

Co-authored-by: Mike Taves <mwtoews@gmail.com>
@mwestphal
Copy link
Author

I've been talking with CMake devs and this approach is wrong. -DCMAKE_INSTALL_RPATH should be enough to fix that locally and should not be handled by the project like that. Sorry for the noise.

@mwestphal mwestphal closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants