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

Fix Windows build errors #29

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

Fix Windows build errors #29

wants to merge 16 commits into from

Conversation

kratman
Copy link
Contributor

@kratman kratman commented Feb 12, 2025

Work in progress while investigating windows build failures

@kratman kratman self-assigned this Feb 12, 2025
@kratman
Copy link
Contributor Author

kratman commented Feb 12, 2025

The failure is from VCPKG, I disabled 3.9 as a test just to see if the install works on other python versions

@agriyakhetarpal
Copy link
Member

cibuildwheel builds wheels for Python versions incrementally based on values in pyproject.toml; it is unlikely that bumping the minimum Python version would fix it here.

The error from the logs is indeed from Vcpkg:

CMake Error at cmake/tpl/FindKLU.cmake:54 (find_library):
  Could not find KLU_LIBRARY_DEBUG using the following names: klud

@kratman
Copy link
Contributor Author

kratman commented Feb 12, 2025

Yeah I know, I just wanted to rule out that it was some weird dependency thing. It already failed. I just triggered this while I was in morning meetings

@agriyakhetarpal
Copy link
Member

This looks like where the error comes up

"C:/Program Files/CMake/bin/cmake.exe" "C:/vcpkg/buildtrees/sundials/src/v6.5.0-376ddf505a.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" <...>

Vcpkg is trying to build SUNDIALS's triplet in debug mode for some reason, when it has always been built in release mode in the past. We currently capitalise the string in setup.py here:

build_type = os.getenv("PYBAMM_CPP_BUILD_TYPE", "RELEASE")

Does it have to be "Release" and not "RELEASE"? This is just a guess; I could be wrong.

@kratman
Copy link
Contributor Author

kratman commented Feb 16, 2025

This looks like where the error comes up

"C:/Program Files/CMake/bin/cmake.exe" "C:/vcpkg/buildtrees/sundials/src/v6.5.0-376ddf505a.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" <...>

Vcpkg is trying to build SUNDIALS's triplet in debug mode for some reason, when it has always been built in release mode in the past. We currently capitalise the string in setup.py here:

build_type = os.getenv("PYBAMM_CPP_BUILD_TYPE", "RELEASE")

Does it have to be "Release" and not "RELEASE"? This is just a guess; I could be wrong.

I will push a change for that to see if it works. It is worth a shot, but weird that it suddenly fails. What I was looking at was just replacing the VCPKG stuff with a full build like we do on linux/mac

@kratman
Copy link
Contributor Author

kratman commented Feb 17, 2025

I think for this to work, we just need to make klud optional, the other changes for the casadi registry can probably be reverted. Telling VCPKG to build release mode for CasADi and Sundails, appears to still let dependencies build in debug mode. So it does not really seem like a solution that will fix it in the end. I think instead we just need better handling for when the debug/release libraries are not found or figure out if there is something else that broken

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.

2 participants