Skip to content

CXX-2579 use standard directories in main install instructions #944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 28, 2023

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Mar 17, 2023

Description

This PR changes the main installation instructions to use standard directories. Installing to non-standard directories, as well as common fixes to failures to load libraries, have been moved to the "Advanced Configuration and Installation Options" instructions.

Documentation can be locally built with cmake --build cmake-build --target hugo.

Use standard install directories in main installation instructions

The error described in CXX-2579 is due to the runtime loader being unable to find the C++ driver libraries.

IMO installing to non-standard directories is not a common enough use case to add to the main installation instructions.

The C driver Unix install instructions do not set CMAKE_INSTALL_PREFIX.

A section named Installing to non-standard directories has been added to the Advanced Configuration and Installation Options page.

Add instructions for fixes to locate shared libraries

To assist users encountering errors locating shared libraries, suggested solutions were added to the "Advanced Configuration and Installation Options".

Solutions for the "Library not loaded" error on macOS were tested here.
Solutions for the "cannot open shared object file" error on Linux were tested here.

https://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-names.html suggests that application is responsible for adding paths to load:

Starting in 10.5, Apple provides rpath, which is a solution to this. When placed at the front of an install name, this asks the dynamic linker to search a list of locations for the library. That list is embedded in the application, and can therefore be controlled by the application's build process, not the framework's. A single copy of a framework can thus work for multiple purposes.

https://www.dribin.org/dave/blog/archives/2009/11/15/rpath/ also suggests this:

The linking application now needs to define what the rpath expands out to

Other improvements

  • Replace /opt/ with $HOME in non-standard directory install instructions. Installing to /opt may be more likely to require root permissions.
  • Include missing /lib in CMAKE_INSTALL_RPATH instruction.
  • Fix link rendering on configuration page.

@kevinAlbs kevinAlbs marked this pull request as ready for review March 19, 2023 17:10
Copy link
Contributor

@rcsanchez97 rcsanchez97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinAlbs kevinAlbs requested a review from eramongodb March 21, 2023 20:31
@kevinAlbs kevinAlbs merged commit 57e3761 into mongodb:master Mar 28, 2023
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