diff --git a/docs/references/electronics-guide.md b/docs/references/electronics-guide.md index 74430da93a9d72c06bf6892e55ea12653e8b5eb1..25b359730fad8d41f6c8e56bda8b81b7a3baf6be 100644 --- a/docs/references/electronics-guide.md +++ b/docs/references/electronics-guide.md @@ -1,4 +1,4 @@ -# Eletronics guide +# Electronics guide ## How to Use This Guide @@ -1394,347 +1394,6 @@ BIAS_SD_I_BFCAS 255 [Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) -## Building GEM Software --------------------- -Building CMS GEM Online software is *only* supported on GEM DAQ 904 machines. -Please note that you need to set the `BUILD_HOME` environment variable before building. Set this to be the folder in which you git clone `cmsgemos`. For example using bash: `export BUILD_HOME=~/Path/To/Folder`. - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### GEM RPM Location on 904 NAS --------------------- - -If you are an authorized rpm builder you can place your compiled RPM's on the following location on the 904 NAS: - -``` -/data/bigdisk/sw/gemonlinesw/repos/centos7_x86_64/ -``` - -Additionally if your a sysadmin you can find compiled RPM's at this location - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### Build Prerequisites: The gembuild repo - -For *all* repositories *except* `cmsgemos` you'll need to get the `config/` directory from the `gembuild` repository. To do this once you've cloned the repository of interest execute: - -```bash -cd <repo folder> -git submodule init -git submodule update -``` - -periodically the `gembuild` repository may change and you may need to update the `config` folder in your local versions, to do this execute: - -```bash -cd <repo folder> -git submodule update -``` - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### `cmsgemos` - -#### Compiling the entire framework - -To do a complete compile execute: - -```bash -cd cmsgemos -source setup/etc/profile.d/gemdaqenv.sh -git tag <tag number> -make clean -j8 && make cleanrpm -j8 -make debug -j8 -make rpm -``` - -For each subpackage you will find both a `*.rpm` and a `*.tgz` file inside an `rpm/` subdirectory inside the subdirectory. For example for `gempython` you'll find under `cmsgemos/gempython/rpm` many files, but the most recent versions of the following files: - -```bash --rw-r--r--. 1 user group 49K Sep 19 11:18 cmsgemos_gempython-*.tgz --rw-r--r--. 1 user group 2.1K Sep 19 11:18 cmsgemos_gempython-debuginfo-*.cc7.python2.7.x86_64.rpm --rw-r--r--. 1 user group 106K Sep 19 11:18 cmsgemos_gempython-*.cc7.python2.7.x86_64.rpm -``` - -will be of interest to you. The wildcard `*` will have the information on the tag number (for the `*.tgz file) and tag number plus git commit (for `*.rpm` files). - -The `*.rpm` file can be installed on a DAQ machine, or upgrade an existing installed version (assuming the tag number is higher than the existing installed version), with `yum` and in the case of `gempython` a `*.tgz` file which can be installed into a python `virtualenv` with `pip`. - -If you are generating an installable `rpm` for a DAQ machine it's best to check with `GEM RC` what tag should be used. - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -#### Compiling Only `gempython` - -In many cases you will be interested in only compiling `gempython` to do this execute: - -```bash -cd cmsgemos -source setup/etc/profile.d/gemdaqenv.sh -git tag <tag number> -make clean -make gempython -cd gempython -make rpm -``` - -If you are generating an installable `rpm` for a DAQ machine it's best to check with `GEM RC` what tag should be used. - -If you are not interested in generating the `rpm` you can substitute `make pip` for the last line. To install this into your `virtualenv` after activating your `venv` execute: - -```bash -pip install cmsgemos/gempython/rpm/cmsgemos_gempython-<version>.tgz --no-deps -``` - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -#### Configuring your `$ENV` for testing - -It's important to keep in mind `cmsgemos` has several dependencies which you may be required to set by hand. If you are looking to test changes to only `cmsgemos` or some SW package "downstream" of cmsgemos (e.g. `vfatqc-python-scripts`) then you may use the system installed dependencies. If you have already configured your `virtualenv` with the installed packages then you can either setup the `$ENV` by hand, or you can use the [setup_gemdaq.sh](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/scripts/setup_gemdaq.sh) script via: - -```bash -cd <your working directory> -source setup_gemdaq.sh -``` - -Note if this is your first time calling `setup_gemdaq.sh` please first call the help menu to see how to setup a `virtualenv` using this script. An example is presently provided [here](https://github.com/cms-gem-daq-project/gem-plotting-tools#setup); in this example a `python` `virtualenv` will be setup and the `cmsgemos_gempython` and `gempython_gemplotting` packages will be installed inside of it. - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### `ctp7_modoules` - -Execute: - -```bash -export LD_LIBRARY_PATH=/opt/xdaq/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/opt/wiscrpcsvc/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/opt/rwreg/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/opt/xhal/lib:$LD_LIBRARY_PATH -export PETA_STAGE=/data/bigdisk/sw/peta-stage/ -source /data/bigdisk/sw/Xilinx/SDK/2016.2/settings64.sh -export XHAL_ROOT=$BUILD_HOME/xhal/ -cd ctp7_modules/ -make clean && make rpm -``` - -You will create `*.rpm` files in the following subdirectories: - -``` -ctp7_modules/rpm -``` - -This will also compile the shared object libraries (e.g. `rpcmodules`) under the subdirectory: - -``` -ctp7_modules/lib -``` - -These `*.so` files can be uploaded to the `CTP7` by the test stand sysadmin (for production test stands) or developers (for development test stands). - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### `gem-plotting-tools` - -Execute the following: - -```bash -cd gem-plotting-tools -git tag <tag number> -make clean && make rpm -``` - -this will generate the following files: - -```bash -% ll gem-plotting-tools/rpm --rw-r--r--. 1 user group 226K Mar 12 13:55 gempython_gemplotting-*.tgz --rw-r--r--. 1 user group 308K Mar 12 13:55 gempython_gemplotting-*.src.rpm --rw-r--r--. 1 user group 320K Mar 12 13:55 gempython_gemplotting-*.noarch.rpm -``` - -The wildcard `*` will have the information on the tag number (for the `*.tgz` file) and tag number plus git commit (for `*.rpm` files). The `rpm` can be used to install the `gemplotting` package onto your DAQ machine or upgrade an existing version (assuming the tag number is higher than the existing version). The `*.tgz` file can be used to install the `gemplotting` package into your `virtualenv` by executing: - -```bash -pip install -U gem-plotting-tools/rpm/gempython_gemplotting-<tag number>.tgz -``` - -Note it is assumed you've already activated your `virtualenv` - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### `vfatqc-python-scripts` - -Execute the following: - -```bash -cd vfatqc-python-scripts -git tag <tag number> -make clean && make rpm -``` - -Note branches deriving from `rpc-playground` presently require their tag to be set manually in `vfatqc-python-scripts/Makefile` and are not correctly picked up from the `git` tag number, look for lines: - -``` -VFATQC_VER_MAJOR=X -VFATQC_VER_MINOR=Y -VFATQC_VER_PATCH=Z -``` - -this will generate the following files: - -```bash -% ll vfatqc-python-scripts/rpm --rw-r--r--. 1 user group 42K Sep 19 11:56 gempython_vfatqc-*.tar.gz --rw-r--r--. 1 user group 1.9K Sep 19 11:56 gempython_vfatqc-debuginfo-*centos7.python2.7.x86_64.rpm --rw-r--r--. 1 user group 89K Sep 19 11:56 gempython_vfatqc-*centos7.python2.7.x86_64.rpm -``` - -The wildcard `*` will have the information on the tag number (for the `*.tar.gz` or `*.tgz` file) and tag number plus git commit (for `*.rpm` files). The `rpm` can be used to install the `vfatqc` package onto your DAQ machine or upgrade an existing version (assuming the tag number is higher than the existing version). The `*.tar.gz` or `*.tgz` file (you may only see one depending on which branch you are developing from, `develop` or `rpc-playground`) can be used to install the `vfatqc` package into your `virtualenv` by executing: - -```bash -pip install -U vfatqc-python-scripts/rpm/gempython_vfatqc-<tag number>.tar.gz -``` - -Note it is assumed you've already activated your `virtualenv` - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -### `xhal` - -#### Post-Packing Instructions - -To set the computing environment execute: - -```bash -export PETA_STAGE=/data/bigdisk/sw/peta-stage -source /data/bigdisk/sw/Xilinx/SDK/2016.2/settings64.sh -source /opt/rh/devtoolset-6/enable -``` - -[Top](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#table-of-contents) - -##### Compiling the entire libary - -It is assumed you have setup the computing environment, the execute the following: - -```bash -cd xhal -git tag <tag number> -make clean && make rpm -``` - -If you are generating an installable `rpm` for a DAQ machine it's best to check with `GEM RC` what tag should be used. - -This will create `*.rpm`, and in some cases `*.tgz`, files in the following sub-directories: - -```bash -xhal/python/reg_interface_gem/rpm -xhal/xhalarm/rpm -xhal/xhalcore/rpm -``` - -It will also place a set of `*.so` libraries under: - -```bash -xhal/xhalarm/lib -xhal/xhalcore/lib -``` - -Typically you will not be interested in files under `xhal/xhalarm` unless you are also responsible for maintaining your test stand's backend electronics (e.g. `CTP7`, `GLIB` or other `AMC`). - -##### Compiling only the python tools - -It is assumed you have setup the computing environment. To compile only the python tools execute: - -```bash -cd xhal/python -git tag <tag number> -make clean && make rpm -``` - -This will generate the following files: - -```bash -% ll xhal/python/reg_interface_gem/rpm --rw-r--r--. 1 user group 19K Sep 17 15:02 reg_interface_gem-*.centos7.python2.7.noarch.rpm --rw-r--r--. 1 user group 7.7K Sep 17 15:02 reg_interface_gem-*.tgz --rw-r--r--. 1 user group 20K Sep 17 15:02 reg_interface_gem-*.peta_linux.python2.7.noarch.rpm -``` - -The wildcard `*` will have the information on the tag number (for the `*.tgz file) and tag number plus git commit (for `*.rpm` files). - -The `peta_linux` file is an `rpm` designed to be installed on the back-end card's linux image (e.g. `CTP7`). The `*.tgz` file is a python package which can be installed into a `virtualenv` via: - -```bash -pip install -I xhal/python/reg_interface_gem/rpm/reg_interface_gem-<tag number>.tgz -``` - -and the `centos7` `rpm` can be used to install the `reg_interface_gem` package onto your DAQ machine or upgrade an existing version (assuming the tag number is higher than the existing version). Note that `reg_interface_gem` `rpm` requires the `reg_interface` package from the `reg_utils` repository. - -Note it is assumed in the `pip install` command shown above that you have already activated your python `virtualenv`. - -##### Compiling only the DAQ Machine C++ libraries - -It is assumed you have setup the computing environment. To compile only the C++ libraries execute: - -```bash -cd xhal/xhalcore -git tag <tag number> -make clean && make rpm -``` - -This will generate the following files: - -```bash -% ll xhal/xhalcore/lib --rwxr-xr-x. 1 user group 1.1M Sep 19 10:50 libxhal.so --rwxr-xr-x. 1 user group 615K Sep 19 15:48 librpcman.so -% ll xhal/xhalcore/rpm --rw-r--r--. 1 user group 11K Sep 19 15:48 xhal-devel-*.centos7.gcc6_3_1.x86_64.rpm --rw-r--r--. 1 user group 2.3M Sep 19 15:48 xhal-*.centos7.gcc6_3_1.x86_64.rpm -``` - -The wildcard `*` will have the information on the tag number (for the `*.tgz file) and tag number plus git commit (for `*.rpm` files). - -The `rpm` file can be installed onto your DAQ machine via `yum` or upgrade an existing installed package (assuming the tag number is higher than the existing version). - -If you are performing local tests to changes made to `XHAL` you need to ensure your `LD_LIBRARY_PATH` includes the `xhal/xhalcore/lib` directory (and no other directory that would include the libraries shown, e.g. a system directory under `/opt/xhal/lib`). You can add the `XHAL` libraries to your `LD_LIBRARY_PATH` by executing: - -```bash -cd xhal/xhalcore/lib -export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH -``` - -Note this only appends `LD_LIBRARY_PATH` it does *not* remove a pre-existing path (e.g. `/opt/xhal/lib`) from `LD_LIBRARY_PATH` to do this execute: - -```bash -echo $LD_LIBRARY_PATH -``` - -Copy the output of that `echo` commad and remove `/opt/xhal/lib` from the text and then set it to: - -```bash -export LD_LIBRARY_PATH=<text from echo command> -cd xhal/xhalcore/lib -export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH -``` - -#### Legacy Pre-Packaging Instructions for Tag 3.2.2 - -Note the shell variable `BUILD_HOME` is expected to exist and be the top level directory in the area where all your SW repositories are checked out and built from. - -```bash -cd $BUILD_HOME -git clone https://github.com/cms-gem-daq-project/xhal.git -cd $BUILD_HOME/xhal -export LD_LIBRARY_PATH=/opt/xdaq/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/opt/wiscrpcsvc/lib:$LD_LIBRARY_PATH -git checkout tags/3.2.2 -cd xhal -source setup.sh -python .github/get_binaries.py -t 3.2.2 -l .github/uploads.cfg -``` - ## Common Slow Control Actions -------------------- ### Checking Firmware Version