Monty  Boehm

Monty Boehm

1659510360

Clang.jl: Julia interface to Libclang

Clang  

This package provides a Julia language wrapper for libclang: the stable, C-exported interface to the LLVM Clang compiler. The libclang API documentation provides background on the functionality available through libclang, and thus through the Julia wrapper. The repository also hosts related tools built on top of libclang functionality.

Installation

pkg> add Clang

If you'd like to use the old generator(Clang.jl v0.13), please checkout this branch for the documentation. Should you have any questions on how to upgrade the generator script, feel free to submit a post/request in the Discussions area.

Binding Generator

Clang.jl provides a module Clang.Generators for auto-generating C library bindings for Julia language from C headers.

Quick start

Write a config file generator.toml:

[general]
library_name = "libclang"
output_file_path = "./LibClang.jl"
module_name = "LibClang"
jll_pkg_name = "Clang_jll"
export_symbol_prefixes = ["CX", "clang_"]

and a Julia script generator.jl:

using Clang.Generators
using Clang.LibClang.Clang_jll  # replace this with your jll package

cd(@__DIR__)

include_dir = normpath(Clang_jll.artifact_dir, "include")
clang_dir = joinpath(include_dir, "clang-c")

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

# add compiler flags, e.g. "-DXXXXXXXXX"
args = get_default_args()  # Note you must call this function firstly and then append your own flags
push!(args, "-I$include_dir")

headers = [joinpath(clang_dir, header) for header in readdir(clang_dir) if endswith(header, ".h")]
# there is also an experimental `detect_headers` function for auto-detecting top-level headers in the directory
# headers = detect_headers(clang_dir, args)

# create context
ctx = create_context(headers, args, options)

# run generator
build!(ctx)

Please refer to this toml file for a full list of configuration options.

Examples

The generator is currently used by several projects and you can take them as examples.

Author: JuliaInterop
Source Code: https://github.com/JuliaInterop/Clang.jl 
License: MIT license

#julia #generator 

What is GEEK

Buddha Community

Clang.jl: Julia interface to Libclang
Monty  Boehm

Monty Boehm

1659510360

Clang.jl: Julia interface to Libclang

Clang  

This package provides a Julia language wrapper for libclang: the stable, C-exported interface to the LLVM Clang compiler. The libclang API documentation provides background on the functionality available through libclang, and thus through the Julia wrapper. The repository also hosts related tools built on top of libclang functionality.

Installation

pkg> add Clang

If you'd like to use the old generator(Clang.jl v0.13), please checkout this branch for the documentation. Should you have any questions on how to upgrade the generator script, feel free to submit a post/request in the Discussions area.

Binding Generator

Clang.jl provides a module Clang.Generators for auto-generating C library bindings for Julia language from C headers.

Quick start

Write a config file generator.toml:

[general]
library_name = "libclang"
output_file_path = "./LibClang.jl"
module_name = "LibClang"
jll_pkg_name = "Clang_jll"
export_symbol_prefixes = ["CX", "clang_"]

and a Julia script generator.jl:

using Clang.Generators
using Clang.LibClang.Clang_jll  # replace this with your jll package

cd(@__DIR__)

include_dir = normpath(Clang_jll.artifact_dir, "include")
clang_dir = joinpath(include_dir, "clang-c")

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

# add compiler flags, e.g. "-DXXXXXXXXX"
args = get_default_args()  # Note you must call this function firstly and then append your own flags
push!(args, "-I$include_dir")

headers = [joinpath(clang_dir, header) for header in readdir(clang_dir) if endswith(header, ".h")]
# there is also an experimental `detect_headers` function for auto-detecting top-level headers in the directory
# headers = detect_headers(clang_dir, args)

# create context
ctx = create_context(headers, args, options)

# run generator
build!(ctx)

Please refer to this toml file for a full list of configuration options.

Examples

The generator is currently used by several projects and you can take them as examples.

Author: JuliaInterop
Source Code: https://github.com/JuliaInterop/Clang.jl 
License: MIT license

#julia #generator 

OCCA.jl: Julia interface Into OCCA

OCCA.jl

OCCA is a cross platform single-instruction-multiple-data (SIMD) threading library that is retargetable to multiple backends such as pthreads, openmp, opencl, and cuda. OCCA.jl is a Julia interface into OCCA. The main OCCA repository can be found here.

Installation and testing.

Pkg.add("OCCA");
#This takes a minute because no precompiled OCCA binaries exist.
#OCCA will build with no parallel backends by default because 
#reliable backend detection is under development.
#To rebuild with e.g. opencl and cuda you would run
using OCCA;
OCCA.rebuildwith!(opencl=true,cuda=true);

#To run tests for all compiled backends, run:
Pkg.test("OCCA");

#If a backend is not compiled, that test will simply pass without doing anything.
#OCCA will default to serial mode if no backend is installed, so the tests
#still provide some information about correctness of the test kernels (ignoring
#parallel issues such as race conditions and deadlocks)

An example script.

addVectors.okl

kernel void addVectors(const int entries,
                       const float *a,
                       const float *b,
                       float *ab){
  for(int group = 0; group < ((entries + 15) / 16); ++group; outer0){
    for(int item = 0; item < 16; ++item; inner0){
      const int N = (item + (16 * group));

      if(N < entries)
        ab[N] = a[N] + b[N];
    }
  }
}

advectors.jl


    
    infostring   = "mode = OpenMP  , schedule = compact, chunk = 10";

    entries = 5

    device = OCCA.Device(infostring);

    a  = Float32[1 - i for i in 1:entries]
    b  = Float32[i     for i in 1:entries]
    ab = Array(Float32,(length(a),));

    correctvals = [1.0 for i in 1:entries];

    o_a  = OCCA.malloc(device, a);
    o_b  = OCCA.malloc(device, b);
    o_ab = OCCA.malloc(device, ab);

    addvectors = OCCA.buildkernel(device,"addVectors.okl","addVectors")

    OCCA.runkernel!(addvectors,entries,o_a,o_b,o_ab)

    OCCA.memcpy!(ab, o_ab)



Known issues

-The build script does not work for Windows, this is under development. -If OCCA kernel file uses shared memory and you target OpenCL+CPU, it will crash. This appears to be an OpenCL problem and not an OCCA problem.

Contributing

Contributing code Fork this repository on Github, make desired changes, and submit pull request.

Helping with tests and builds It would be enormously helpful if issues could be opened with any build or test failures, along with the specs of the machines on which the builds or tests failed.

Editor Issues .OKL files have a nearly-C grammar, and so most syntax highlighting modules designed for vanilla C will also do a decent job highlighting .OKL files.

Download Details:

Author: ReidAtcheson
Source Code: https://github.com/ReidAtcheson/OCCA.jl 
License: MIT license

#julia #interface 

ZMQ.jl: Julia interface to ZMQ

ZMQ.jl

A Julia interface to ZeroMQ

ZMQ.jl is a Julia interface to ZeroMQ, The Intelligent Transport Layer.

Installation

The package can be installed with the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run:

pkg> add ZMQ

Or, equivalently, via the Pkg API:

julia> import Pkg; Pkg.add("ZMQ")

(This installs its own copy of the ZMQ libraries from the ZMQBuilder repository.)

Documentation

  • STABLEdocumentation of the most recently tagged version.
  • DEVELdocumentation of the in-development version.

Troubleshooting

If you are using Windows and get an error Provider PackageManager failed to satisfy dependency zmq, you may need to restart Julia and run Pkg.build("ZMQ") again. See issue 69 for more details.

Questions and Contributions

Usage questions can be posted on the Julia Discourse forum under the zmq tag, in the #zmq channel of the Julia Slack and/or in the JuliaDocs Gitter chat room.

Contributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems. The contributing page has a few guidelines that should be followed when opening pull requests and contributing code.

Download Details:

Author: JuliaInterop
Source Code: https://github.com/JuliaInterop/ZMQ.jl 
License: View license

#julia #interface 

LTspice.jl: Julia interface to LTspice

LTspice.jl

LTspice.jl provides a julia interface to LTspiceTM. Several interfaces are provided.

  1. A dictionary like interface to access parameters and measurements by name.
  2. An array interface, which is primarily for measurements of stepped simulations.
  3. Simulations can be called like functions.

Installation

LTspice.jl is currently unregistered. It can be installed using Pkg.clone.

Pkg.clone("https://github.com/cstook/LTspice.jl.git")

The julia documentation section on installing unregistered packages provides more information.

LTspice.jl is compatible with julia 1.0

Example 1

Import the module.

using LTspice

Create an instance of LTspiceSimulation.

example1 = LTspiceSimulation("example1.asc",tempdir=true)

Access parameters and measurements using their name as the key.

Set a parameter to a new value.

example1["Rload"] = 20.0  # set parameter Rload to 20.0

Read the resulting measurement.

loadpower = example1["Pload"] # run simulation, return Pload

Circuit can be called like a function

loadpower = example1(100.0)  # pass Rload, return Pload

Use Optim.jl to perform an optimization on a LTspice simulation

using Optim
result = optimize(rload -> -example1(rload)[1],10.0,100.0)
rload_for_maximum_power = example1["Rload"]

Supported Platforms

LTspice.jl works on windows and linux with LTspice under wine. Osx is not supported.

Download Details:

Author: cstook
Source Code: https://github.com/cstook/LTspice.jl 
License: View license

#julia #interface 

Monty  Boehm

Monty Boehm

1659641700

Tables.jl: An interface for Tables In Julia

Tables.jl

The Tables.jl package provides simple, yet powerful interface functions for working with all kinds tabular data.

Installation: at the Julia REPL, import Pkg; Pkg.add("Tables")

Maintenance: Tables is maintained collectively by the JuliaData collaborators. Responsiveness to pull requests and issues can vary, depending on the availability of key collaborators.

Documentation

List of packages which support Tables.jl interface can be found in INTEGRATIONS.md.

Additional Resources

Please refer to TableOperations.jl for common table operations (select, filter, transform, map, etc.)

Author: JuliaData
Source Code: https://github.com/JuliaData/Tables.jl 
License: MIT license

#julia #data #interfaces #table