Skip to content
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

Ma86 #82

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
24 changes: 20 additions & 4 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct HSLVersion
ext::String
end

getname(ver::HSLVersion) = ver.algname * "-" * ver.version * ver.ext
getname(ver::HSLVersion, ext=true) = ver.algname * "-" * ver.version * (ext ? ver.ext : "")

function checksha(version::HSLVersion, filepath)
if isfile(filepath)
Expand Down Expand Up @@ -56,19 +56,29 @@ const hsl_ma57_patch = joinpath(hsl_ma57_path, "get_factors.patch")
##############################
# MA97
##############################
const hsl_ma97_verions = [
const hsl_ma97_versions = [
HSLVersion("hsl_ma97", "2.7.0", "ac3a081d3a28e9ecb8871ce769f4ced2a5ffa5a9c36defbd2c844ae3493ccb37", ".tar.gz"),
HSLVersion("hsl_ma97", "2.7.0", "8221b607d96554d7a57cc60483c7305ef43a8785dc4171ac2e8da087900a1100", ".zip"),
HSLVersion("hsl_ma97", "2.6.0", "be5fe822674be93e3d2e1a7d7ed6c5ad831b91cf8ca5150beb473f67af5fcb66", ".tar.gz"),
]
const hsl_ma97_path = haskey(ENV, "HSL_MA97_PATH") ? ENV["HSL_MA97_PATH"] : joinpath(@__DIR__, "downloads")
hsl_ma97_version = findversion(hsl_ma97_verions, hsl_ma97_path)
hsl_ma97_version = findversion(hsl_ma97_versions, hsl_ma97_path)
const hsl_ma97_archive = isnothing(hsl_ma97_version) ? "" : joinpath(hsl_ma97_path, getname(hsl_ma97_version))

##############################
# MA86
##############################
const hsl_ma86_versions = [
HSLVersion("hsl_ma86", "1.7.0", "845c65bee0bf31507d7b99c87773997012b7b16434da349ad5c361ceb257191e", ".tar.gz"),
]
const hsl_ma86_path = haskey(ENV, "HSL_MA86_PATH") ? ENV["HSL_MA86_PATH"] : joinpath(@__DIR__, "downloads")
hsl_ma86_version = findversion(hsl_ma86_versions, hsl_ma86_path)
const hsl_ma86_archive = isnothing(hsl_ma86_version) ? "" : joinpath(hsl_ma86_path, getname(hsl_ma86_version))

##############################
# Build
##############################
const hsl_archives = [hsl_ma57_archive, hsl_ma97_archive]
const hsl_archives = [hsl_ma57_archive, hsl_ma97_archive, hsl_ma86_archive]

const HSL_FC = haskey(ENV, "HSL_FC") ? ENV["HSL_FC"] : "gfortran"
const HSL_F77 = haskey(ENV, "HSL_F77") ? ENV["HSL_F77"] : HSL_FC
Expand Down Expand Up @@ -99,6 +109,12 @@ if any(isfile.(hsl_archives))
include("build_hsl_ma57.jl")
end

if isfile(hsl_ma86_archive)
@info "building ma86"
push!(products, FileProduct(prefix, "lib/libhsl_ma86.$so", :libhsl_ma86))
include("build_hsl_ma86.jl")
end

if isfile(hsl_ma97_archive)
@info "building ma97"
push!(products, FileProduct(prefix, "lib/libhsl_ma97.$so", :libhsl_ma97))
Expand Down
12 changes: 12 additions & 0 deletions deps/build_hsl_ma86.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version = hsl_ma86_version
archive = hsl_ma86_archive
if version.ext == ".tar.gz"
run(`tar -zxf $archive -C $builddir`)
elseif hsl_ma97_version.ext == ".zip"
run(`unzip -o $archive -d $builddir`)
end
name = getname(version, false)
cd("$builddir/$name")
run(`./configure --prefix=$usrdir FC=$(HSL_FC) F77=$(HSL_F77) CC=$(HSL_CC) CFLAGS=-fPIC FFLAGS="-fPIC -fopenmp" FCFLAGS="-fPIC -fopenmp" --with-blas="-L$libopenblas_dir -lopenblas" --with-metis="-L$libmetis_dir -lmetis"`)
run(`make install`)
cd(@__DIR__)
4 changes: 4 additions & 0 deletions src/HSL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const data_map = Dict{Type, Type}(Float32 => Cfloat,
ComplexF32 => Cfloat,
ComplexF64 => Cdouble)


# package-specific definitions
if (@isdefined libhsl_ma57) || haskey(ENV, "DOCUMENTER_KEY")
include("hsl_ma57.jl")
Expand All @@ -34,5 +35,8 @@ end
if (@isdefined libhsl_ma97) || haskey(ENV, "DOCUMENTER_KEY")
include("hsl_ma97.jl")
end
if (@isdefined libhsl_ma86) || haskey(ENV, "DOCUMENTER_KEY")
include("hsl_ma86.jl")
end

end
Loading