forked from CEED/libCEED
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
3,366 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Manifest.toml | ||
deps/build.log | ||
deps/deps.jl | ||
docs/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name = "LibCEED" | ||
uuid = "2cd74e05-b976-4426-91fa-5f1011f8952b" | ||
authors = ["Will Pazner <[email protected]>"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" | ||
Cassette = "7057c7e9-c182-5462-911a-8362d720325c" | ||
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
Requires = "ae029012-a4dd-5104-9daa-d747884805df" | ||
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" | ||
UnsafeArrays = "c4a57d5a-5b31-53a6-b365-19f8c011fbd6" | ||
libCEED_jll = "762fde13-7596-547b-826d-8223c52d51c1" | ||
|
||
[extras] | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# LibCEED.jl: Julia Interface for [libCEED](https://github.com/CEED/libCEED) | ||
|
||
## Installation | ||
|
||
When the LibCEED.jl package is built, it requires the environment variable | ||
`JULIA_LIBCEED_LIB` to be set to the location of the compiled libCEED shared | ||
library. | ||
|
||
For example, the package can be installed by: | ||
```julia | ||
% JULIA_LIBCEED_LIB=/path/to/libceed.so julia | ||
julia> # press ] to enter package manager | ||
|
||
(@v1.5) pkg> add LibCEED | ||
``` | ||
or, equivalently, | ||
```julia | ||
% julia | ||
|
||
julia> withenv("JULIA_LIBCEED_LIB" => "/path/to/libceed.so") do | ||
Pkg.add("LibCEED") | ||
end | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
This package provides both a low-level and high-level interface for libCEED. | ||
|
||
### Low-Level Interface | ||
|
||
The low-level interface (provided in the `LibCEED.C` module) is in one-to-one | ||
correspondence with the C libCEED iterface, and is automatically generated (with | ||
some minor manual modifications) using the Julia package Clang.jl. The script | ||
used to generate bindings is available in `generate_bindings.jl`. | ||
|
||
With the low-level interface, the user is responsible for freeing all allocated | ||
memory (calling the appropriate `Ceed*Destroy` functions). This interface is | ||
not type-safe, and calling functions with the wrong arguments can cause libCEED | ||
to crash. | ||
|
||
### High-Level Interface | ||
|
||
The high-level interface provides a more idiomatic Julia interface to the | ||
libCEED library. Objects allocated using the high-level interface will | ||
automatically be destroyed by the garbage collector, so the user does not need | ||
to manually manage memory. | ||
|
||
See the documentation for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const libceed_envvar = "JULIA_LIBCEED_LIB" | ||
|
||
if isfile("deps.jl") | ||
rm("deps.jl") | ||
end | ||
|
||
if haskey(ENV, libceed_envvar) | ||
ceedpath = ENV[libceed_envvar] | ||
@info "Using libCEED library specified by $libceed_envvar at $ceedpath" | ||
open("deps.jl", write=true) do f | ||
println(f, "const libceed = \"$(escape_string(ceedpath))\"") | ||
end | ||
else | ||
@info "Using prebuilt libCEED binaries provided by libCEED_jll" | ||
open("deps.jl", write=true) do f | ||
println(f, "using libCEED_jll") | ||
end | ||
end |
Oops, something went wrong.