Skip to content

adios2-config installation does not respect DESTDIR #3941

@drew-parsons

Description

@drew-parsons

Describe the bug

Preparing linux distribution (Debian) packaging for adios 2.9.2 fails at the point of installing adios2-config because of PR #3850 . This PR was intended to fix DESTDIR installation but has instead broken it.

The problem is

In the case where ${1:0:1} is "/" (absolute, not relative path) l.69 tests if PREFIX already exists and only prepends DESTDIR if it does not already exist.

But PREFIX is initially set to the end-installation value /usr, which obviously exists. So DESTDIR is never applied.

The error message emitted by the generated generate-adios2-config.sh and cmake (make install) is

Configuring adios2-config dummy CMake project
...
Writing /usr/bin/adios2-config
/projects/adios2/build/cmake/install/post/generate-adios2-config.sh: line 202: /usr/bin/adios2-config Permission denied
chmod: cannot access '/usr/bin/adios2-config': No such file or directory

The "Permission denied" error is due to the error that I am reporting here, from

"@ADIOS2_BINARY_DIR@/cmake/install/post/adios2-config.post.sh" > "${BINDIR}/adios2-config@ADIOS2_EXECUTABLE_SUFFIX@"

The script is trying to write to ${BINDIR}/adios2-config, but BINDIR is defined as ${PREFIX}/bin (
BINDIR="${PREFIX}/@CMAKE_INSTALL_BINDIR@"
) Since PREFIX does not have DESTDIR applied to it, the script is trying to install into the end-installation directory rather than the DESTDIR location, for which it does not have permission.

To Reproduce
I worked around #3669 (adios2 cmake config not found) by adding the installed cmake path, running cmake with -DCMAKE_PREFIX_PATH=${DESTDIR}/usr/lib/cmake/adios2/"

DESTDIR is intended to be DESTDIR=/projects/adios2/install

Expected behavior
DESTDIR installation of /usr/bin/adios2-config should not fail.

Desktop (please complete the following information):

  • OS/Platform: Debian unstable
  • Build gcc 13.2.0, cmake 3.27.8, build type: shared

Following up
Was the issue fixed? Please report back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions