MUSICA - Multiscale Micromechanical Model for Granular Materials
- GitHub: https://github.com/hailin-wang/musica/
- Documentation (Python): https://hailin-wang.github.io/musica/
- Documentation (C++): https://hailin-wang.github.io/musica/dev/doxygen/
Install the package from pre-built wheels
Install GitHub CLI and Python 3.10+ first.
Download the latest pre-built wheels from GitHub releases and install them with pip (only if you have the access to
the hailin-wang/musica repository):
gh release download --pattern *.whl --pattern *.tar.gz --dir wheelhouse --clobber --repo hailin-wang/musica
pip install --find-links wheelhouse musica[all]
Build and install the package from source
Generate pybind11 binding sources
It is recommended to generate the pybind11 binding sources on Linux or Windows Subsystem for Linux (WSL) on Windows. Binder on Windows is not tested and may not work properly.
Install binder to generate the pybind11 binding sources:
Make sure that the binder executable is in the system PATH.
Type binder --help to see if the installation is successful.
Update the configuration file micromechanical/cpp/binder_config.txt
and micromechanical/cpp/binder-includes.hpp if necessary.
Generate the pybind11 binding sources with the following command in the micromechanical/cpp directory:
Reformat the generated pybind11 binding sources with (in the root directory):
Build and install the package
Please install one of the following C/C++ compilers (with C++ 17 support) to build the C++ extension:
- GNU GCC (tested on 13.3.0)
- LLVM Clang (tested on 18.1.3)
- Microsoft Visual C++ (MSVC) (tested on 19.44.35207.1)
Install the package from the source with pip:
# Install dependencies with pinned versions
pip install -r https://musica.hailin.wang/requirements.txt
pip install -e .[all]
or with pdm:
Generate the bindings stubs with:
Run tests
Run tests with pytest: