Skip to content

LTO compile optimization sets 'weak' variable LPF_MPI_AUTO_INITIALIZE to 1 #36

Description

@KADichev

See here for details:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271

However, the main issue is that LPF is using a non-standard "weak" qualifier, which is GCC-specific, for auto initialization.

It manifests mostly for MPICH at the moment on Ubuntu 22.04. There, following can be seen:

pkg-config --libs mpich
-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -lmpich -lpthread -lhwloc -lfabric

CMake uses this to set MPI_C_COMPILE_FLAGS, which LPF uses.

After that, MPI tests run with lpfrun wrapper fail with the message that MPI initialization was attempted twice (since LPF_MPI_AUTO_INITIALIZE was incorrectly 0).

Workaround: the MPI_C_COMPILE_FLAGS can be ommitted from LPF.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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