Skip to content

Commit

Permalink
put questions into question block
Browse files Browse the repository at this point in the history
make the blocks collapsible as well so readers only have to read the
stuff they want the answers to
  • Loading branch information
tomeichlersmith committed Dec 29, 2023
1 parent 4422e85 commit c905e14
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions src/faq.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# What the F.A.Q.?
Frequent issues and potholes that new collaborators run into while starting their work with LDMX software.

### Running ROOT Macros from the Command Line
~~~admonish question collapsible=true title="Running ROOT Macros from the Command Line"
ROOT uses shell-reserved characters in order to mark command line arguments as specific inputs to the function it is parsing and running as a macro.
This makes passing these arguments through our shell infrastructure difficult and one needs a hack to get around this.
Outside of the container, one might execute a ROOT macro like
Expand All @@ -15,18 +15,19 @@ ldmx root <<EOF
EOF
```
The context for this can be found on [GitHub Issue #1169](https://github.com/LDMX-Software/ldmx-sw/issues/1169).
~~~

### Installing on SDF: No space left on the device

~~~admonish question collapsible=true title="Installing on SDF: No space left on the device"
On SLAC SDF we will be using singularity which is already installed.
This is a frustrating interaction between SDF's filesystem design and singularity. Long story short, singularity needs O(5GB) of disk space for intermediate files while it is downloading and building container images and by default it uses /tmp/ to do that. /tmp/ on SDF is highly restricted. The solution is to set a few environment variables to tell singularity where to write its intermediate files.
```
export SINGULARITY_CACHEDIR=/scratch/$USER/.singularity
export TMPDIR=/scratch/$USER
```
The ldmx-env.sh script is able to iterface with both docker and singularity so you should be able to use it after resolving this disk space issue.
~~~

### How do I update the version of the container I am using?
~~~admonish question collapsible=true title="How do I update the version of the container I am using?"
We've added this command to the `ldmx` command line program.
In general, it is safe to just update to the latest version.
```
Expand All @@ -35,8 +36,9 @@ ldmx pull dev latest
This explicitly pulls the latest version no matter what,
so it will download the image even if it is the same as
one already on your computer.
~~~

### My display isn't working when using Windoze and WSL!
~~~admonish question collapsible=true title="My display isn't working when using Windoze and WSL!"
You probably are seeing an error that looks like:
Expand All @@ -51,8 +53,9 @@ The solution to this is two-fold.
1. Install an X11-server on Windoze (_outside_ WSL) so that the display programs inside WSL have something to send their information to. [X410](https://x410.dev/) is a common one, but there are many options.
2. Make sure your environment script (`scripts/ldmx-env.sh`) has updates to the environment allowing you to connect directly to the server. These updates are on [PR #997](https://github.com/LDMX-Software/ldmx-sw/pull/997) and could be manually copied if you aren't yet comfortable with `git`.
~~~

### Is it okay for me to use tools outside the container? I have been informed to only use the container when working on LDMX.
~~~admonish question collapsible=true title="Is it okay for me to use tools outside the container? I have been informed to only use the container when working on LDMX."
The container is focused on being a well-defined and well-tested environment for ldmx-sw, but it may not be able to accomodate every aspect of your workflow. For example, my specific workflow can be outlined with the following commands (not a tutorial, just an outline for explanatory purposes):
```
Expand Down Expand Up @@ -83,15 +86,18 @@ python analysis.py sim_output.root #this analysis uses the local ROOT install an
```
*Conclusion:* The absolutely general protocol still uses an installation of ROOT that is outside of the container. You do not need installations of the other ldmx-sw dependencies and your installation of ROOT does not need to match the one inside of the container.
~~~

### On macOS, I get a "invalid developer path" error when trying to use `git`.
~~~admonish question collapsible=true title="On macOS, I get a 'invalid developer path' error when trying to use `git`."
On recent versions of the mac operating system, you need to re-install command line tools.
[This stackexchange question](https://stackoverflow.com/questions/58280652/git-doesnt-work-on-macos-catalina-xcrun-error-invalid-active-developer-path) outlines a simple solution.
~~~

### On macOS, I get a failure when I try to run the docker containers.
~~~admonish question collapsible=true title="On macOS, I get a failure when I try to run the docker containers."
The default terminal on macOS is `tcsh`, but the environment setup script assumes that you are using `bash`. You should look at [this article](https://www.howtogeek.com/444596/how-to-change-the-default-shell-to-bash-in-macos-catalina/) for how to change your default shell to `bash` so that the ldmx environment script works.
~~~

### On macOS, I get a error when trying to use tab completion.
~~~admonish question collapsible=true title="On macOS, I get a error when trying to use tab completion."
This error looks like
```
ldmx <tab>-bash: compopt: command not found
Expand Down Expand Up @@ -119,8 +125,9 @@ chsh -s /usr/local/bin/bash $USER
You can double check your current shell's bash version by running `echo $BASH_VERSION`.
This answer was based on a helpful [stackexchange answer](https://apple.stackexchange.com/questions/224511/how-to-use-bash-as-default-shell).
~~~

### I can't compile and I get a "No such file or directory" error.
~~~admonish question collapsible=true title="I can't compile and I get a 'No such file or directory' error."
LDMX software is broken up into several different `git` repositories that are then pulled into a central repository _ldmx-sw_ as "submodules".
In order for you to get the code in the submodules, you need to tell `git` that you want it. There are two simple ways to do this.
1. You can re-clone the repository, but this time using the `--recursive` flag.
Expand All @@ -131,8 +138,9 @@ git clone --recursive https://github.com/LDMX-Software/Framework.git
```bash
git submodule update --init --recursive
```
~~~

### Software complains about not being able to create a processor. (UnableToCreate)
~~~admonish question collapsible=true title="Software complains about not being able to create a processor. (UnableToCreate)"
This is almost always due to the library that contains that processor not being loaded.
We are trying to have the libraries automatically included by the python templates,
but if you have found a python template that doesn't include the library you can do the following in the meantime.
Expand All @@ -142,8 +150,9 @@ but if you have found a python template that doesn't include the library you can
p.libraries.append( 'libMODULE.so' )
# MODULE is the module that your processor is in (for example: Ecal, EventProc, or Analysis)
```
~~~

### Software complains about linking a library. (LibraryLoadFailure)
~~~admonish question collapsible=true title="Software complains about linking a library. (LibraryLoadFailure)"
Most of the time, this is caused by the library not being found in the common search paths.
In order to make sure that the library can be found, you should give the full path to it.
```
Expand All @@ -152,8 +161,9 @@ In order to make sure that the library can be found, you should give the full pa
p.libraries.append( '<full-path-to-ldmx-sw-install>/lib/libMODULE.so' )
# MODULE is the module that your processor is in (for example: Ecal, EventProc, or Analysis)
```
~~~

### ROOT version mismatch error.
~~~admonish question collapsible=true title="ROOT version mismatch error."
This error looks something like this:
```
Error in <TUnixSystem::Load>: version mismatch, <full-path>/ldmx-sw/install/lib/libEvent.so = 62000, ROOT = 62004
Expand All @@ -165,16 +175,19 @@ This makes sure that the dependencies never change.
If you need some dependency that isn't in your version of the container,
please file an [issue with the docker repository](https://github.com/LDMX-Software/docker/issues/new/choose) to request what's called a "derivative" container.
~~~

### Parameter 'className' does not exist in list of parameters.
~~~admonish question collapsible=true title="Parameter 'className' does not exist in list of parameters."
This error usually occurs when you pass an object that isn't an EventProcessor as an EventProcessor to the Process sequence.
A feature that is helpful for debugging your configuration file is the `Process.pause` function:
```
# at the end of your config.py
p.pause() #prints your Process configuration and waits for you to press enter before continuing
```
~~~

### ldmx-sw cannot find the contents of a file when I _know_ that the file exists
~~~admonish question collapsible=true title="ldmx-sw cannot find the contents of a file when I _know_ that the file exists"
Remember that you are running inside of the container, so the file you want to give to the software must be accessible by the container.
Some python features that are helpful for making sure the container can find your file are `os.path.fullpath` to get the full path to a file and
`os.path.isfile` to check that the file exists.
~~~

0 comments on commit c905e14

Please sign in to comment.