Skip to content

Commit

Permalink
New code generator. May need fixup in a folloup PR to ensure consiste…
Browse files Browse the repository at this point in the history
…ncy against the MPI.jl backend.
  • Loading branch information
termi-official committed Oct 4, 2022
1 parent aa03326 commit f6da3ba
Show file tree
Hide file tree
Showing 7 changed files with 3,782 additions and 14,123 deletions.
24 changes: 12 additions & 12 deletions gen/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ version = "0.4.2"

[[deps.Clang]]
deps = ["CEnum", "Clang_jll", "Downloads", "Pkg", "TOML"]
git-tree-sha1 = "b6998b85ea2abbc8a02ca1ccca9438338ed5f8e5"
git-tree-sha1 = "b7e356adf44b1d4eb7aa2b0961ec130730fa208f"
uuid = "40e3b903-d033-50b4-a0cc-940c62c95e31"
version = "0.15.8"
version = "0.16.3"

[[deps.Clang_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll", "libLLVM_jll"]
Expand All @@ -44,9 +44,9 @@ uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[[deps.HYPRE_jll]]
deps = ["Artifacts", "JLLWrappers", "LAPACK_jll", "LazyArtifacts", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenBLAS_jll", "OpenMPI_jll", "Pkg", "TOML"]
git-tree-sha1 = "ed07e4165a837e4606bc5dfbb6536ab0ec798ab8"
git-tree-sha1 = "b77d3eca75f8442e034ccf415c87405a49e77985"
uuid = "0a602bbd-b08b-5d75-8d32-0de6eef44785"
version = "2.23.0+1"
version = "2.23.1+1"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
Expand Down Expand Up @@ -92,21 +92,21 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.MPICH_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "Pkg", "TOML"]
git-tree-sha1 = "089ec72dbf7d7a853626f438d140d0a642ddbda4"
git-tree-sha1 = "6d4fa43afab4611d090b11617ecea1a144b21d35"
uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4"
version = "4.0.2+4"
version = "4.0.2+5"

[[deps.MPIPreferences]]
deps = ["Libdl", "Preferences"]
git-tree-sha1 = "49f10d34284610c125421c7a4e6f913e4bc00897"
git-tree-sha1 = "9959c42b41220206eeda9004f695d913e2245658"
uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
version = "0.1.3"
version = "0.1.5"

[[deps.MPItrampoline_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "Pkg", "TOML"]
git-tree-sha1 = "0c87d3420a787a2be96942d4d1298487271c51d0"
git-tree-sha1 = "b3f9e42685b4ad614eca0b44bd863cd41b1c86ea"
uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748"
version = "4.1.2+0"
version = "5.0.2+1"

[[deps.Markdown]]
deps = ["Base64"]
Expand Down Expand Up @@ -134,9 +134,9 @@ uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"

[[deps.OpenMPI_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "Pkg", "TOML"]
git-tree-sha1 = "6198c6dc3b5c3dc01854879197a5f382a60f947d"
git-tree-sha1 = "346d6b357a480300ed7854dbc70e746ac52e10fd"
uuid = "fe0851c0-eecd-5654-98d4-656369965a5c"
version = "4.1.3+1"
version = "4.1.3+3"

[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
Expand Down
4 changes: 4 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
HYPRE_jll = "0a602bbd-b08b-5d75-8d32-0de6eef44785"
MPICH_jll = "7cb0a576-ebde-5e09-9194-50597f1243b4"
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"

[extras]
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
12 changes: 10 additions & 2 deletions gen/generator.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
using Clang.Generators
using HYPRE_jll, MPICH_jll
using HYPRE_jll, MPIPreferences

cd(@__DIR__)

if MPIPreferences.binary == "MPICH_jll"
import MPICH_jll: artifact_dir
elseif MPIPreferences.binary == "OpenMPI_jll"
import OpenMPI_jll: artifact_dir
else
error("Unknown MPI binary: $(MPIPreferences.binary)")
end

hypre_include_dir = normpath(HYPRE_jll.artifact_dir, "include")
mpi_include_dir = normpath(MPICH_jll.artifact_dir, "include")
mpi_include_dir = normpath(artifact_dir, "include")

options = load_options(joinpath(@__DIR__, "generator.toml"))

Expand Down
18 changes: 4 additions & 14 deletions gen/generator.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
[general]
library_name = "libHYPRE"
output_file_path = "../lib/LibHYPRE.jl"
output_common_file_path = "../lib/LibHYPRECommon.jl"
output_api_file_path = "../lib/LibHYPREAPI.jl"
jll_pkg_name = "HYPRE_jll"
export_symbol_prefixes = []
output_ignorelist = [
# Overflows Int32
"MPI_FLOAT_INT",
"MPI_DOUBLE_INT",
"MPI_LONG_INT",
"MPI_SHORT_INT",
"MPI_LONG_DOUBLE_INT",
# Uses NULL
"MPI_T_ENUM_NULL",
"MPI_T_CVAR_HANDLE_NULL",
"MPI_T_PVAR_HANDLE_NULL",
"MPI_T_PVAR_SESSION_NULL",
# Bogus expression: const MPI_ARGV_NULL = (Cchar * (*))(0)
"MPI_ARGV_NULL",
# Undefined values DBL_MAX, DBL_MIN, DBL_EPSILON, DBL_MIN_EXP
"HYPRE_REAL_MAX",
"HYPRE_REAL_MIN",
"HYPRE_REAL_EPSILON",
"HYPRE_REAL_MIN_EXP",
# Bogus expression: const HYPRE_VERSION = ((("HYPRE_RELEASE_NAME Date Compiled: ")(__DATE__))(" "))(__TIME__)
"HYPRE_VERSION",
# Filter out MPI stuff
"^[PQ]?MPI"
]
Loading

0 comments on commit f6da3ba

Please sign in to comment.