Code Monkey home page Code Monkey logo

olca-rust's Introduction

olca-rust

olca-rust provides JNI bindings for high performance math libraries that are used in openLCA where the glue code is written in Rust. Currently, we support calls into OpenBLAS and UMFPACK and we take pre-compiled versions of these libraries for the respective platforms directly from the Julia distribution packages.

Building from source

In order to build the JNI bindings, you need to have a Rust toolchain (with ructc, cargo, and a platform specific linker) installed. The respective platform entry in the config file needs to point to a folder where the OpenBLAS and UMFPACK libraries including all dependencies can be found (typically, we use the library folder of a Julia installation for this; note that the current Julia 1.7 version fails with segfaults in some calculations on Linux; the 1.6 version seems to work). This project contains a build.bat script for Windows and a build.sh script for Linux and macOS for running the build on these platforms.

On Windows, the build script first generates lib-files for each library we want to link against. This is done automatically from the definition files in the windefs folder but it requires that the lib tool from the MSVC 2017 build tools (which are anyhow required for the Rust compiler) is in your PATH (e.g. something like this: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64).

The build scripts should then generate the libraries (olcar.{dll|so|dylib} with BLAS & LAPACK bindings and olcar_withumf.{dll|so|dylib} with additional UMFPACK bindings in the bin folder.

The deps.py script

For managing the dependencies and generating distribution packages, this project contains a deps.py script that can be executed with Python 3.6+ and takes a command as argument:

python3 deps.py [command]

The following commands are currently supported:

  • collect: collects the dependencies and prints them on the console
  • sync: copies missing dependencies to the bin folder
  • dist: generates the distribution packages
  • viz: prints the dependency graph in dot-format that can be visualized with tools like Graphviz/Webgraphviz (like the image above)
  • clean: deletes the contents of the bin and dist folders

The deps.py script uses the following tools to collect the dependencies:

  • Linux: ldd
  • macOS: otool
  • Windows: the command line version of the Dependencies tool which needs to be available in the system path

olca-rust's People

Contributors

msrocka avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.