diff --git a/README.md b/README.md index 116ab46b67451e76058015678d259eadf08b5803..34acc8fb54a67d89d9b169c17687321f9c848800 100644 --- a/README.md +++ b/README.md @@ -75,18 +75,58 @@ patch -p1 $OLDPWD/jetToolbox_120X.patch 5. Clone the `Tables` wherever you like and the `Core` in CMSSW, and compile as usual with `scram b -j`. --> -## Setting up the environment +### With `micromamba` -First source the minimal environment with `source ./setup`, then `source ./tools/setup.sh`. +Follow this method to install the software on your private machine: +1. If `micromamba` is not yet available on your machine, you should install it: +``` +"${SHELL}" <(curl -L micro.mamba.pm/install.sh) +``` +2. Then create a new environment with all prerequisites: +``` +micromamba create -f prerequisites.yml -n DAS -y +micromamba activate DAS +``` +where `DAS` is here just a name, which you can adapt to anything. +3. Run the installation: +``` +./install.sh +``` +3. After a few minutes, you get back to the prompt. You only have to set up the newly compiled environment: +``` +source tools/setup.sh +``` + +## Loading the environment in a new session -To run CRAB jobs, you will also need to set up a valid [grid certificate](https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookStartingGrid#ObtainingCert). If you already have done so, this will enable it: +In both cases, first go to the root directory of `DasAnalysisSystem`. + +### In a LCG environment + +Just run the following: +``` +source ./setup +source ./tools/setup.sh +``` + +To run CRAB jobs (only in a LCG environment), you will also need to set up a valid [grid certificate](https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookStartingGrid#ObtainingCert). If you already have done so, this will enable it: ``` voms-proxy-init --rfc --voms cms -valid 192:00 ``` -To make [RUCIO](https://twiki.cern.ch/twiki/bin/viewauth/CMS/Rucio) requests, the `setup` file tried to guess your RUCIO username from your local username (unless was already set up). This is not guaranteed to work and you may have to define your RUCIO username ahead for sourcing the DAS environment. +To make [RUCIO](https://twiki.cern.ch/twiki/bin/viewauth/CMS/Rucio) requests (only for LCG environment), the `setup` file tried to guess your RUCIO username from your local username (unless was already set up). This is not guaranteed to work and you may have to define your RUCIO username ahead for sourcing the DAS environment. + +### With micromamba + +Just run the following: +``` +micromamba activate DAS +source tools/setup.sh +``` + +## Contributing -### Contributing +### Applying local changes If you modify part of the source code of a module (e.g. `Core`), you can recompile it as follows: ``` @@ -110,7 +150,7 @@ make install ``` (analog to `cd $CMSSW_BASE/src/Core/JEC; scram b`.) -Whenever developing, it is perfectly fine to only compile subsets of the code to speed up the whole process. Instead, whenever running over large samples, it is advised to commit and to rerun the whole `Core` to ensure compatibility and reproducibility of the resulsts. +Whenever developing, it is perfectly fine to only compile subsets of the code to speed up the whole process. Instead, whenever running over large samples, it is advised to commit and to rerun the whole `Core` to ensure compatibility and reproducibility of the results. ### Updating a module @@ -123,7 +163,7 @@ cmake --build $DAS_BASE/build --target install ``` In case of local changes, you should first commit them, or use `git stash` to pause the changes temporarily (after the update, it will be sufficient to run `git stash pop` to recover your changes). -### Good practices +## Good practices Fight against the increase of entropy by - pulling regularly, diff --git a/setup.sh.in b/setup.sh.in index 7d148e02990a9577e8b3adfcc81973d6a2eaa6a1..b16bd6eee36355652197c8339dc380c53dc8e8e1 100644 --- a/setup.sh.in +++ b/setup.sh.in @@ -1,6 +1,6 @@ # Technically needed export PATH=@CMAKE_INSTALL_FULL_BINDIR@:$PATH -export LD_LIBRARY_PATH=@CMAKE_INSTALL_FULL_LIBDIR@:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=@CMAKE_INSTALL_FULL_LIBDIR@:$(correction config --libdir):$LD_LIBRARY_PATH export PYTHONPATH=@CMAKE_INSTALL_PREFIX@/python:$PYTHONPATH export DARWIN_FIRE_AND_FORGET=@CMAKE_INSTALL_FULL_LIBDIR@ # TODO use ldd or link statically