Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 86 additions & 3 deletions gen/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.0-DEV"
manifest_format = "2.0"
project_hash = "61c6ad9feab9227ef7d89383b05c518b03764044"
project_hash = "7e3329f56df8cd3b8f22c6784358383ddf5c57b0"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
Expand All @@ -19,6 +19,12 @@ git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90"
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
version = "0.4.2"

[[deps.CSTParser]]
deps = ["Tokenize"]
git-tree-sha1 = "3ddd48d200eb8ddf9cb3e0189fc059fd49b97c1f"
uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
version = "3.3.6"

[[deps.Clang]]
deps = ["CEnum", "Clang_jll", "Downloads", "Pkg", "TOML"]
git-tree-sha1 = "ac81f3ea7c53b20d64ad1609a0298d9731fbdcf8"
Expand All @@ -31,6 +37,36 @@ git-tree-sha1 = "b88c99c9093f9db49a40d0715ea0e3ae5bbd91f7"
uuid = "0ee61d77-7f21-5576-8119-9fcc46b10100"
version = "14.0.6+2"

[[deps.CommonMark]]
deps = ["Crayons", "JSON", "SnoopPrecompile", "URIs"]
git-tree-sha1 = "e2f4627b0d3f2c1876360e0b242a7c23923b469d"
uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6"
version = "0.8.10"

[[deps.Compat]]
deps = ["UUIDs"]
git-tree-sha1 = "7a60c856b9fa189eb34f5f8a6f6b5529b7942957"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.6.1"

[deps.Compat.extensions]
CompatLinearAlgebraExt = "LinearAlgebra"

[deps.Compat.weakdeps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"

[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.13"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -43,6 +79,11 @@ version = "1.6.0"
[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.Glob]]
git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496"
uuid = "c27321d9-0574-5035-807b-f59d2c89b15c"
version = "1.3.1"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Expand All @@ -53,6 +94,18 @@ git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.4.1"

[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.3"

[[deps.JuliaFormatter]]
deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "SnoopPrecompile", "Tokenize"]
git-tree-sha1 = "0f6545dd63fec03d0cfe0c1d28f851e2d804e942"
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
version = "1.0.25"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
Expand All @@ -61,7 +114,7 @@ version = "0.6.3"
[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "7.88.1+0"
version = "8.0.1+0"

[[deps.LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
Expand All @@ -87,6 +140,9 @@ deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.2+0"

[[deps.Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2023.1.10"
Expand All @@ -95,6 +151,17 @@ version = "2023.1.10"
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.OrderedCollections]]
git-tree-sha1 = "d321bf2de576bf25ec4d3e4360faca399afca282"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.6.0"

[[deps.Parsers]]
deps = ["Dates", "SnoopPrecompile"]
git-tree-sha1 = "478ac6c952fddd4399e71d4779797c538d0ff2bf"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.5.8"

[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand Down Expand Up @@ -125,13 +192,19 @@ version = "0.7.0"
[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[deps.SnoopPrecompile]]
deps = ["Preferences"]
git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c"
uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c"
version = "1.0.3"

[[deps.Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[deps.SuiteSparse_jll]]
deps = ["Artifacts", "Libdl", "Pkg", "libblastrampoline_jll"]
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
version = "7.0.1+0"
version = "7.0.1+3"

[[deps.TOML]]
deps = ["Dates"]
Expand All @@ -143,6 +216,16 @@ deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"

[[deps.Tokenize]]
git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5"
uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624"
version = "0.5.25"

[[deps.URIs]]
git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
version = "1.4.2"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand Down
1 change: 1 addition & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
SuiteSparse_jll = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
2 changes: 1 addition & 1 deletion gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
## How to upgrade Clang.jl

1. `cd` to this directory
2. run `julia --project` and then in the Julia REPL, run `pkg> up`
2. run `julia --project` and then in the Julia REPL, run `pkg> up`
16 changes: 6 additions & 10 deletions gen/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ using Pkg.Artifacts
using Clang.Generators
using Clang.Generators.JLLEnvs
using SuiteSparse_jll
using JuliaFormatter

cd(@__DIR__)

# headers
include_dir = joinpath(SuiteSparse_jll.artifact_dir, "include") |> normpath

cholmod_h = joinpath(include_dir, "cholmod.h")
@assert isfile(cholmod_h)

Expand All @@ -18,15 +20,6 @@ SuiteSparseQR_C_h = joinpath(include_dir, "SuiteSparseQR_C.h")
umfpack_h = joinpath(include_dir, "umfpack.h")
@assert isfile(umfpack_h)

amd_h = joinpath(include_dir, "amd.h")
@assert isfile(amd_h)

colamd_h = joinpath(include_dir, "colamd.h")
@assert isfile(colamd_h)

ccolamd_h = joinpath(include_dir, "ccolamd.h")
@assert isfile(ccolamd_h)

# load common option
options = load_options(joinpath(@__DIR__, "generator.toml"))

Expand All @@ -39,9 +32,12 @@ for target in JLLEnvs.JLL_ENV_TRIPLES
args = get_default_args(target)
push!(args, "-I$include_dir")

header_files = [cholmod_h, SuiteSparseQR_C_h, amd_h, colamd_h, ccolamd_h, umfpack_h]
header_files = [cholmod_h, SuiteSparseQR_C_h, umfpack_h]

ctx = create_context(header_files, args, options)

build!(ctx)

path = options["general"]["output_file_path"]
format_file(path, YASStyle())
end
9 changes: 6 additions & 3 deletions gen/generator.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[general]
library_name = "libcholmod"
library_names = { "SuiteSparseQR_C.h" = "libspqr", "umfpack.*.h" = "libumfpack", "amd.h" = "libamd", "colamd.h" = "libcolamd", "ccolamd.h" = "libccolamd", "cholmod_camd.h" = "libcholmod"}
library_names = {"SuiteSparseQR_C.h" = "libspqr", "umfpack.h" = "libumfpack", "cholmod.h" = "libcholmod"}

use_julia_native_enum_type = true
use_deterministic_symbol = true
auto_mutability = true

output_ignorelist = [
# Clang.jl cannot handle these macro correctly, skip for now.
"UMFPACK_COPYRIGHT",
"UMFPACK_LICENSE_PART1",
"UMFPACK_LICENSE_PART2",
"UMFPACK_LICENSE_PART3",
"SuiteSparse_long",
"SuiteSparse_long_max",
"SuiteSparse_long_id",
Expand Down Expand Up @@ -63,4 +66,4 @@ functionlike_macro_includelist = [
"KLU_VERSION_CODE",
"BTF_VERSION_CODE",
"CCOLAMD_VERSION_CODE"
]
]