{"id":22588800,"url":"https://github.com/wolframresearch/wolfram-app-discovery-rs","last_synced_at":"2025-04-10T21:44:35.989Z","repository":{"id":38081736,"uuid":"444534941","full_name":"WolframResearch/wolfram-app-discovery-rs","owner":"WolframResearch","description":"Locate local installations of the Wolfram Language.","archived":false,"fork":false,"pushed_at":"2025-02-23T16:59:47.000Z","size":217,"stargazers_count":16,"open_issues_count":8,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T21:44:25.181Z","etag":null,"topics":["mathematica","rust","rust-crate","wolfram-engine","wolfram-language","wolfram-mathematica"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WolframResearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-04T19:10:43.000Z","updated_at":"2025-04-09T10:20:12.000Z","dependencies_parsed_at":"2023-02-18T12:16:24.263Z","dependency_job_id":null,"html_url":"https://github.com/WolframResearch/wolfram-app-discovery-rs","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwolfram-app-discovery-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwolfram-app-discovery-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwolfram-app-discovery-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwolfram-app-discovery-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WolframResearch","download_url":"https://codeload.github.com/WolframResearch/wolfram-app-discovery-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305885,"owners_count":21081562,"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":["mathematica","rust","rust-crate","wolfram-engine","wolfram-language","wolfram-mathematica"],"created_at":"2024-12-08T08:11:08.706Z","updated_at":"2025-04-10T21:44:35.967Z","avatar_url":"https://github.com/WolframResearch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wolfram-app-discovery\n\n[![Crates.io](https://img.shields.io/crates/v/wolfram-app-discovery.svg)](https://crates.io/crates/wolfram-app-discovery)\n![License](https://img.shields.io/crates/l/wolfram-app-discovery.svg)\n[![Documentation](https://docs.rs/wolfram-app-discovery/badge.svg)](https://docs.rs/wolfram-app-discovery)\n\n#### [API Documentation](https://docs.rs/wolfram-app-discovery) | [CLI Documentation](./docs/CommandLineHelp.md) | [Changelog](./docs/CHANGELOG.md) | [Contributing](./CONTRIBUTING.md)\n\n## About\n\nFind local installations of the Wolfram Language and Wolfram applications.\n\nThis crate provides:\n\n* The `wolfram-app-discovery` Rust crate *([API docs](https://docs.rs/wolfram-app-discovery))*\n* The `wolfram-app-discovery` command-line tool *([CLI docs](./docs/CommandLineHelp.md), [Installation](#installing-wolfram-app-discovery))*\n\n## Examples\n\n### Using the API\n\nLocate the default Wolfram Language installation on this computer:\n```rust\nuse wolfram_app_discovery::WolframApp;\n\nlet app = WolframApp::try_default()\n    .expect(\"unable to locate any Wolfram applications\");\n\n// Prints a path like:\n//   $InstallationDirectory: /Applications/Mathematica.app/Contents/\nprintln!(\"$InstallationDirectory: {}\", app.installation_directory().display());\n```\n\nSee also: [`WolframApp::try_default()`][WolframApp::try_default]\n\n### Using the command-line tool\n\nLocate the default Wolfram Language installation on this computer:\n\n```shell\n$ wolfram-app-discovery default\nApp type:                           Mathematica\nWolfram Language version:           13.1.0\nApplication directory:              /Applications/Wolfram/Mathematica.app\n```\n\nSee [CommandLineHelp.md](./docs/CommandLineHelp.md) for more information on the\n`wolfram-app-discovery` command-line interface.\n\n### Scenario: Building a LibraryLink library\n\nSuppose you have the following C program that provides a function via the\nWolfram *LibraryLink* interface, which you would like to compile and call from\nWolfram Language:\n\n```c\n#include \"WolframLibrary.h\"\n\n/* Adds one to the input, returning the result  */\nDLLEXPORT int increment(\n  WolframLibraryData libData,\n  mint argc,\n  MArgument *args,\n  MArgument result\n) {\n    mint arg = MArgument_getInteger(args[0]);\n    MArgument_setInteger(result, arg + 1);\n    return LIBRARY_NO_ERROR;\n}\n```\n\nTo successfully compile this program, a C compiler will need to be able to find\nthe included `\"WolframLibrary.h\"` header file. We can use `wolfram-app-discovery`\nto get the path to the appropriate directory:\n\n```shell\n# Get the LibraryLink includes directory\n$ export WOLFRAM_C_INCLUDES=`wolfram-app-discovery default --raw-value library-link-c-includes-directory`\n```\n\nAnd then pass that value to a C compiler:\n\n```shell\n# Invoke the C compiler\n$ clang increment.c -I$WOLFRAM_C_INCLUDES -shared -o libincrement\n```\n\nThe resulting compiled library can be loaded into Wolfram Language using\n[`LibraryFunctionLoad`](https://reference.wolfram.com/language/ref/LibraryFunctionLoad)\nand then called:\n\n```wolfram\nfunc = LibraryFunctionLoad[\"~/libincrement\", \"increment\", {Integer}, Integer];\n\nfunc[5]  (* Returns 6 *)\n```\n\n## Installing `wolfram-app-discovery`\n\n[**Download `wolfram-app-discovery` releases.**](https://github.com/WolframResearch/wolfram-app-discovery-rs/releases)\n\nPrecompiled binaries for the `wolfram-app-discovery` command-line tool are\navailable for all major platforms from the GitHub Releases page.\n\n### Using cargo\n\n`wolfram-app-discovery` can be installed using `cargo`\n(the [Rust package manager](https://doc.rust-lang.org/cargo/)) by executing:\n\n```shell\n$ cargo install --features=cli wolfram-app-discovery\n```\n\nThis will install the latest version of\n[`wolfram-app-discovery` from crates.io](https://crates.io/crates/wolfram-app-discovery).\n\n## Configuration\n\nThe default method used to locate a Wolfram Language installation\n([`WolframApp::try_default()`][WolframApp::try_default]) will use the following\nsteps to attempt to locate any local installations, returning the first one found:\n\n1. The location specified by the `WOLFRAM_APP_DIRECTORY` environment variable, if set.\n2. If `wolframscript` is on `PATH`, use it to locate the system installation.\n3. Check in the operating system applications directory.\n\n#### Configuration example\n\nSpecify a particular Wolfram Language installation to use (on macOS):\n\n```shell\n$ export WOLFRAM_APP_DIRECTORY=\"/Applications/Mathematica.app\"\n```\n\nThis environment variable is checked by both the `wolfram-app-discovery` library and\ncommand-line executable.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Wolfram application licenses\n\nWolfram applications are covered by different licensing terms than `wolfram-app-discovery`.\n\n[Wolfram Engine Community Edition](https://wolfram.com/engine) is a free\ndistribution of the Wolfram Language, licensed for personal and non-production use cases.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.\n\nSee [**Development.md**](./docs/Development.md) for instructions on how to\nperform common development tasks when contributing to this project.\n\nSee [*Maintenance.md*](./docs/Maintenance.md) for instructions on how to\nmaintain this project.\n\n\n[WolframApp::try_default]: https://docs.rs/wolfram-app-discovery/latest/wolfram_app_discovery/struct.WolframApp.html#method.try_default\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolframresearch%2Fwolfram-app-discovery-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolframresearch%2Fwolfram-app-discovery-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolframresearch%2Fwolfram-app-discovery-rs/lists"}