MUSICA Julia API#
The Julia API provides access to MUSICA functionality through the Musica.jl package, which uses CxxWrap.jl to interface with the underlying C++ library.
Installation#
Prerequisites#
Julia 1.10, 1.11
CMake 3.24 or later
A C++ compiler with C++20 support
Building from Source#
Clone and build MUSICA with Julia support:
git clone https://github.com/NCAR/musica.git
cd musica
cmake -S . -B build -D MUSICA_ENABLE_JULIA=ON -D CMAKE_BUILD_TYPE=Release
cmake --build build
Install the Julia package dependencies:
cd julia
julia --project=. -e 'using Pkg; Pkg.instantiate()'
Quick Start#
using Musica
# Get the MUSICA version
version = Musica.get_version()
println("MUSICA version: ", version)
API Reference#
Core Functions#
- get_version() String#
Returns the version string of the MUSICA library.
- Returns:
The MUSICA version as a string (e.g., “0.14.4”)
- Return type:
String
Example:
version = Musica.get_version() println("MUSICA version: ", version)
Testing#
To run the Julia test suite:
cd julia
julia --project=. test/runtests.jl