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

SuperLU's CMake install is misconfigured #78

Open
alexchandel opened this issue Feb 27, 2023 · 2 comments
Open

SuperLU's CMake install is misconfigured #78

alexchandel opened this issue Feb 27, 2023 · 2 comments

Comments

@alexchandel
Copy link

SuperLU repeatedly uses CMAKE_INSTALL_PREFIX to assert its installation location during configuration, and even sets it.

set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
if (NOT CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX /usr/local)
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/superlu.pc
	DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

This is one of the most grievous CMake sins you can commit.

You must not assume CMAKE_INSTALL_PREFIX is valid at configuration, nor set it. You must pass relative paths to install(), because the user must be able to substitute an installation root at installation time. Instead of passing your desired absolute path to install(), you should invoke installation as cmake --install . --prefix /usr/local.

@gruenich
Copy link
Contributor

gruenich commented Apr 6, 2023

I think

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

and

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/superlu.pc
    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

are both ok, and can remain.

The other two issues mentioned, should be fixed. I give it a try, see #81.

@gruenich
Copy link
Contributor

gruenich commented Aug 5, 2023

@alexchandel, can you please check current master if the issue persist or confirm that my commits fixed them?

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

No branches or pull requests

2 participants