Skip to content

Commit

Permalink
#759 merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Feb 7, 2020
2 parents 067eb7b + 8f417cb commit ad9d2e0
Show file tree
Hide file tree
Showing 39 changed files with 3,929 additions and 933 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ pyvenv.cfg
# sundials
sundials
sundials4
sundials-*
SuiteSparse-*
build_sundials

# downloads
*.gz

# third party
third-party
Expand Down
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,28 @@ before_install: |
# without the packages from -dev and -doc!
install:
- pip install --upgrade pip
# In order to download SUNDIALS and SuiteSparse
- pip install wget
- pip install .
- if [[ $PYBAMM_DOCS == true ]]; then pip install -e .[docs]; fi;
- if [[ $PYBAMM_STYLE == true || $PYBAMM_EXAMPLES ]]; then pip install -e .[dev]; fi;
- if [[ $PYBAMM_COVER == true ]]; then pip install coverage codecov; fi;
- if [[ $PYBAMM_SCIKITS_ODES == true ]]; then source scripts/install_scikits_odes.sh; fi;
- if [[ $PYBAMM_KLU == true ]]; then source scripts/install_sundials_4.1.0.sh; fi;
- |
if [[ $PYBAMM_SCIKITS_ODES == true ]]; then
python setup.py install_odes -f;
export LD_LIBRARY_PATH=sundials/lib:$LD_LIBRARY_PATH
fi;
- |
if [[ $PYBAMM_KLU == true ]]; then
mkdir -p third-party;
cd third-party;
rm -rf pybind11;
git clone https://github.com/pybind/pybind11.git;
cd ../;
python setup.py install_klu -f;
export LD_LIBRARY_PATH=sundials/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=SuiteSparse-5.6.0/lib:$LD_LIBRARY_PATH
fi;
before_script:
- python --version
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

## Optimizations

- Now simplifying objects that are constant as soon as they are created ([#801](https://github.com/pybamm-team/PyBaMM/pull/801))
- Simplified solver interface ([#800](https://github.com/pybamm-team/PyBaMM/pull/800))
- Added caching for shape evaluation, used during discretisation ([#780](https://github.com/pybamm-team/PyBaMM/pull/780))
- Added an option to skip model checks during discretisation, which could be slow for large models ([#739](https://github.com/pybamm-team/PyBaMM/pull/739))
Expand Down
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ add_subdirectory(third-party/pybind11)
pybind11_add_module(idaklu pybamm/solvers/c_solvers/idaklu.cpp)

# Sundials
set(SUNDIALS_INCLUDE "sundials4/include")
set(SUNDIALS_INCLUDE "sundials/include")
TARGET_INCLUDE_DIRECTORIES(idaklu PRIVATE ${SUNDIALS_INCLUDE})

find_library(SUNMATSPARSE sundials_sunmatrixsparse PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(IDA sundials_ida PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(NVECTOR sundials_nvecserial PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(SUNKLU sundials_sunlinsolklu PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(SUNMATSPARSE sundials_sunmatrixsparse PATHS "sundials/lib" NO_DEFAULT_PATH)
find_library(IDA sundials_ida PATHS "sundials/lib" NO_DEFAULT_PATH)
find_library(NVECTOR sundials_nvecserial PATHS "sundials/lib" NO_DEFAULT_PATH)
find_library(SUNKLU sundials_sunlinsolklu PATHS "sundials/lib" NO_DEFAULT_PATH)
TARGET_LINK_LIBRARIES(idaklu PRIVATE ${SUNMATSPARSE} ${IDA} ${NVECTOR} ${SUNKLU})

# link suitesparse
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
set(SuiteSparse_ROOT SuiteSparse-5.6.0)
find_package(SuiteSparse OPTIONAL_COMPONENTS KLU AMD COLAMD BTF)
include_directories(${SuiteSparse_INCLUDE_DIRS})
target_link_libraries(idaklu PRIVATE ${SuiteSparse_LIBRARIES})
Loading

0 comments on commit ad9d2e0

Please sign in to comment.