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

Instaled library maintains RUNPATH #82

Open
gkaf89 opened this issue Jul 13, 2023 · 2 comments
Open

Instaled library maintains RUNPATH #82

gkaf89 opened this issue Jul 13, 2023 · 2 comments

Comments

@gkaf89
Copy link

gkaf89 commented Jul 13, 2023

I am building the ScaLAPACK library using the provided CMake script. After installation, the installed library DSO maintains the RUNPATH present in the output of the build process. However, the default behavior of CMake is to remove the RUNPATH during the installation of the library according to the community wiki. I couldn't find in the CMake files any obvious command setting the RUNPATH of the installed binary (e.g. CMAKE_INSTALL_RPATH_USE_LINK_PATH). Is this behavior a bug, or a deliberate design choice?

As a work around, the build can be configured with

-D CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH:BOOL=true

and the installed library binary will have no RUNPATH entry. However, it would be nice to know the cause of the issue.

To reproduce the issue, configure the commit 7e4e07070a489686287c36ab473d21cf29a54bdd with settings from the CMakeUserPresets.json file (cmake -S . --preset default-config):

{
  "version": 2,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 20,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "default-config",
      "binaryDir": "${sourceDir}/build/Release",
      "generator": "Unix Makefiles",
      "cacheVariables": {
        "CMAKE_Fortran_FLAGS": "-fallow-argument-mismatch",
        "BUILD_SHARED_LIBS": true,
        "CMAKE_BUILD_TYPE": "Release",
        "CMAKE_PREFIX_PATH" : "$env{HOME}/opt/openblas",
        "CMAKE_INSTALL_PREFIX": "$env{HOME}/opt/scalapack"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "default-build",
      "configurePreset": "default-config"
    }
  ]
}

The OpenBLAS library is used, and the path to the installation directory with OpenBLAS is contained in the CMAKE_PREFIX_PATH entry of the settings files. The output of the build command contains in the RUNPATH entry the paths for the MPI and OpenBLAS libraries. After installation, the paths to the OpenBLAS library is removed but not the path to the MPI library.

  • Before installation:
$ readelf -d <path to build output> | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/opt/apps/resif/aion/2020b/epyc/software/UCX/1.9.0-GCCcore-10.2.0/lib64:/usr/lib64:/opt/apps/resif/aion/2020b/epyc/software/OpenMPI/4.0.5-GCC-10.2.0/lib:/home/users/gkafanas/opt/openblas/lib64:]
  • After installation:
$ readelf -d <path to installed output> | grep RUNPATH
0x000000000000001d (RUNPATH)            Library runpath: [/opt/apps/resif/aion/2020b/epyc/software/UCX/1.9.0-GCCcore-10.2.0/lib64:/usr/lib64:/opt/apps/resif/aion/2020b/epyc/software/OpenMPI/4.0.5-GCC-10.2.0/lib]

I would expect the installed ScaLAPACK DSO to have no RUNPATH entry.

I would understand it if it was a design choice to maintain the RUNPATH. However, none of the CMake variables required to install the DSO with the RUNPATH is set, so there may be some unintended side effect.

@langou
Copy link
Contributor

langou commented Jul 14, 2023

Hi,

I feel that you are reporting an issue about OpenBLAS.

The GitHub of OpenBLAS is at
https://github.com/xianyi/OpenBLAS

I think you want to report over there and not here.

Julien.

@langou langou closed this as completed Jul 14, 2023
@gkaf89
Copy link
Author

gkaf89 commented Jul 17, 2023

Sorry, I had a typo:

I am building the OpenBLAS library... -> I am building the ScaLAPACK library...

The typo has been fixed, could you reopen the issue?

@langou langou reopened this Jul 17, 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

No branches or pull requests

2 participants