Skip to content

[openmpi] Fix host pkgconf path#51563

Open
dg0yt wants to merge 4 commits intomicrosoft:masterfrom
dg0yt:openmpi
Open

[openmpi] Fix host pkgconf path#51563
dg0yt wants to merge 4 commits intomicrosoft:masterfrom
dg0yt:openmpi

Conversation

@dg0yt
Copy link
Copy Markdown
Contributor

@dg0yt dg0yt commented May 5, 2026

Fixes the pkgconf search path. Restoring the original wrapper code from before #51460 because the pkgconf search path was wrong there and was wrong after the recent change, and no reasons for the other changes were documented.

From that PR, keep PKG_CONFIG_EXECUTABLE lookup before find_package(PkgConfig) because this is the right thing: We must init the cache variable before it is done by the find module.

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented May 7, 2026

-- Found Epoxy: PkgConfig::epoxy
...
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) (found version "2.5.1")
...
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) (found version "2.5.1")
CMake Error at /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/FindPackageHandleStandardArgs.cmake:290 (message):
  Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/FindPackageHandleStandardArgs.cmake:654 (_FPHSA_FAILURE_MESSAGE)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/FindMPI.cmake:2006 (find_package_handle_standard_args)
  /Users/vcpkg/Data/installed/arm64-osx/share/mpi/vcpkg-cmake-wrapper.cmake:32 (_find_package)
  /Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:862 (include)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:93 (find_package)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:125 (__find_dependency_common)
  /Users/vcpkg/Data/installed/arm64-osx/share/hdf5/hdf5-config.cmake:125 (find_dependency)
  /Users/vcpkg/Data/installed/arm64-osx/share/hdf5/vcpkg-cmake-wrapper.cmake:16 (_find_package)
  /Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:862 (include)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/FindHDF5.cmake:678 (find_package)
  /Users/vcpkg/Data/installed/arm64-osx/share/hdf5/vcpkg-cmake-wrapper.cmake:16 (_find_package)
  /Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:862 (include)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:93 (find_package)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:125 (__find_dependency_common)
  /Users/vcpkg/Data/installed/arm64-osx/share/opencv4/OpenCVModules.cmake:48 (find_dependency)
  /Users/vcpkg/Data/installed/arm64-osx/share/opencv4/OpenCVConfig.cmake:128 (include)
  /Users/vcpkg/Data/installed/arm64-osx/share/opencv/vcpkg-cmake-wrapper.cmake:3 (_find_package)
  /Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:862 (include)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:93 (find_package)
  /Users/vcpkg/Data/work/1/s/downloads/tools/cmake-4.3.2-osx/cmake-4.3.2-macos-universal/CMake.app/Contents/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:125 (__find_dependency_common)
  /Users/vcpkg/Data/installed/arm64-osx/share/openimageio/OpenImageIOConfig.cmake:45 (find_dependency)
  /Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:908 (_find_package)
  build_files/cmake/Modules/FindOpenImageIO.cmake:22 (find_package)
  /Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:908 (_find_package)
  build_files/cmake/platform/platform_apple.cmake:299 (find_package)
  CMakeLists.txt:1580 (include)

This is FindPkgConfig.cmake in vcpkg-ci-blender being broken by a patch in vcpkg-ci-blender, not by a bug in openmpi. These obvious unusual pkgconfig changes were directly visible when looking at the original PRs.

Comment on lines +8 to +11
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(epoxy QUIET IMPORTED_TARGET epoxy)
+set(Epoxy_INCLUDE_DIR "${epoxy_INCLUDE_DIRS}" CACHE INTERNAL "vcpkg")
+set(Epoxy_LIBRARY "PkgConfig::epoxy" CACHE INTERNAL "vcpkg")
Copy link
Copy Markdown
Contributor Author

@dg0yt dg0yt May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applying libepoxy's transitive usage requirements on all platforms.
And everything is ready for canonical use of pkg_check_modules: Portfile provides PKG_CONFIG, CMake transforms prefix path to PKG_CONFIG_PATH.

@dg0yt dg0yt marked this pull request as ready for review May 7, 2026 19:16
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

Successfully merging this pull request may close these issues.

1 participant