Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.vscode

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
A [vcpkg](https://github.com/microsoft/vcpkg) registry providing a portfile for the [sundials library](https://computing.llnl.gov/projects/sundials/sundials-software) with a feature to
# PyBaMM Sundials VCPKG registry

A [vcpkg](https://github.com/microsoft/vcpkg) registry providing a portfile for the
[sundials library](https://computing.llnl.gov/projects/sundials/sundials-software) with a feature to
enable compilation against [SuiteSparse](https://people.engr.tamu.edu/davis/suitesparse.html)'s KLU algorithm.

See
- [Selecting library features](https://github.com/microsoft/vcpkg/blob/master/docs/users/selecting-library-features.md)
- [Registries: Bring your own libraries to vcpkg](https://devblogs.microsoft.com/cppblog/registries-bring-your-own-libraries-to-vcpkg/)

### Why a separate registry?

sundials [is available through vcpkg](https://github.com/microsoft/vcpkg/tree/master/ports/sundials), but is compiled without KLU
Sundials [is available through vcpkg](https://github.com/microsoft/vcpkg/tree/master/ports/sundials), but is compiled without KLU
support. To enable this, the portfile (among other things) must be
modified to enable KLU support (i.e. setting `KLU_ENABLE` to `TRUE`) but
also find the SuiteSparse library.
Expand All @@ -32,7 +36,7 @@ Next, you can install sundials with KLU support with
```shell
vcpkg install sundials[klu] --feature-flags=registries
```
this will installed sundials with KLU support, along with the required dependencies
this will install sundials with KLU support, along with the required dependencies
(e.g. SuiteSparse).

### Summary of changes
Expand Down
13 changes: 5 additions & 8 deletions ports/sundials/find-klu.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake
index 0b6c275..182bea7 100644
index e3142b462..ceffc545a 100644
--- a/cmake/tpl/FindKLU.cmake
+++ b/cmake/tpl/FindKLU.cmake
@@ -39,41 +39,65 @@ elseif(APPLE)
@@ -39,41 +39,64 @@ elseif(APPLE)
endif()

### Find include dir
Expand All @@ -29,7 +29,6 @@ index 0b6c275..182bea7 100644
+ lib
+ PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug"
+ NO_DEFAULT_PATH
+ REQUIRED
+ )

- # force CACHE update to show user DIR that will be used
Expand Down Expand Up @@ -83,7 +82,7 @@ index 0b6c275..182bea7 100644
mark_as_advanced(BTF_LIBRARY)
endif ()

@@ -83,10 +107,15 @@ if (NOT SUITESPARSECONFIG_LIBRARY)
@@ -83,10 +106,15 @@ if (NOT SUITESPARSECONFIG_LIBRARY)
if(WIN32 AND NOT MSYS)
set(CMAKE_FIND_LIBRARY_PREFIXES "")
endif()
Expand All @@ -100,14 +99,12 @@ index 0b6c275..182bea7 100644
set(KLU_LIBRARIES ${KLU_LIBRARY} ${AMD_LIBRARY} ${COLAMD_LIBRARY} ${BTF_LIBRARY} ${SUITESPARSECONFIG_LIBRARY})

# set package variables including KLU_FOUND
@@ -105,8 +134,9 @@ if(KLU_FOUND)
endif()
@@ -105,7 +133,8 @@ if(KLU_FOUND)

set_target_properties(SUNDIALS::KLU PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}"
INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}"
- INTERFACE_LINK_LIBRARIES "${KLU_LIBRARIES}"
- IMPORTED_LOCATION "${KLU_LIBRARY}")
+ INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}"
+ INTERFACE_LINK_LIBRARIES "$<IF:$<CONFIG:DEBUG>,${KLU_LIBRARIES_DEBUG},${KLU_LIBRARIES_RELEASE}>"
+ IMPORTED_LOCATION_DEBUG "${KLU_LIBRARY_DEBUG}"
+ IMPORTED_LOCATION_RELEASE "${KLU_LIBRARY_RELEASE}")
Expand Down
2 changes: 1 addition & 1 deletion versions/s-/sundials.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "41dbf3c304ce57c8d25ca04e49d93d70f588f8bb",
"git-tree": "b37b0fceb8b4b7908ba79b5db599aea048952299",
"version-semver": "6.5.0",
"port-version": 0
},
Expand Down