Build your own McStas or McXtrace via conda‐forge - mccode-dev/McCode GitHub Wiki
Linux / macOS
Preparation
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/
Bootstrap conda development environment
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 for McStas, use --help for McXtrace settings)
Create the environment: micromamba create -f mcstas-dev.yml
Activate the environment: micromamba activate mcstas-dev
Build McStas
Use the in-repo python script to build McStas from your current checkout: python ./devel/bin/mccode-build-conda(Defaults are for McStas, use --help for McXtrace settings)
Windows 10 and later
Preparation
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 2019 and later build tools for x64/x86
Enable "Developer Mode" in Windows:
Start cmd.exe and get a conda system (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 git and python:micromamba activate base followed by micromamba install git python
Bootstrap conda development environment
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 for McStas, use --help for McXtrace settings)
Create and activate the environment:micromamba create -f mcstas-dev.yml followed by micromamba activate mcstas-dev
Build McStas
Use the in-repo python script to build McStas from your current checkout: python .\devel\bin\mccode-build-conda(Defaults are for McStas, use --help for McXtrace settings)