open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.07k stars 844 forks source link

pkgconfig files not installed with `--enable-script-wrapper-compilers` #12609

Open minrk opened 3 weeks ago

minrk commented 3 weeks ago

Background information

I'm exploring the consequences of enabling --enable-script-wrapper-compilers, and noticed that enabling the script wrappers prevents installation of pkg-config files.

What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)

v5.0.3

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

From source, with this script (for conda-forge, but currently running by hand for testing)

./configure --prefix=$PREFIX \
            --disable-dependency-tracking \
            --enable-mpi-fortran \
            --enable-script-wrapper-compilers \
            --disable-wrapper-rpath \
            --disable-wrapper-runpath \
            --with-wrapper-cflags="-I$PREFIX/include" \
            --with-wrapper-cxxflags="-I$PREFIX/include" \
            --with-wrapper-fcflags="-I$PREFIX/include" \
            --with-wrapper-ldflags="${wrapper_ldflags}" \
            --with-sge \
            --with-hwloc=$PREFIX \
            --with-libevent=$PREFIX \
            --with-zlib=$PREFIX \
            --enable-mca-dso

I think the only relevant argument there is --enable-script-wrapper-compilers, the rest should probably be ignored.

Please describe the system on which you are running


Details of the problem

The openmpi pkg-config files are conditionally installed, and the condition is:

if (not OPAL_WANT_SCRIPT_WRAPPER_COMPILERS) and OPAL_INSTALL_BINARIES 

when presumably it should be:

if OPAL_WANT_SCRIPT_WRAPPER_COMPILERS  or OPAL_INSTALL_BINARIES

Which means they don't get installed if --enable-script-wrapper-compilers is given. The files are generated correctly, they just get left out of installation, so I imagine this is not deliberate. Adding cp -v ompi/tools/wrappers/*.pc $PREFIX/lib/pkgconfig/ after installation produces the desired result.

Perhaps relevant to https://github.com/open-mpi/ompi/issues/10572 where --enable-script-wrapper-compilers is discussed in reference to pkg-config, but it is not mentioned that enabling it removes all pkg-config files.

janjust commented 3 weeks ago

@jsquyres Hey, is this intended behavior? Regarding the condition on when to install pkg-config files?

@minrk just fyi - but your link seems to point to an unofficial fork.

jsquyres commented 2 weeks ago

Many thanks for the report, @minrk.

Does https://github.com/open-mpi/ompi/pull/12627 fix your issue? (that PR is against main, but it should probably apply pretty easily to the v5.0.x branch)

minrk commented 2 weeks ago

@jsquyres yes, that fixes it. Thank you!

Sorry for the weird link, that fork keeps coming up first in my searches. Fixed it.