Skip to content
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

#1008 Allow installing binaries to subdirectory while keeping CMake package scripts in the same place #1009

Conversation

lepus2589
Copy link
Contributor

Description

As suggested in #1008, this PR adds the project option LAPACK_BINARY_PATH_SUFFIX.

It names a subdirectory added to the install location of all LAPACK
binaries. It is empty by default.

This allows a consumer, to install the Reference LAPACK binaries into a
subdirectory of, e.g., /usr/local/lib without inadvertantly changing the
install location of the CMake package scripts, which remain unchanged in
/usr/local/lib/cmake.

This can be necessary to avoid conflicts with other BLAS/LAPACK
distributions. Previously, this would require the consumer to override
CMAKE_INSTALL_LIBDIR directly. This shouldn't be done, though, because
the variable is provided by the core CMake module GNUInstallDirs and is
used in many places. Thus, changing it can have unforeseen consequences.
Here, overriding it also changed the install locations of the CMake
package scripts and PKGConfig files, which prevents them from being
discovered by default by their respective tools.

This PR also fixes the CMake install instructions in the LAPACK README. They recommended the use of CMAKE_INSTALL_LIBDIR from the command line, which is bad practice (see above). Now, the CMAKE_INSTALL_PREFIX variable is recommended instead, as intended by the CMake authors.

Closes #1008.

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge.

It names a subdirectory added to the install location of all LAPACK
binaries. It is empty by default.

This allows a consumer, to install the Reference LAPACK binaries into a
subdirectory of, e.g., `/usr/local/lib` without inadvertantly changing
the install location of the CMake package scripts, which remain
unchanged in `/usr/local/lib/cmake`.

This can be necessary to avoid conflicts with other BLAS/LAPACK
distributions. Previously, this would require the consumer to override
`CMAKE_INSTALL_LIBDIR` directly. This shouldn't be done, though, because
the variable is provided by the core CMake module GNUInstallDirs and is
used in many places. Thus, changing it can have unforeseen consequences.
Here, overriding it also changed the install locations of the CMake
package scripts and PKGConfig files, which prevents them from being
discovered by default by their respective tools.
The `CMAKE_INSTALL_LIBDIR` was used here from the command line, probably
accidentally. It is a variable provided by the core CMake module
GNUInstallDirs and shouldn't be overridden. The variable, that makes
sense in this context is the `CMAKE_INSTALL_PREFIX` variable, which is
intended to be set by the user.
@lepus2589 lepus2589 changed the title #1008 Allow installing of binaries to subdirectory while keeping CMake package scripts in the same place #1008 Allow installing binaries to subdirectory while keeping CMake package scripts in the same place Apr 17, 2024
@langou langou merged commit 59fe295 into Reference-LAPACK:master Apr 17, 2024
10 checks passed
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.

Allow installing binaries to subdirectory while keeping CMake package scripts in the same place
2 participants