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

CMake can't find header-only library installed with Chocolatey #1610

Open
robertodr opened this issue Sep 13, 2023 · 3 comments
Open

CMake can't find header-only library installed with Chocolatey #1610

robertodr opened this issue Sep 13, 2023 · 3 comments

Comments

@robertodr
Copy link

Description

I'm trying to build wheels on Windows for a project that uses the Eigen3 header-only library. I'm running choco install eigen with CIBW_BEFORE_ALL_WINDOWS, as suggested in the documentation. From the logs, I can see that Chocolatey should already have set up all the paths correctly for CMake to find this dependency. However, the build fails because CMake can't find the package. I've tried to set the Eigen3_ROOT environment variable and/or passing -DEigen3_DIR option through SKBUILD_CMAKE_ARGS but none seem to do the trick. What am I missing?

Build log

https://pipelinesghubeus23.actions.githubusercontent.com/CeqyNvChuFKPSplumdvzHI0kSDdWeR7czI7LxDTAdEb8UF7BQd/_apis/pipelines/1/runs/98/signedlogcontent/5?urlExpires=2023-09-13T08%3A41%3A28.5705260Z&urlSigningMethod=HMACV1&urlSignature=ZF%2Fu8uaMCZ79U%2FgaRlU7RL6ceGolUppAv0xS7Xv2z34%3D

CI config

https://github.com/maxscheurer/cppe/actions/runs/6170004263/workflow

@henryiii
Copy link
Contributor

Does the chocolatey install of Eigen include the CMake config file?

@henryiii
Copy link
Contributor

henryiii commented Sep 13, 2023

FYI, I usually use submodules or FetchContent for Eigen, and include it in the SDist. It's just some header files, and that way you control the exact version.

@robertodr
Copy link
Author

Does the chocolatey install of Eigen include the CMake config file?

From the logs (which I now see I didn't link correctly in the issue 😞) it appears so:

eigen v3.4.0 [Approved]
  eigen package files install completed. Performing other installation steps.
  HKEY_LOCAL_MACHINE\SOFTWARE\Kitware\CMake\Packages\Eigen3
  @{CMakePackageDir=C:\ProgramData\chocolatey\lib\eigen\share\cmake; PSPath=Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Kitware\CMake\Packages\Eigen3; PSParentPath=Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Kitware\CMake\Packages; PSChildName=Eigen3; PSDrive=HKLM; PSProvider=Microsoft.PowerShell.Core\Registry}
   The install of eigen was successful.
    Software install location not explicitly set, it could be in package or
    default install location of installer.

FYI, I usually use submodules or FetchContent for Eigen, and include it in the SDist. It's just some header files, and that way you control the exact version.

This however sounds like the better solution! Do you have an example of using FetchContent and including Eigen in the SDist that I could follow?

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

No branches or pull requests

2 participants