From 8a87bd9f733355e8490f8e799e799b44110e9228 Mon Sep 17 00:00:00 2001 From: Stuart Berg Date: Tue, 16 Jun 2015 11:02:53 -0400 Subject: [PATCH] readme: Added troubleshooting hints for gdb. --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6245458..4f50036 100644 --- a/README.md +++ b/README.md @@ -278,13 +278,26 @@ If the easy_install works, it is recommended to create a separate .cmake file si ## Troubleshooting -It's a good idea to have a clean environment and "source" in environment variables as needed. If you get errors during builds, examine your environment variables and make sure there aren't conflicts with already installed components that have higher priority. Generally, we recommend minimal PATH, LD_LIBRARY_PATH, and PYTHONPATH environment variables. +It's a good idea to have a clean environment and "source" in environment variables as needed. If you get errors during builds, examine your environment variables and make sure there aren't conflicts with already installed components that have higher priority. Generally, we recommend minimal `PATH`, `LD_LIBRARY_PATH`, and `PYTHONPATH` environment variables. Some original source repositories or tarballs require https, which may be a problem for operating systems like Scientific Linux due to absent certificates. This issue can be sidestepped by using default non-https downloads, e.g., all downloads from janelia-flyem cache. Common build problems for individual components in the FlyEM Build System are documented in each component's CMake file. If you see an error, check that file's comments. For example, cpu throttling is a common build issue when building Atlas from source, and in the atlas.cmake file, we have documented how to turn off cpu frequency adjustments that defeat Atlas tuning. +## Using `gdb` + +When your BuildEM directory includes the `python` package, activating your BuildEM environment will prevent +non-BuildEM binaries (such as `gdb`) from correctly loading the system's version of `libpython.so`. +On Linux, this issue can be resolved via the `LD_PRELOAD` environment variable. +Here's an example command-line for using `gdb`: + +```bash +LD_PRELOAD=/lib64/libpython2.7.so gdb -ex 'set environ LD_PRELOAD' --args my-program-to-debug +``` + +**Hint:** To find the location of the correct `libpython2.7.so` file, open a fresh terminal (no BuildEM environment), and inspect the output of `ldd $(which gdb) | grep libpython`. + ## Roadmap This build system could be improved in a number of ways, not all of which adhere to the goal of a simple, easily-specified build process.