{"id":23158762,"url":"https://github.com/greendelta/olca-native","last_synced_at":"2025-10-17T06:05:12.331Z","repository":{"id":57739689,"uuid":"473152063","full_name":"GreenDelta/olca-native","owner":"GreenDelta","description":"Maven modules that package the native math libraries for openLCA","archived":false,"fork":false,"pushed_at":"2022-12-08T10:01:27.000Z","size":132,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-04T18:47:16.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GreenDelta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_OPENBLAS","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-23T11:10:16.000Z","updated_at":"2024-11-02T21:13:30.000Z","dependencies_parsed_at":"2023-01-25T00:45:56.850Z","dependency_job_id":null,"html_url":"https://github.com/GreenDelta/olca-native","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/GreenDelta/olca-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GreenDelta","download_url":"https://codeload.github.com/GreenDelta/olca-native/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-native/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259645828,"owners_count":22889689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T22:27:27.306Z","updated_at":"2025-10-17T06:05:12.217Z","avatar_url":"https://github.com/GreenDelta.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# olca-native\n\n![](deps.png)\n\nThis project packages the native calculation libraries for\n[openLCA](https://github.com/GreenDelta/olca-app) as Maven modules. It also\nprovides some utility functions for loading these libraries on different\nplatforms. Currently, these libraries come in two facets: BLAS/LAPACK only and\nUMFPACK (which contains BLAS/LAPACK). With UMFPACK you can solve large sparse\nsystems very efficiently in openLCA. However, UMFPACK is distributed under\nthe GPL v2/3 which is not compatible with the openLCA application. This is why\nthe UMFPACK libraries are not included by default in openLCA but can be added by\nthe users.\n\n# Usage\n\nIn order to use these calculation libraries you need to add the respective\nversion of your platform to the classpath, e.g. for Windows:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.openlca\u003c/groupId\u003e\n  \u003cartifactId\u003eolca-native\u003c/artifactId\u003e\n  \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.openlca\u003c/groupId\u003e\n  \u003cartifactId\u003eolca-native-umfpack-win-x64\u003c/artifactId\u003e\n  \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nYou can then load the libraries from you file system in the following way:\n\n```java\nFile dir = ...;\nNativeLib.loadFrom(dir);\n```\n\nThis will try to load the libraries for your platform from the given folder.\nIf there are no libraries at this location yet, it will try to extract them\nfrom the classpath. Thus, you can also just put the libraries into a folder\nand load them from there. `NativeLib.loadFrom(\u003cROOT\u003e)` will try to load the\nlibraries from the following sub-folder:\n\n```\n\u003cROOT\u003e/olca-native/\u003cVERSION\u003e/\u003cOS.ARCH\u003e\n\ne.g.\n\n~/openLCA-data-1.4/olca-native/0.0.1/x64\n```\n\nIn that folder, there is an `olca-native.json` file that contains the library\nload-order and the modules (currently `blas` and `umfpack`) that are provided\nby the package.\n\n```json\n{\n  \"modules\": [\n    \"blas\"\n  ],\n  \"libraries\": [\n    \"libwinpthread-1.dll\",\n    \"libgcc_s_seh-1.dll\",\n    \"libquadmath-0.dll\",\n    \"libgfortran-5.dll\",\n    \"libopenblas64_.dll\",\n    \"olcar.dll\"\n  ]\n}\n```\n\n## Building from source\n\nIn order to build the JNI bindings, you need to have a Rust toolchain (with\n`ructc`, `cargo`, and a platform specific linker) installed. The respective\nplatform entry in the `config` file needs to point to a folder where the\nOpenBLAS and UMFPACK libraries including all dependencies can be found (we use\nthe library folder of a [Julia](https://www.julialang.org) installation for\nthis; note that the current Julia 1.7 version fails with segfaults in some\ncalculations; the **1.6 version** seems to work). This project contains a\n`build.bat` script for Windows and a `build.sh` script for Linux and macOS for\nrunning the JNI build.\n\nOn **Windows**, the build script first [generates\nlib-files](https://stackoverflow.com/a/16127548/599575) for each library we want\nto link against. This is done automatically from the definition files in the\n`windefs` folder but it requires that the `lib` tool from the MSVC 2017 build\ntools (which are anyhow required for the Rust compiler) is in your `PATH` (e.g.\nsomething like this: `C:\\Program Files (x86)\\Microsoft Visual\nStudio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.24.28314\\bin\\Hostx64\\x64`).\n\nThe build scripts should then generate the libraries (`olcar.{dll|so|dylib}`\nwith BLAS \u0026 LAPACK bindings and `olcar_withumf.{dll|so|dylib}` with additional\nUMFPACK bindings in the `bin` folder.\n\n\n## The `package.py` script\n\nFor managing the dependencies and generating distribution packages, this project\ncontains a `package.py` script that can be executed with Python 3.8+:\n\n```bash\n# Usage\n\n# run the build if required and copy the libraries\n# into respective platform package\npython3 package.py\n\n# print the dependency graph in dot-format; can\n# be visualized with Graphviz\npython3 package.py viz\n\n# clean-up build resources\npython3 package.py clean\n\n```\n\nTo calculate the library dependencies, the `package.py` script uses the\nfollowing tools to collect the dependencies:\n\n* Linux: `ldd`\n* macOS: `otool`\n* Windows: the command line version of the\n  [Dependencies](https://github.com/lucasg/Dependencies) tool which needs to\n  be available in the system path\n\n\n## Running the tests\n\nThe `olca-native` module contains a small test suite for testing the libraries.\nSet the library dependency to the respective package that you want to test\nin the project's `pom.xml` to run the tests. Also, delete the\n`~/openLCA-data-1.4/olca-native` folder before running the tests, because this\nis used as the library load-location.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreendelta%2Folca-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreendelta%2Folca-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreendelta%2Folca-native/lists"}