Skip to content

Commit 081f82d

Browse files
committed
Casadi issues
1 parent a850c10 commit 081f82d

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

.github/workflows/build_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
CMAKE_GENERATOR_PLATFORM=x64
4040
CIBW_ARCHS: AMD64
4141
CIBW_BEFORE_ALL_WINDOWS: >
42-
vcpkg install blas &&
42+
vcpkg install blas casadi &&
4343
python install_KLU_Sundials.py
4444
CIBW_BEFORE_BUILD: python -m pip install setuptools delvewheel
4545
CIBW_REPAIR_WHEEL_COMMAND: delvewheel repair --add-path C:/Windows/System32 -w {dest_dir} {wheel}

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
147147
find_package(SUNDIALS REQUIRED)
148148
message("SUNDIALS found in ${SUNDIALS_INCLUDE_DIR}: ${SUNDIALS_LIBRARIES}")
149149
target_include_directories(idaklu PRIVATE ${SUNDIALS_INCLUDE_DIR})
150-
target_link_libraries(idaklu PRIVATE ${SUNDIALS_LIBRARIES} casadi::casadi)
151-
150+
if (MSVC)
151+
target_link_libraries(idaklu PRIVATE ${SUNDIALS_LIBRARIES} casadi::casadi)
152+
else ()
153+
target_link_libraries(idaklu PRIVATE ${SUNDIALS_LIBRARIES} casadi)
154+
endif ()
152155
find_package(SuiteSparse REQUIRED)
153156
message("SuiteSparse found in ${SuiteSparse_INCLUDE_DIRS}: ${SuiteSparse_LIBRARIES}")
154157
include_directories(${SuiteSparse_INCLUDE_DIRS})

install_KLU_Sundials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ def install_sundials():
218218
["cmake", sundials_src, *cmake_args], cwd=build_dir.as_posix(), check=True
219219
)
220220
if platform.system() == "Windows":
221-
make_cmd = ["msbuild.exe", "ALL_BUILD.vcxproj"]
221+
make_cmd = ["msbuild", "ALL_BUILD.vcxproj"]
222222
subprocess.run(make_cmd, cwd=build_dir.as_posix(), check=True)
223-
make_cmd = ["msbuild.exe", "INSTALL.vcxproj"]
223+
make_cmd = ["msbuild", "INSTALL.vcxproj"]
224224
subprocess.run(make_cmd, cwd=build_dir.as_posix(), check=True)
225225
else:
226226
make_cmd = ["make", f"-j{cpu_count()}", "install"]

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ def run_pybamm_requires(session):
5353
def run_unit(session):
5454
set_environment_variables(PYBAMM_ENV, session=session)
5555
session.install("setuptools", silent=False)
56-
session.install("casadi==3.7.0", silent=False)
56+
session.install("casadi==3.6.7", silent=False)
5757
session.install(".[dev]", silent=False)
5858
session.run("pytest", "tests")

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
requires = [
33
"setuptools",
44
# On Windows, use the CasADi vcpkg registry and CMake bundled from MSVC
5-
"casadi==3.7.0; platform_system!='Windows'",
5+
"casadi==3.6.7; platform_system!='Windows'",
66
# Note: the version of CasADi as a build-time dependency should be matched
77
# cross platforms, so updates to its minimum version here should be accompanied
88
# by a version bump in https://github.com/pybamm-team/casadi-vcpkg-registry.
@@ -17,7 +17,7 @@ requires-python = ">=3.10,<3.13"
1717
license-files = ["LICENSE"]
1818
dynamic = ["version", "readme"]
1919
dependencies = [
20-
"casadi==3.7.0",
20+
"casadi==3.6.7",
2121
"numpy<2.0"
2222
]
2323

0 commit comments

Comments
 (0)