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

sundials: add v7.1.1, v6.7.0, v5.8.0, add optional deps, fix CMake names #21664

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
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
9 changes: 9 additions & 0 deletions recipes/sundials/all/conan-cuda-support.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
find_dependency(CUDAToolkit REQUIRED)

target_link_libraries(SUNDIALS::nveccuda INTERFACE CUDA::cudart)
if(TARGET SUNDIALS::sunmatrixcusparse)
target_link_libraries(SUNDIALS::sunmatrixcusparse INTERFACE CUDA::cusparse)
endif()
if(TARGET SUNDIALS::sunlinsolcusolversp)
target_link_libraries(SUNDIALS::sunlinsolcusolversp INTERFACE CUDA::cusolver)
endif()
9 changes: 9 additions & 0 deletions recipes/sundials/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
sources:
"7.1.1":
url: "https://github.com/LLNL/sundials/releases/download/v7.1.1/sundials-7.1.1.tar.gz"
sha256: "ea7d6edfb52448ddfdc1ec48f89a721fe6c0a259c10f8ef56f60fcded87a94bb"
"6.7.0":
url: "https://github.com/LLNL/sundials/releases/download/v6.7.0/sundials-6.7.0.tar.gz"
sha256: "5f113a1564a9d2d98ff95249f4871a4c815a05dbb9b8866a82b13ab158c37adb"
"5.8.0":
url: "https://github.com/LLNL/sundials/releases/download/v5.8.0/sundials-5.8.0.tar.gz"
sha256: "d4ed403351f72434d347df592da6c91a69452071860525385b3339c824e8a213"
"5.4.0":
url: "https://github.com/LLNL/sundials/releases/download/v5.4.0/sundials-5.4.0.tar.gz"
sha256: "a60ba8155ca12261cf7623efcf9fd4232e95bcfefe480993ef71324176cb395b"
Expand Down
314 changes: 256 additions & 58 deletions recipes/sundials/all/conanfile.py

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions recipes/sundials/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES C)

find_package(sundials REQUIRED CONFIG)
find_package(SUNDIALS REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.c)
# SUNDIALS v6.0.0 introduced a new SUNContext object on which all other SUNDIALS objects depend
# and is not backwards compatible.
if(SUNDIALS_VERSION GREATER_EQUAL 6)
add_executable(${PROJECT_NAME} test_package_v6.c)
else()
add_executable(${PROJECT_NAME} test_package_v5.c)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE sundials::sundials)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main()
SUNMatrix A = SUNDenseMatrix(1, 1);
SUNLinearSolver LS = SUNLinSol_Dense(y, A);

N_Vector v = N_VNew_Serial(1);;
N_Vector v = N_VNew_Serial(1);
N_VScale(2.0, y, v);
return 0;
}
18 changes: 18 additions & 0 deletions recipes/sundials/all/test_package/test_package_v6.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <nvector/nvector_serial.h>
perseoGI marked this conversation as resolved.
Show resolved Hide resolved
#include <sunmatrix/sunmatrix_dense.h>
#include <sunlinsol/sunlinsol_dense.h>
#include <sundials/sundials_types.h>

int main()
{
SUNContext sunctx;
SUNContext_Create(0, &sunctx);
N_Vector y = N_VNew_Serial(1, sunctx);
NV_DATA_S(y)[0] = 2.0;
SUNMatrix A = SUNDenseMatrix(1, 1, sunctx);
SUNLinearSolver LS = SUNLinSol_Dense(y, A, sunctx);

N_Vector v = N_VNew_Serial(1, sunctx);
N_VScale(2.0, y, v);
return 0;
}
6 changes: 6 additions & 0 deletions recipes/sundials/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
versions:
"7.1.1":
folder: all
"6.7.0":
folder: all
"5.8.0":
folder: all
"5.4.0":
folder: all
"5.3.0":
Expand Down