-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Steer preprocessor options (#define/#ifdef) with CMake #17
Comments
What preproccessor macros are currently defined?I am using the cmake-based build in a docker container based on the one produced by main_into_hybrid/Dockerfile.base. Header guardsHeader guards are sets of preprocessor macros in header files that prevent multiple inclusion of that header during compilation of a source file. These should not be made subject to CMake configuration. They are usually the first two and last one non-trivial line in a header file and take the form
The assigned value The following
|
Aside: header filename with hash characters?In producing the list of header guard variables in the previous comment, i noticed that one of the header files is named Why? What is its relationship the regularly named |
Constants that can be constexprC++11 introduced strongly typed compiler constants that are declared with include/RnModel_Fit_Params.hhIn L37-L40:
These are used extensively within the header file that defines them but nowhere else. It looks like much of
Spin this off into its own issue and set it aside for now. |
Constants that can be constexpr (continued)include/WCSimGenerator_Radioactivity.hhIn L15-L19
These are used to define hard-coded array sizes in src/WCSimConstructMaterials.ccOf all of the hard-coded constants in
The use-case is interesting. The arrays that are defined using src/WCSimWLSProperties.ccIn L18-L21
and L103
and L240
all appear to define hard-coded array sizes for arrays. Again, excellent applications of |
G4UI_USEThe preprocessor flag However, in its current state, this cannot work. Note that the optionally included code that would launch an interactive session is all in an Hmm, this is another thing that should probably be spun off into its own issue. |
Verbosity flagsThere are a number of preprocessor flags that control the stdout verbosity of several source files. If GEANT4 has verbosity levels for G4cout, that would be a safer solution than these optionally compiled components, but i have not yet found any indication that it does. So, a compile-time system will do, i guess. The following subsections collect some observations of the preprocessor flags used for this purpose. DEBUGUsed in many source files, including
HYPER_VERBOSITY
VERBOSE_GEOMETRY_CONFIGUsed only in SAVE_DIGITS_VERBOSEUsed only in VERBOSE_COMPARISONUsed in
WCSIMWCADDDARKNOISE_VERBOSEUsed in WCSIMWCDIGI_VERBOSEUsed in WCSIMWCDIGITIZER_VERBOSEUsed in WCSIMWCTRIGGER_VERBOSEUsed in Some discussionThe use of multiple verbosity flags in individual source files (e.g., DEBUG, HYPER_VERBOSITY, and WCSIMWCTRIGGER_VERBOSE in It makes sense to design a system that supports these intents in a consistent and less ad hoc way. An interesting problem that has probably been solved somewhere. |
CMake flags can be used to steer compilation options, like extra debugging output and GEANT4 overlap checking, that are usually coded as
#ifdef
and#ifndef
blocks. This has the advantage of collecting all such options in one placeIt should also make checking for clashes and unexpected behaviors among sets of compilation options.
The text was updated successfully, but these errors were encountered: