HSL tutorial
This tutorial shows how to use the HSL routine MA57 as the linear solver of Penelopt.jl.
The HSL libraries require a license, so the code on this page is not run when the documentation is built.
1. Install HSL_jll and HSL.jl
HSL_jll.jl is not available from the General registry. Obtain it from https://licences.stfc.ac.uk/product/libhsl (free for academic use), unpack it, and add it to your environment together with HSL.jl:
using Pkg
Pkg.develop(path = "/full/path/to/HSL_jll.jl")
Pkg.add("HSL")See the HSL.jl documentation for details.
2. Load HSL
using HSL_jll
using HSL
HSL.LIBHSL_isfunctional() # should return true3. Solve with Penelopt
Any AbstractNLPModel works; here we use a CUTEst problem.
using CUTEst, Penelopt
nlp = CUTEstModel("MSS1")
stats = L2Penalty(nlp; linear_solver = "ma57", print_level = 1)
println("status : ", stats.status)
println("objective : ", stats.objective)
finalize(nlp)