Build your own McStas or McXtrace via conda‐forge - mccode-dev/McCode GitHub Wiki

Linux / macOS

Preparation

  1. Get yourself a conda-environment, we recommend micromamba: "${SHELL}" <(curl -L micro.mamba.pm/install.sh)
  2. Clone the McCode repo (or your personal fork of it): git clone https://github.com/mccode-dev/McCode/

Bootstrap conda development environment

  1. 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)
  2. Create the environment: micromamba create -f mcstas-dev.yml (For some conda variants you may need conda env create...)
  3. Activate the environment: micromamba activate mcstas-dev

Build McStas

  1. 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

  1. Use the McCode MSVC injector script install_msvc_for_conda.bat for setting up Visual Studio. (If installing fails, you may try manually using this local guide)
  2. Enable "Developer Mode" in Windows:
  3. 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
  4. 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)
  5. Activate the base environment and install git and python:micromamba activate base followed by micromamba install git python

Bootstrap conda development environment

  1. 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
  2. Change directory to the git clone cd McCode
  3. 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)
  4. Create and activate the environment:micromamba create -f mcstas-dev.yml followed by micromamba activate mcstas-dev (For some conda variants you may need conda env create...)

Build McStas

  1. 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)