Error while using LSODA

I’m getting this error while using LSODA

ERROR: UndefVarError: liblsoda not defined

CODE:

using DifferentialEquations, LSODA

function lorenz!(du,u,p,t)
    a1, a2, a3 = p
    a, b, c = u
    du[1] = a1*(b-a)
    du[2] = a*(a2-c) - b
    du[3] = a*b - (a3)*c
end
p = [10.0, 28.0, 8/3 ]
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz!,u0,tspan, p)
solve(prob,lsoda())

It could be that while LSODA.jl provides bindings to liblsoda.so … that it does not actually install this library on your system? If you are in Linux, you could check with:

ldconfig -p | grep liblsoda

Try ]build LSODA and see what the error is.

I get this error when trying to build.

error in running finalizer: UndefVarError(var=:liblsoda)

I’m using a Mac system.

Sounds like you don’t have lsoda installed? Relevant link on SO.

I have checked that link. There is no solution.

when i do using LSODA I see no error. So, I assume it means i have package right?

Only when i’m trying to use it I see error.

I’m not a packaging expert, but the repository for LSODA does not appear to have the library in it. I’m not quite sure how the package author was expecting that you get the library installed.

I see no error when I issue using LSODA, but I for sure do not have the library installed (at least ldconfig doesn’t think so).

1 Like

This is the group that developed the LSODA algorithm:
https://computing.llnl.gov/projects/sundials
They have a download page.

1 Like

It worked on my linux system.

I think I see how they get the library. They have using LSODA_jll here. Perhaps it is a simple matter of ] add LSODA_jll? (Not familiar with jll format either, but I know it is a binary wrapper of some sort).

No, it’s not working :(. I feel may be issue comes with installing LSODA on mac because I just installed on linux and used same example code and it worked.

Maybe it’s a supported platform thing. Do you have a Mac with an M1 or M2?

The binary builder was last ran 2 years ago so I don’t know if it made M1/M2 binaries. @giordano or @staticfloat might be able to help with that since it’s probably nothing more than just re-running the old Yggdrasil or whatnot.

1 Like

I’m using mac with M1.

Update your packages with ]up and try again.

It works now. Thank you :slight_smile: