Locate local installations of the Wolfram Language.

Overview

wolfram-app-discovery

Discovery local installations of the Wolfram Language and Wolfram applications.

This crate provides:

  • The wolfram-app-discovery library, whose API can be used programmatically from Rust code.
  • The wolfram-app-discovery executable, which can be used from the command-line.

API Example

Locate the default Wolfram Language installation on this computer:

use wolfram_app_discovery::WolframApp;

let app = WolframApp::try_default()
    .expect("unable to locate any Wolfram applications");

// Prints a path like:
//   $InstallationDirectory: /Applications/Mathematica.app/Contents/
println!("$InstallationDirectory: {}", app.installation_directory().display());

Command-line Example

Locate the default Wolfram Language installation on this computer:

$ ./wolfram-app-discovery
Default Wolfram Language installation:

  Product:                     Mathematica
  Wolfram Language version:    13.0.0
  $InstallationDirectory:      /Applications/Wolfram/Mathematica-13.0.0.app/Contents

Configuration

The default method used to locate a Wolfram Language installation (WolframApp::try_default()) will use the following steps to attempt to locate any local installations, returning the first one found:

  1. The location specified by the WOLFRAM_APP_DIRECTORY environment variable, if set.
  2. If wolframscript is on PATH, use it to locate the system installation.
  3. Check in the operating system applications directory.

Configuration example

Specify a particular Wolfram Language installation to use (on macOS):

$ export WOLFRAM_APP_DIRECTORY="/Applications/Mathematica.app"

This environment variable is checked by both the wolfram-app-discovery library and command-line executable.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See CONTRIBUTING.md for more information.

Comments
  • problem locating wolfram installation on Linux

    problem locating wolfram installation on Linux

    Hi, the program has trouble locating Wolfram Language installation on Linux. Locating Wolfram application using wolfram_app_discovery::WolframApp leads to an error

    thread 'main' panicked at 'unable to locate any Wolfram applications: Error(UnsupportedPlatform { operation: "WolframApp::from_installation_directory()" })' 
    

    According to the section Configuration it should be sufficient to add the correct path to .bashrc, such as export WOLFRAM_APP_DIRECTORY="/usr/local/Wolfram/Mathematica/13.0/Executables/" this also leads to the error above.

    • Installing wolframscript does not fix the problem,
    • using Arch Linux, Mathematica 13.0, rustc 1.65.0, wolfram-app-discovery = "0.3.0"

    For more details, the result from RUST_BACKTRACE=1:

    thread 'main' panicked at 'unable to locate any Wolfram applications: Error(UnsupportedPlatform { operation: "WolframApp::from_app_directory()" })', src/main.rs:8:6
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/1.65.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /rustc/1.65.0/library/core/src/panicking.rs:142:14
       2: core::result::unwrap_failed
                 at /rustc/1.65.0/library/core/src/result.rs:1785:5
       3: core::result::Result<T,E>::expect
                 at /rustc/1.65.0/library/core/src/result.rs:1064:23
       4: tutorial::main
                 at ./src/main.rs:7:15
       5: core::ops::function::FnOnce::call_once
                 at /rustc/1.65.0/library/core/src/ops/function.rs:248:5
              
    

    Thanks for any advice on fixing this issue.

    bug 
    opened by strelda 6
  • feature: Improve application discovery and configuration options

    feature: Improve application discovery and configuration options

    This PR fleshes out and polishes the code for discovering Wolfram applications, makes wolfram-app-discovery work better as a cargo build script dependency, and documents the configuration variable (WOLFRAM_APP_DIRECTORY) that can be used to override the default search locations.

    opened by ConnorGray 1
  • bugfix: Silence spurious warnings generated on macOS when no instances of an app type exist

    bugfix: Silence spurious warnings generated on macOS when no instances of an app type exist

    Most users won't have e.g. Player Pro or Finance Platform platform installed. Printing a warning to the console about it doesn't add any value.

    Also fix a leaked CFError object.

    opened by ConnorGray 0
  • feature: Add Windows support for WolframApp::from_installation_directory()

    feature: Add Windows support for WolframApp::from_installation_directory()

    This is necessary for WolframApp::try_default()'s usage of wolframscript-based app discovery to work, which ends up calling from_installation_directory().

    • Add cross-platform test for that WolframApp::try_default() successfully locates an app. This test will not work in environments where no Wolfram apps are installed.
    opened by ConnorGray 0
  • feature: Sort apps returned by discover()

    feature: Sort apps returned by discover()

    The apps returned by discover() will now sorted by version number and feature set, with the newest and most featureful sorted to the beginning of the list.

    opened by ConnorGray 0
  • feature: Windows app discovery support

    feature: Windows app discovery support

    This pull requests adds support for app discovery on Windows.

    Like the macOS app discovery logic, the Windows discovery logic uses API's provided by the OS for discovering installed applications. For Windows, that means looking up product identifiers in the Windows registry.

    opened by ConnorGray 0
Releases(v0.4.0)
Owner
Wolfram Research, Inc.
Wolfram Research, Inc.
virtualization-rs provides the API of the Apple Virtualization.framework in Rust language.

virtualization-rs Rust bindings for Virtualization.framework virtualization-rs provides the API of the Apple Virtualization.framework in Rust language

suzu 44 Dec 31, 2022
A dead simple configuration language.

Rakh! A dead simple configuration language. No seriously, it's simple. With only 26 lines of code, it's one of the tiniest configuration languages the

yushie 3 Apr 17, 2022
Creating a simple flappy bird game in Rust language

Creating a simple flappy bird game in Rust language The main goal of this project is to get my hands dirty with rust, while creating something fun. Ex

Sajidur Rahman 1 Feb 10, 2022
CLI game to see how fast you can guess the language of a code block!

Guess That Lang! CLI game to see how fast you can guess the language of a code block! If you like the game, please consider giving a ⭐ ! Code is retri

null 152 Dec 27, 2022
Vel: A language for verified low-level software

Vel A language for verified low-level software. It dreams to be something like Rust with logic ― a language that empowers people to build verified low

Higher-Order Program Verification 9 Jan 26, 2023
A 3D modeling and rendering programming language utilizing SDFs.

ForgedThoughts is a modeling and rendering programming language utilizing SDFs and is in early development. For documentation and examples see the Web

Markus Moenig 4 Feb 27, 2023
Rust-based command-line language-learning game. Uses the Tatoeba database.

minicloze A command-line language learning game using Tatoeba's great database. Accelerate your studies by putting your knowledge to the test in an ad

benman 3 Mar 5, 2023
A programming language designed for the DiamondFire Minecraft server.

Blackstone Blackstone is a programming language designed to help create plots on the MCDiamondFire Minecraft server. Community Links Discord: https://

Blackstone 5 May 1, 2023
McShell - A programming language compiles to Minecraft mcfunction files

MCSH MCSH语言是一个语法类似Rust的编译型编程语言,其编译目标是mcfunction文件,以在Minecraft中运行。 MCSH有内存条,可实现函数递归操作。 MCSH 编译 使用 CLI 在虚拟仿真运行 编译 语法 标准库 编译 您需要先安装Rust 然后在您的控制台运行 git cl

FancyFlame 4 Feb 19, 2024
Safe, efficient, and ergonomic bindings to Wolfram LibraryLink and the Wolfram Language

wolfram-library-link Bindings to the Wolfram LibraryLink interface, making it possible to call Rust code from the Wolfram Language. This library is us

Wolfram Research, Inc. 28 Dec 6, 2022
idf-env tool helps set up and manage ESP-IDF installations

idf-env Tool for maintaining ESP-IDF environment. Quick start Install serial drivers for ESP boards on Windows. Execute following command in PowerShel

Espressif Systems 19 Dec 4, 2022
Representing Wolfram Language expressions in Rust.

wolfram-expr Representation of Wolfram Language expressions. Examples Construct the expression {1, 2, 3}: use wolfram_expr::{Expr, Symbol}; let expr

Wolfram Research, Inc. 7 Aug 18, 2022
Locate Args and Execute

Lax An argument substitution utility intended to make working on projects with deeply nested directories a bit easier. "Lax" stands for "Locate Args a

Dagan Martinez 18 Apr 2, 2022
🕵️‍♀️ Find, locate, and query files for ops and security experts ⚡️⚡️⚡️

Recon Find, locate, and query files for ops and security experts Key Features • How To Use • Download • Contributing • License Key Features Query with

Rusty Ferris Club 11 Dec 16, 2022
Rust bindings to the Wolfram Symbolic Transport Protocol (WSTP)

wstp Bindings to the Wolfram Symbolic Transfer Protocol (WSTP) library. This crate provides a set of safe and ergonomic bindings to the WSTP library,

Wolfram Research, Inc. 10 Nov 1, 2022
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

SteveLau 11 Aug 17, 2022
Plugin for macro-, mini-quad (quads) to save data in simple local storage using Web Storage API in WASM and local file on a native platforms.

quad-storage This is the crate to save data in persistent local storage in miniquad/macroquad environment. In WASM the data persists even if tab or br

ilya sheprut 9 Jan 4, 2023
Local blockchain for Free TON DApp development and testing.

TON OS Startup Edition Local blockchain for Free TON DApp development and testing. Have a question? Get quick help in our channel: TON OS Startup Edit

TON Labs 35 Jan 2, 2023
An Ethereum 2.0 Emulator for Local Testing of Eth2 Applications

Mousse is an Ethereum 2.0 emulator for local testing of Eth2 applications (mainly Rollups). HTTP Server The REST API definition can be found in the ht

Mousse 46 Sep 10, 2022
A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address.

innisfree A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address. Why? Most of the data I maintain is local,

Conor Schaefer 7 Mar 19, 2022