-
Notifications
You must be signed in to change notification settings - Fork 64
Build your own McStas or McXtrace via conda‐forge
Peter Willendrup edited this page Dec 10, 2025
·
4 revisions
- Get yourself a conda-environment, we recommend
micromamba:"${SHELL}" <(curl -L micro.mamba.pm/install.sh) - Clone the McCode repo (or your personal fork of it):
git clone https://github.com/McCode/
- Use the in-repo python script to create a YaML file including build- and runtime-dependencies:
python ./devel/bin/mccode-create-conda-yml -n mcstas-dev > mcstas-dev.yml
(Defaults are forMcStas, use --help forMcXtracesettings) - Create the environment:
micromamba create -f mcstas-dev.yml - Activate the environment:
micromamba activate mcstas-dev
- Use the in-repo python script to build
McStasfrom your current checkout:python ./devel/bin/mccode-build-conda
(Defaults are forMcStas, use --help forMcXtracesettings)
- Get Visual Studio (e.g. the Community edition) via the Windows store

and run the "Visual Studio Installer". - Within the installer, select and install "Desktop development with C++" and select
C++/CLI support,MSVC v142 - VS 2019and later build tools for x64/x86
- Enable "Developer Mode" in Windows:
- Start
cmd.exeand get acondasystem (we recommend using micromamba):curl -L -o micromamba.exe https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64 - Set up to initialise cmd.exe for micromamba:
micromamba.exe shell init --shell cmd.exe
(If prompted, our recommendation is to enable long path support) - Activate the base environment and install
gitandpython:micromamba activate basefollowed bymicromamba install git python
- Clone the McCode repo (or your personal fork of it), allowing symlink-creation in the process:
git clone -c core.symlinks=true https://github.com/mccode-dev/McCode - Change directory to the git clone
cd McCode - Use the in-repo python script to create a YaML file including build- and runtime-dependencies:
python .\devel\bin\mccode-create-conda-yml -n mcstas-dev > mcstas-dev.yml
(Defaults are forMcStas, use --help forMcXtracesettings) - Create and activate the environment:
micromamba create -f mcstas-dev.ymlfollowed bymicromamba activate mcstas-dev
- Use the in-repo python script to build
McStasfrom your current checkout:python .\devel\bin\mccode-build-conda
(Defaults are forMcStas, use --help forMcXtracesettings)