-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add pybammsolvers #28748
base: main
Are you sure you want to change the base?
Add pybammsolvers #28748
Changes from 8 commits
8d54891
d9b57d3
6f7e331
06986fa
e8d4def
c3b58e5
292631f
4e208c1
3e1c6f9
d02a288
9b00b47
063dd55
b1843c6
6ff1610
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||||||
set -euxo pipefail | ||||||||||||||
|
||||||||||||||
### Compile and install SUITESPARSE ### | ||||||||||||||
# SuiteSparse is required to compile SUNDIALS's | ||||||||||||||
# KLU solver. | ||||||||||||||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Nitpicking: if you do wish to keep comments for future reference in this recipe, maybe consolidating them in one place is one way to go. That said, I don't think the comments themselves will add much, could you add links to the docs here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Completely forgot about this. Let me resolve this in the next commits. |
||||||||||||||
|
||||||||||||||
SUITESPARSE_DIR=suitesparse | ||||||||||||||
for dir in SuiteSparse_config AMD COLAMD BTF KLU | ||||||||||||||
do | ||||||||||||||
make -C $SUITESPARSE_DIR/$dir library | ||||||||||||||
make -C $SUITESPARSE_DIR/$dir install INSTALL=$PREFIX | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've used $PREFIX here and for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can still see the CI fails due to the same problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, $PREFIX is the ideal location to store them, |
||||||||||||||
done | ||||||||||||||
|
||||||||||||||
mkdir -p build_sundials | ||||||||||||||
cd build_sundials | ||||||||||||||
KLU_INCLUDE_DIR=/usr/local/include | ||||||||||||||
KLU_LIBRARY_DIR=/usr/local/lib | ||||||||||||||
SUNDIALS_DIR=sundials | ||||||||||||||
cmake -DENABLE_LAPACK=ON\ | ||||||||||||||
-DSUNDIALS_INDEX_SIZE=32\ | ||||||||||||||
-DEXAMPLES_ENABLE:BOOL=OFF\ | ||||||||||||||
-DENABLE_KLU=ON\ | ||||||||||||||
-DENABLE_OPENMP=ON\ | ||||||||||||||
-DKLU_INCLUDE_DIR=$KLU_INCLUDE_DIR\ | ||||||||||||||
-DKLU_LIBRARY_DIR=$KLU_LIBRARY_DIR\ | ||||||||||||||
-DCMAKE_INSTALL_PREFIX=$PREFIX\ | ||||||||||||||
../$SUNDIALS_DIR | ||||||||||||||
make install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{% set name = "pybammsolvers" %} | ||
{% set version = "0.0.4" %} | ||
{% set sundials_version = "6.5.0" %} | ||
{% set suitesparse_version = "6.0.3" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
- url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/pybammsolvers-{{ version }}.tar.gz | ||
agriyakhetarpal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sha256: 6b76fb61e68af34b3a4803edc8020f508b10195f67857d8010e40f78cbbe2768 | ||
- url: https://github.com/LLNL/sundials/archive/v{{ sundials_version }}.tar.gz | ||
sha256: 7557cdb8fe2a9b56fa0c259aa4e2c2dc488a1c79d482bb7943e27b7d76f6931b | ||
folder: sundials | ||
- url: https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v{{ suitesparse_version }}.tar.gz | ||
sha256: 7111b505c1207f6f4bd0be9740d0b2897e1146b845d73787df07901b4f5c1fb7 | ||
folder: suitesparse | ||
|
||
|
||
build: | ||
number: 0 | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('c') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll also need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I can compile Sundials now. I don't think it's necessary to have
But I may be doing something wrong. I'm commenting out this step until further discussion, as I can still compile without it. I'm currently only using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry I didn't see the lint bot comments. We do need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I think it wouldn't hurt to try using Docker, since getting it to work on Linux before macOS would be nice, and it being isolated doesn't modify your local development environment. |
||
- {{ compiler('fortran') }} | ||
- {{ stdlib("c") }} | ||
- {{ compiler('cxx') }} | ||
host: | ||
prady0t marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- python {{ python_min }} | ||
- setuptools >=71 | ||
- casadi >=3.6.7 | ||
- cmake | ||
prady0t marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- pip | ||
run: | ||
- python >={{ python_min }} | ||
- casadi | ||
- numpy <2.0 | ||
|
||
test: | ||
imports: | ||
- pybammsolvers | ||
commands: | ||
- pip check | ||
requires: | ||
- pip | ||
|
||
about: | ||
summary: Python interface for the IDAKLU solver | ||
license: BSD-3-Clause | ||
license_file: LICENSE | ||
|
||
extra: | ||
recipe-maintainers: | ||
- prady0t | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be the IDAKLU maintainers group from pybamm team There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's common for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I always find it easier to add maintainers once the feedstock is up, otherwise -
which is cumbersome (and will make the CI fail). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to be addressed right away, but we'll also need a
build.bat
equivalent of this script for Windows.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I'm aware. Once the
sh
script works, I'll try replication the steps forbat
file.