diff --git a/doc/Add-Packages-Complex-Install.md b/doc/Add-Packages-Complex-Install.md index 9ac3653..7bef7c6 100644 --- a/doc/Add-Packages-Complex-Install.md +++ b/doc/Add-Packages-Complex-Install.md @@ -51,7 +51,7 @@ export CPLUS_INCLUDE_PATH="$(python -c "import galsim, os; print(os.path.join(os python3 -m pip install --user --no-build-isolation . ``` -## Persist for Jupyter +## NERSC Jupyter To use this new installation of BATSim in jupyter.nersc.gov, add this to `$HOME/.bashrc`: diff --git a/doc/Installing-Your-Own-Env.md b/doc/Installing-Your-Own-Env.md new file mode 100644 index 0000000..6f8e45e --- /dev/null +++ b/doc/Installing-Your-Own-Env.md @@ -0,0 +1,60 @@ +# Installing your own copy of desc-python + +Using [conda-lock](https://github.com/conda/conda-lock) you can quickly and easily install your own copy of most DESC conda environments where lock files are available. + +## At NERSC + +`conda-lock` is available for all DESC members at NERSC, just add `$CFS/lsst/utilities/bin`to your PATH + +`export PATH=$CFS/lsst/utilities/bin:$PATH` + +In this example we will install a copy of `desc-python`. + +git clone https://github.com/LSSTDESC/desc-python.git` + +To use the current production version of `desc-python`, let us assume $curBuildDir points to your desired installation directory + +```bash +cp desc-python/conda/sitecustomize.py $curBuildDir +cp desc-python/conda/desc-py-lock.yml $curBuildDir +cp desc-python/conda/pip.config $curBuildDir +cd $curBuildDir + +module unload python +module unload cray-libsci +module load cray-mpich-abi/8.1.30 +export CONDA_PKGS_DIRS=$curBuildDir/pkgs + +# use your own copy of Miniforge or you could use NERSC's python module +url="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" +curl -LO "$url" + +bash ./Miniforge3-Linux-x86_64.sh -b -p $curBuildDir/py +source $curBuildDir/py/etc/profile.d/conda.sh +conda activate base + +export PIP_CONFIG_FILE=$curBuildDir/pip.config + +conda-lock install --mamba -n my-desc-python $curBuildDir/desc-py-lock.yml + +conda activate my-desc-python + +conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library +cd ${CONDA_PREFIX} +source ${CONDA_PREFIX}/bin/cosmosis-configure +cosmosis-build-standard-library main +``` + +And that's it! + +#### To use your my-desc-python environment + +```bash +module unload python +module unload cray-libsci +module load cray-mpich-abi/8.1.30 +source $curBuildDir/bin/activate +conda activate my-desc-python +``` + +