https://github.com/pabloferz/lammps_jll.jl
https://github.com/pabloferz/lammps_jll.jl
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pabloferz/lammps_jll.jl
- Owner: pabloferz
- License: mit
- Created: 2020-03-31T06:53:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-11T06:32:39.000Z (about 5 years ago)
- Last Synced: 2025-01-23T03:26:05.122Z (5 months ago)
- Language: Julia
- Size: 15.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LAMMPS_jll.jl
This is an autogenerated package constructed using [`BinaryBuilder.jl`](https://github.com/JuliaPackaging/BinaryBuilder.jl).
## Products
The code bindings within this package are autogenerated from the following `Products` defined within the `build_tarballs.jl` file that generated this package:
```julia
products = [
LibraryProduct(["liblammps"], :liblammps),
ExecutableProduct(["lmp"], :lammps)
]
```## Usage example
For example purposes, we will assume that the following products were defined in the imaginary package `Example_jll`:
```julia
products = [
FileProduct("src/data.txt", :data_txt),
LibraryProduct("libdataproc", :libdataproc),
ExecutableProduct("mungify", :mungify_exe)
]
```With such products defined, `Example_jll` would contain `data_txt`, `libdataproc` and `mungify_exe` symbols exported. For `FileProduct` variables, the exported value is a string pointing to the location of the file on-disk. For `LibraryProduct` variables, it is a string corresponding to the `SONAME` of the desired library (it will have already been `dlopen()`'ed, so typical `ccall()` usage applies), and for `ExecutableProduct` variables, the exported value is a function that can be called to set appropriate environment variables. Example:
```julia
using Example_jll# For file products, you can access its file location directly:
data_lines = open(data_txt, "r") do io
readlines(io)
end# For library products, you can use the exported variable name in `ccall()` invocations directly
num_chars = ccall((:count_characters, libdataproc), Cint, (Cstring, Cint), data_lines[1], length(data_lines[1]))# For executable products, you can use the exported variable name as a function that you can call
mungify_exe() do mungify_exe_path
run(`$mungify_exe_path $num_chars`)
end
```