Skip to content

Commit

Permalink
Merge d7a64f2 into b1fa33f
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jan 14, 2018
2 parents b1fa33f + d7a64f2 commit 9769dac
Show file tree
Hide file tree
Showing 41 changed files with 8,024 additions and 6,690 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ deps/usr32/
deps/usr64/

deps/LICENSE

deps/deps.jl

deps/usr
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Sundials.jl
[![Travis](https://travis-ci.org/JuliaDiffEq/Sundials.jl.svg?branch=master)](https://travis-ci.org/JuliaDiffEq/Sundials.jl)
[![AppVoyer](https://ci.appveyor.com/api/projects/status/s14c4i1sd322x6ko/branch/master?svg=true)](https://ci.appveyor.com/project/ChrisRackauckas/sundials-jl/branch/master)
[![Coveralls](https://coveralls.io/repos/github/JuliaDiffEq/Sundials.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaDiffEq/Sundials.jl?branch=master)
[![Sundials](http://pkg.julialang.org/badges/Sundials_0.4.svg)](http://pkg.julialang.org/?pkg=Sundials)
[![Sundials](http://pkg.julialang.org/badges/Sundials_0.5.svg)](http://pkg.julialang.org/?pkg=Sundials)
[![Sundials](http://pkg.julialang.org/badges/Sundials_0.6.svg)](http://pkg.julialang.org/?pkg=Sundials)

Introduction
Expand All @@ -21,6 +19,10 @@ following:
CVODES treats stiff and nonstiff ODE systems of the form
`y' = f(t,y,p), y(t0) = y0(p)`,
where `p` is a set of parameters.
* *ARKODE* - for integration of non-stiff, stiff, and mixed mode
ODEs via its explicit, implicit, and IMEX Runge-Kutta
methods on ODEs of the form `My' = f(t,y,p), y(t0) = y0(p)`
for a set of parameters `p`.
* *IDAS* - for integration and sensitivity analysis of DAEs.
IDAS treats DAE systems of the form
`F(t,y,y',p) = 0, y(t0) = y0(p), y'(t0) = y0'(p)`
Expand Down Expand Up @@ -93,7 +95,13 @@ sol = solve(prob,CVODE_Adams())
using Plots; plot(sol,vars=(1,2,3))
```

Sundials.jl exports the `CVODE_BDF` and `CVODE_Adams` methods for ODEs which are documented [in the ODE Solvers page](http://docs.juliadiffeq.org/latest/solvers/ode_solve.html#Sundials.jl-1), and `IDA` which is documented [in the DAE solvers page](http://docs.juliadiffeq.org/latest/solvers/dae_solve.html).
Sundials.jl exports the `CVODE_BDF`, `CVODE_Adams`, and `ARKODE` methods for
ODEs which are documented
[in the ODE Solvers page](http://docs.juliadiffeq.org/latest/solvers/ode_solve.html#Sundials.jl-1), and `IDA` which is documented
[in the DAE solvers page](http://docs.juliadiffeq.org/latest/solvers/dae_solve.html).
Additionally, the `ARKODE` method can be used
[on `SplitODEProblem`s](http://docs.juliadiffeq.org/latest/solvers/split_ode_solve.html#Implicit-Explicit-(IMEX)-ODE-1)
to solve ODEs in IMEX form.

Simplified Functions
--------------------
Expand Down
121 changes: 41 additions & 80 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,105 +3,66 @@ using BinaryProvider
# This is where all binaries will get installed
const prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__,"usr"))

libsundials_nvecserial = LibraryProduct(prefix, String["libsundials_nvecserial"])
libsundials_kinsol = LibraryProduct(prefix, String["libsundials_kinsol"])
libsundials_cvodes = LibraryProduct(prefix, String["libsundials_cvodes"])
libsundials_idas = LibraryProduct(prefix, String["libsundials_idas"])
libsundials_sunlinsolspfgmr = LibraryProduct(prefix, String["libsundials_sunlinsolspfgmr"])
libsundials_sunmatrixdense = LibraryProduct(prefix, String["libsundials_sunmatrixdense"])
libsundials_sunlinsolspbcgs = LibraryProduct(prefix, String["libsundials_sunlinsolspbcgs"])
libsundials_sunlinsoldense = LibraryProduct(prefix, String["libsundials_sunlinsoldense"])
libsundials_sunlinsolspgmr = LibraryProduct(prefix, String["libsundials_sunlinsolspgmr"])
libsundials_sunlinsolpcg = LibraryProduct(prefix, String["libsundials_sunlinsolpcg"])
libsundials_sunlinsolsptfqmr = LibraryProduct(prefix, String["libsundials_sunlinsolsptfqmr"])
libsundials_sunmatrixsparse = LibraryProduct(prefix, String["libsundials_sunmatrixsparse"])
libsundials_sunlinsolband = LibraryProduct(prefix, String["libsundials_sunlinsolband"])
libsundials_sunmatrixband = LibraryProduct(prefix, String["libsundials_sunmatrixband"])
libsundials_arkode = LibraryProduct(prefix, String["libsundials_arkode"])

products = [
LibraryProduct(prefix, String["libsundials_sunlinsolspfgmr"]),
LibraryProduct(prefix, String["libsundials_ida"]),
LibraryProduct(prefix, String["libsundials_cvode"]),
LibraryProduct(prefix, String["libsundials_cvodes"]),
LibraryProduct(prefix, String["libsundials_sunmatrixdense"]),
LibraryProduct(prefix, String["libsundials_sunlinsolspbcgs"]),
LibraryProduct(prefix, String["libsundials_idas"]),
LibraryProduct(prefix, String["libsundials_nvecserial"]),
LibraryProduct(prefix, String["libsundials_sunlinsoldense"]),
LibraryProduct(prefix, String["libsundials_sunlinsolspgmr"]),
LibraryProduct(prefix, String["libsundials_sunlinsolpcg"]),
LibraryProduct(prefix, String["libsundials_sunlinsolsptfqmr"]),
LibraryProduct(prefix, String["libsundials_sunmatrixsparse"]),
LibraryProduct(prefix, String["libsundials_sunlinsolband"]),
LibraryProduct(prefix, String["libsundials_sunmatrixband"]),
LibraryProduct(prefix, String["libsundials_kinsol"]),
LibraryProduct(prefix, String["libsundials_arkode"])
libsundials_nvecserial,
libsundials_kinsol,
libsundials_cvodes,
libsundials_idas,
libsundials_sunlinsolspfgmr,
libsundials_sunmatrixdense,
libsundials_sunlinsolspbcgs,
libsundials_sunlinsoldense,
libsundials_sunlinsolspgmr,
libsundials_sunlinsolpcg,
libsundials_sunlinsolsptfqmr,
libsundials_sunmatrixsparse,
libsundials_sunlinsolband,
libsundials_sunmatrixband,
libsundials_arkode,
]

libsundials_nvecserial = LibraryProduct(prefix, String["libsundials_nvecserial"])
libsundials_kinsol = LibraryProduct(prefix, String["libsundials_kinsol"])
libsundials_cvodes = LibraryProduct(prefix, String["libsundials_cvodes"])
libsundials_idas = LibraryProduct(prefix, String["libsundials_idas"])

# Download binaries from hosted location
bin_prefix = "https://github.com/tshort/SundialsBuilder/releases/download/sundials-3.1.0"
bin_prefix = "https://github.com/JuliaDiffEq/SundialsBuilder/releases/download/sundials-3.1.0-2"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/Sundials.aarch64-linux-gnu.tar.gz", "9f133576908fb3cfc72dbb9974e5b70b30d0b940b54edab29c433a2857a06ff5"),
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/Sundials.arm-linux-gnueabihf.tar.gz", "e0fa5643751ede9411b6bef0f950493bc424aefbc195625e890b67d5296a2539"),
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/Sundials.i686-linux-gnu.tar.gz", "9a0914e1db0d5858b25f792e1ac1f9174c7e7bebdc87b79e6a48c05daffe1171"),
BinaryProvider.Windows(:i686) => ("$bin_prefix/Sundials.i686-w64-mingw32.tar.gz", "1203d183aea89002118b9de088e8cf4444b9d3bc90cdd83d807ffd40b1d60851"),
BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/Sundials.powerpc64le-linux-gnu.tar.gz", "1bb46ac166c7f1fef581ae569e16abc4c309e77d9809efe531382058a2aec57b"),
BinaryProvider.MacOS() => ("$bin_prefix/Sundials.x86_64-apple-darwin14.tar.gz", "1f910ff89ba2633545f1ccf27c94f90849dab38f4cd4566b71c516d8e1326c30"),
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/Sundials.x86_64-linux-gnu.tar.gz", "b7311ccca12a94f2b46b9a611f50ea6508369505156f56b8927c3a54aa405341"),
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/Sundials.x86_64-w64-mingw32.tar.gz", "0761e2236c9ab867d42616b633cd6f744cbf4c06c323dfcea79655741a37ab33"),
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/Sundials.aarch64-linux-gnu.tar.gz", "a6a8894a48c8ff93d28d437e5efd378933707b65c054f0c1feb9897964bb7c11"),
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/Sundials.arm-linux-gnueabihf.tar.gz", "b2c4379a211250cbaeb73e21e0a4a893fb3ac3255212039879d4fcdfd54e34ac"),
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/Sundials.i686-linux-gnu.tar.gz", "616525eb308bedb2d09486ec7783362856e21b56473c47a6e06eded94c25f0d9"),
BinaryProvider.Windows(:i686) => ("$bin_prefix/Sundials.i686-w64-mingw32.tar.gz", "e6b629e341ec5475846d87da991089b28a8992bfe32f073b62d819bd2d342c7d"),
BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/Sundials.powerpc64le-linux-gnu.tar.gz", "2354d4a22b7be8ab208457f8863953d23628200af83e4f735ec26f52c526a94c"),
BinaryProvider.MacOS() => ("$bin_prefix/Sundials.x86_64-apple-darwin14.tar.gz", "d39bcc4f724c742ab966c46391989226b1654dbfc152f55ae5a5fd19b2eaf9bd"),
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/Sundials.x86_64-linux-gnu.tar.gz", "40f55bea93a6bb5cdd07537e2bee3be230dfef30605ccb385c9234ffb5f15fb9"),
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/Sundials.x86_64-w64-mingw32.tar.gz", "a3888df5b793e310e88efc2356f149e5d5258f6aa7d5627420e3ae0302e330c7"),
)
if platform_key() in keys(download_info)
@show "1st"
# First, check to see if we're all satisfied
if any(!satisfied(p; verbose=true) for p in products)
# Download and install binaries
url, tarball_hash = download_info[platform_key()]
install(url, tarball_hash; prefix=prefix, force=true, verbose=true)
end
@show "HERE"

# Finally, write out a deps.jl file that will contain mappings for each
# named product here: (there will be a "libfoo" variable and a "fooifier"
# variable, etc...)
@write_deps_file libsundials_kinsol libsundials_idas libsundials_nvecserial libsundials_cvodes
@write_deps_file libsundials_kinsol libsundials_idas libsundials_nvecserial libsundials_cvodes libsundials_sunlinsolspfgmr libsundials_sunmatrixdense libsundials_sunlinsolspbcgs libsundials_sunlinsoldense libsundials_sunlinsolspgmr libsundials_sunlinsolpcg libsundials_sunlinsolsptfqmr libsundials_sunmatrixsparse libsundials_sunlinsolband libsundials_sunmatrixband libsundials_arkode
else
error("Your platform $(Sys.MACHINE) is not supported by this package!")
end


# using BinaryProvider

# # This is where all binaries will get installed
# const prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__,"usr"))

# # Instantiate products here. Examples:
# # libfoo = LibraryProduct(prefix, "libfoo")
# # foo_executable = ExecutableProduct(prefix, "fooifier")
# # libfoo_pc = FileProduct(joinpath(libdir(prefix), "pkgconfig", "libfoo.pc"))

# # Assign products to `products`:
# # products = [libfoo, foo_executable, libfoo_pc]


# # Download binaries from hosted location
# bin_prefix = "https://<path to hosted location such as GitHub Releases>"

# # Listing of files generated by BinaryBuilder:
# download_info = Dict(
# BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/Sundials.aarch64-linux-gnu.tar.gz", "9f133576908fb3cfc72dbb9974e5b70b30d0b940b54edab29c433a2857a06ff5"),
# BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/Sundials.arm-linux-gnueabihf.tar.gz", "e0fa5643751ede9411b6bef0f950493bc424aefbc195625e890b67d5296a2539"),
# BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/Sundials.i686-linux-gnu.tar.gz", "9a0914e1db0d5858b25f792e1ac1f9174c7e7bebdc87b79e6a48c05daffe1171"),
# BinaryProvider.Windows(:i686) => ("$bin_prefix/Sundials.i686-w64-mingw32.tar.gz", "1203d183aea89002118b9de088e8cf4444b9d3bc90cdd83d807ffd40b1d60851"),
# BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/Sundials.powerpc64le-linux-gnu.tar.gz", "1bb46ac166c7f1fef581ae569e16abc4c309e77d9809efe531382058a2aec57b"),
# BinaryProvider.MacOS() => ("$bin_prefix/Sundials.x86_64-apple-darwin14.tar.gz", "1f910ff89ba2633545f1ccf27c94f90849dab38f4cd4566b71c516d8e1326c30"),
# BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/Sundials.x86_64-linux-gnu.tar.gz", "b7311ccca12a94f2b46b9a611f50ea6508369505156f56b8927c3a54aa405341"),
# BinaryProvider.Windows(:x86_64) => ("$bin_prefix/Sundials.x86_64-w64-mingw32.tar.gz", "0761e2236c9ab867d42616b633cd6f744cbf4c06c323dfcea79655741a37ab33"),
# )
# if platform_key() in keys(download_info)
# # First, check to see if we're all satisfied
# if any(!satisfied(p; verbose=true) for p in products)
# # Download and install binaries
# url, tarball_hash = download_info[platform_key()]
# install(url, tarball_hash; prefix=prefix, force=true, verbose=true)
# end

# # Finally, write out a deps.jl file that will contain mappings for each
# # named product here: (there will be a "libfoo" variable and a "fooifier"
# # variable, etc...)
# @write_deps_file libfoo fooifier
# else
# error("Your platform $(Sys.MACHINE) is not supported by this package!")
# end

22 changes: 13 additions & 9 deletions src/Sundials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
error("Sundials is not properly installed. Please run Pkg.build(\"Sundials\")")
end

export solve, SundialsODEAlgorithm, SundialsDAEAlgorithm, CVODE_BDF, CVODE_Adams, IDA
export solve, SundialsODEAlgorithm, SundialsDAEAlgorithm, ARKODE, CVODE_BDF, CVODE_Adams, IDA

# some definitions from the system C headers wrapped into the types_and_consts.jl
const DBL_MAX = prevfloat(Inf)
Expand All @@ -33,24 +33,28 @@ const DBL_EPSILON = eps(Cdouble)
const FILE = Void
const __builtin_va_list = Ptr{Void}

include("types_and_consts.jl")
include("wrapped_api/types_and_consts.jl")
include("types_and_consts_additions.jl")

include("handle.jl")
include("nvector_wrapper.jl")

include("nvector.jl")
include("libsundials.jl")
include("wrapped_api/nvector.jl")
include("wrapped_api/libsundials.jl")
include("wrapped_api/sunmatrix.jl")
include("wrapped_api/sunlinsol.jl")
if isdefined(:libsundials_cvodes)
include("cvodes.jl")
include("wrapped_api/cvodes.jl")
else
include("cvode.jl")
include("wrapped_api/cvode.jl")
end
include("wrapped_api/arkode.jl")
if isdefined(:libsundials_idas)
include("idas.jl")
include("wrapped_api/idas.jl")
else
include("ida.jl")
include("wrapped_api/ida.jl")
end
include("kinsol.jl")
include("wrapped_api/kinsol.jl")

include("simple.jl")
include("common_interface/verbosity.jl")
Expand Down

0 comments on commit 9769dac

Please sign in to comment.