Installation#
Dependencies#
You should install the following tools yourself. Open the dropdowns for more details.
CUDA Toolkit (version 10.0 or later)
Windows: Download an installer from the CUDA website.
Linux: Use
sudo apt-get install nvidia-cuda-toolkit
, or download an installer.
Important
Make especially sure that everything CUDA-related (like nvcc
) can
be found inside your PATH. On Linux, for instance, this can be done
by editing your ~/.bashrc
file and adding the following lines:
# add CUDA
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/> lib64:$LD_LIBRARY_PATH"
The paths may differ if the CUDA Toolkit was installed in a different location.
👉 Check CUDA installation with: nvcc --version
A C++ compiler which supports C++17
- Linux:
sudo apt-get install gcc
⚠️ each CUDA version has a maximum supported
gcc
version. This StackOverflow answer lists the maximum supportedgcc
version for each CUDA version. If necessary, usesudo apt-get install gcc-<min_version>
instead, with the appropriate<min_version>
.
- Linux:
- Windows:
CUDA does not support the
gcc
compiler on Windows, so download and install Microsoft Visual Studio with the “Desktop development with C++” workload. After installing, check if the path tocl.exe
was added to yourPATH
environment variable (i.e., check whetherwhere cl.exe
returns an appropriate path likeC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64
). If not, add it manually.
👉 Check C installation with: gcc --version
on Linux and where.exe cl.exe
on Windows.
Git
Windows: Download and install.
Linux:
sudo apt install git
👉 Check Git installation with: git --version
CPython (version ≥ 3.8 recommended), pip and miniconda/anaconda
All these Python-related tools should be included in a standard installation of Anaconda or Miniconda.
👉 Check installation with python --version
, pip --version
and conda --version
.
Building mumax⁺#
First, clone the mumax⁺ Git repository. The --recursive
flag is used in the following command to get the pybind11 submodule, which is needed to build mumax⁺.
git clone --recursive https://github.com/mumax/plus.git mumaxplus
cd mumaxplus
We recommend to install mumax⁺ in a clean conda environment as follows. You could also skip this step and use your own conda environment instead if preferred.
Tools automatically installed in the conda environment
cmake 4.0.0
Python 3.13
pybind11 v2.13.6
NumPy
matplotlib
SciPy
Sphinx
conda env create -f environment.yml
conda activate mumaxplus
Finally, build and install mumax⁺ using pip.
pip install .
Tip
If changes are made to the code, then pip install -v .
can be used to rebuild mumax⁺, with the -v
flag enabling verbose debug information.
If you want to change only the Python code, without needing to reinstall after each change, pip install -ve .
can also be used.
Tip
The source code can also be compiled with double precision, by changing FP_PRECISION
in CMakeLists.txt
from SINGLE
to DOUBLE
before rebuilding.
add_definitions(-DFP_PRECISION=DOUBLE) # FP_PRECISION > should be SINGLE or DOUBLE
Troubleshooting
(Windows) If you encounter the error
No CUDA toolset found
, try copying the files inNVIDIA GPU Computing Toolkit/CUDA/<version>/extras/visual_studio_integration/MSBuildExtensions
toMicrosoft Visual Studio/<year>/<edition>/MSBuild/Microsoft/VC/<version>/BuildCustomizations
. See these instructions for more details.