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

[openmpi] find_package(MPI) doesn't work correctly for debug configuration #18151

Open
dg0yt opened this issue May 27, 2021 · 3 comments
Open
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@dg0yt
Copy link
Contributor

dg0yt commented May 27, 2021

Describe the bug

When trying to enable netcdf-c utilities with parallel hdf5 (work in progress), the following warning is issued to stderr:

CMake Warning at /home/dg0yt/Projekte/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake:664 (_add_executable):
  Cannot generate a safe runtime search path for target ncgen because there
  is a cycle in the constraint graph:

    dir 0 is [/home/dg0yt/Projekte/vcpkg/vcpkg/installed/x64-linux/debug/lib]
      dir 1 must precede it due to runtime library [libmpi.so.40]
    dir 1 is [/home/dg0yt/Projekte/vcpkg/vcpkg/installed/x64-linux/lib]
      dir 0 must precede it due to runtime library [libmpi.so.40]

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  ncgen/CMakeLists.txt:23 (ADD_EXECUTABLE)

I assume this is caused by the way how MPI is used with CMake. CMake's FindMPI.cmake relies on finding an MPIEXEC_EXECUTABLE via find_program. But even for debug builds, CMAKE_PROGRAM_PATH doesn't guide cmake to look for the tool in tools/openmpi/debug. So the release tools are found and used, leading to the mix release and debug configuration.

Environment

  • OS: Linux

To Reproduce

$ ./vcpkg install hdf5[parallel]
$ cat buildtrees/hdf5/*-dbg/CMakeCache.txt  | grep MPIEXEC_EXECUTABLE:
MPIEXEC_EXECUTABLE:FILEPATH=/home/dg0yt/Projekte/vcpkg/vcpkg/installed/x64-linux/tools/openmpi/bin/mpiexec

Expected behavior

$ ./vcpkg install hdf5[parallel]
$ cat buildtrees/hdf5/*-dbg/CMakeCache.txt  | grep MPIEXEC_EXECUTABLE:
MPIEXEC_EXECUTABLE:FILEPATH=/home/dg0yt/Projekte/vcpkg/vcpkg/installed/x64-linux/tools/openmpi/debug/bin/mpiexec

Additional context

Package installation layout for tools #17607

@JackBoosY JackBoosY self-assigned this May 27, 2021
@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label May 27, 2021
@JackBoosY JackBoosY added requires:discussion and removed category:port-bug The issue is with a library, which is something the port should already support labels May 28, 2021
@JackBoosY
Copy link
Contributor

JackBoosY commented May 28, 2021

For tools, I don’t think we need to use the debug version, because its performance is much lower, and it can’t help us to debug.

BTW, I can confirm this issue.

@dg0yt
Copy link
Contributor Author

dg0yt commented May 28, 2021

For tools, I don’t think we need to use the debug version, because its performance is much lower, and it can’t help us to debug.

I can agree for gettext tools, moc and similar. But there are tools which carry lib path and linkage information:

  • curl-config
  • geos-config
  • qmake

and probably this is true also for some or all MPI tools? FindMPI.cmake is non-trivial IIRC.

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label May 31, 2021
@Osyotr
Copy link
Contributor

Osyotr commented Jun 4, 2021

Hit me today with:

1> [CMake] CMake Warning at /home/me/development/vcpkg/scripts/buildsystems/vcpkg.cmake:596 (_add_library):
1> [CMake]   Cannot generate a safe runtime search path for target my_target because there
1> [CMake]   is a cycle in the constraint graph:
1> [CMake] 
1> [CMake]     dir 0 is [/mnt/d/my_project/out/build/WSL-GCC-Debug/vcpkg_installed/x64-linux/debug/lib]
1> [CMake]       dir 1 must precede it due to runtime library [lib7zip.so]
1> [CMake]     dir 1 is [/mnt/d/my_project/out/build/WSL-GCC-Debug/vcpkg_installed/x64-linux/lib]
1> [CMake]       dir 0 must precede it due to runtime library [libQt5Core.so.5]
1> [CMake] 
1> [CMake]   Some of these libraries may not be found correctly.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   CMakeLists.txt:15 (add_library)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

5 participants