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

SuiteSparse can be compiled without CHOLMOD, get_ldup argument type breaks compiling #3

Closed
peteristhegreat opened this issue Dec 20, 2023 · 3 comments

Comments

@peteristhegreat
Copy link

https://github.com/JuliaSparse/SuiteSparse.jl/blob/master/src/SuiteSparse.jl#L13

f98115d

In a commercial setting, I have a copy of julia without GPL libraries.

So SuiteSparse compiles without CHOLMOD.

if Base.USE_GPL_LIBS
    const CHOLMOD = SparseArrays.CHOLMOD
    const SPQR = SparseArrays.SPQR
    const UMFPACK = SparseArrays.UMFPACK
end

Then when SparseInverseSubset gets downloaded during an instantiate, it fails to compile:

ERROR: LoadError: UndefVarError: CHOLMOD not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:26
 [2] top-level scope
   @ ~/.julia/packages/SparseInverseSubset/l3ksN/src/SparseInverseSubset.jl:42
 [3] include
   @ ./Base.jl:384 [inlined]
 [4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1235
 [5] top-level scope
   @ none:1
 [6] eval
   @ ./boot.jl:360 [inlined]
 [7] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [8] top-level scope
   @ none:1
in expression starting at /root/.julia/packages/SparseInverseSubset/l3ksN/src/SparseInverseSubset.jl:1

Please keep the dependence on CHOLMOD optional and not reference it in the arg for get_ldup.

Loose typing how it was before the docstring update should fix it for me.

Thanks!

@ElOceanografo
Copy link
Owner

Can you confirm what your dependency chain is that is importing SparseInverseSubset? Is it through ChainRules?

I will revert to the loose typing for now, but there should probably be a conditional import statement in ChainRules to handle non-GPL Julia builds. See also this PR: #2

@peteristhegreat
Copy link
Author

You are correct about it coming in through ChainRules.jl.

Searching through my ~/.julia/packages folder and in my Manifest.toml confirmed your suspicions.

$ cd ~/.julia/packages
$ grep -r -I SparseInverseSubset *
ChainRules/pEOSw/Project.toml:SparseInverseSubset = "dc90abb0-5640-4711-901d-7e5b23a2fada"
ChainRules/pEOSw/Project.toml:SparseInverseSubset = "0.1"
ChainRules/pEOSw/src/rulesets/LinearAlgebra/structured.jl:using SparseInverseSubset
ChainRules/pEOSw/src/rulesets/SparseArrays/sparsematrix.jl:    L, D, U, P = SparseInverseSubset.get_ldup(F)
SparseInverseSubset/l3ksN/test/runtests.jl:using SparseInverseSubset
SparseInverseSubset/l3ksN/test/runtests.jl:@testset verbose=true "SparseInverseSubset.jl" begin
SparseInverseSubset/l3ksN/README.md:# SparseInverseSubset.jl
SparseInverseSubset/l3ksN/README.md:[![Build Status](https://github.com/ElOceanografo/SparseInverseSubset.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ElOceanografo/SparseInverseSubset.jl/actions/workflows/CI.yml?query=branch%3Amain)
SparseInverseSubset/l3ksN/README.md:using SparseInverseSubset
SparseInverseSubset/l3ksN/Project.toml:name = "SparseInverseSubset"
SparseInverseSubset/l3ksN/src/SparseInverseSubset.jl:module SparseInverseSubset

Thanks for the followup.

@ElOceanografo
Copy link
Owner

Have loosened the typing on get_ldup as a patch here, and opened JuliaDiff/ChainRules.jl#763 at ChainRules as a permanent fix. Closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants