Skip to content

Resolve "Easy switch for builds with debug info and production builds"

Renat Dusaev requested to merge 136-debug-build-support into master

Closes #136 (closed)

Changes:

  • ./build.sh now checks DEBUG_BUILD environment variable (e.g. $ DEBUG_BUILD=1 ./build.sh). If this variable is set to "1", CFLAGS and CXXFLAGS both get set to -g -ggdb -O0. Otherwise flags are set to -O3 -DNDEBUG=1.
  • changed slightly the DATE build scripts -- just forward CFLAGS instead of setting them (?= instead of :=)
  • changed ./configure for DaqDataDecoding: removed hardcoded -O2 in CXXFLAGS, prepended it with $CXXFLAGS
  • changes in p348reco/Makefile:
    • Backticks (`...` -- deferred expansion of shell instructions) in Makefile were used to run cmake. While inspecting the resulting CMAKE_CACHE I found that these notation actually spoils CMake's commands. I changed these to $(shell ...) to fix that.
    • Target genfit-install results in slightly different directory structure for Debian-like distros (e.g. Ubuntu) -- library suffix becomes lib/ instead of lib64/. This is a well-known CMake gotcha -- once can clamp the suffix with -DCMAKE_INSTALL_LIBDIR=lib which was added as well
    • Append install command for CMake-based packages with explicit -DCMAKE_BUILD_TYPE to follow its standard way of builds designations.
  • removed hardcoded -O3 for COOOL

Contrary to what was initially proposed, it is better to name steering variable different then DEBUG=1 as the latter one is used by make utility to enable echoing output (cf. DEBUG=1 make).

Edited by Renat Dusaev

Merge request reports

Loading