Linux.hpp File Reference

Documentation on techniques regarding Linux (and Bash) which proved useful. More...

Go to the source code of this file.

Detailed Description

Documentation on techniques regarding Linux (and Bash) which proved useful.

Linux- and tools-related techniques

Here we collect techniques for solving problems we encountered at the level of the operating system (Linux) or of the shell (Bash) or of the buildtool (Make).

Some general Linux-techniques

  • Linker segmentation faults might indicate that a newer version of binutils needs to be installed (system-wide standard installation). For example installing binutils-2.19.1 solved a linker segmentation fault when using Boost.
  • Linker failures because of "some symbols can't be read" might be due to a incorrect build of the respective link-library, namely that on AMD64-platforms the compiler option "-fPIC" is required.
  • Runtime link-errors might result in segmentation faults, and might be caused by not providing the "biarch" gcc-versions (on 64-bit machines, providing 32-bit compatabilit mode).

Some general Bash-techniques

  • When encountering something like "make[1]: execvp: /bin/bash: Argument list too long":
    1. If there is a really big argument list involved, then this should be avoided.
    2. But likely you need to update your Linux version, since the OKlibrary build systems needs a fairly big environment store.
    3. Use
      > getconf ARG_MAX
      to see the space for the (arguments + environment)-store.
    4. The old standard value was 131072, which is not sufficient to perform everything with the OKlibrary.
    5. Newer Linux versions have 2097152, which is enough (also for further expansions).
  • File-renaming functionality:
    1. The mmv-package was useful, but is apparently not available for download anymore (in a maintained form).
    2. So we just use find (or just ls together with awk) together with sed (and a loop) for achieving the results.
    3. For example, for creating symbolic links for files with name-components "gcc43", "gcc34" by using just "gcc", use
      for F in $(ls | awk '/.*gcc[0-9][0-9].*/'); do
        ln - ${F} $(echo ${F} | sed 's/gcc[0-9][0-9]/gcc/'); done

Definition in file Linux.hpp.