KATRIN-Experiment / Kassiopeia

Simulation of electric and magnetic fields and particle tracking
https://katrin-experiment.github.io/Kassiopeia/index.html
Other
47 stars 29 forks source link

Draft: Kommon: Bake KConst epoch into header file #74

Closed 2xB closed 1 year ago

2xB commented 1 year ago

When using Kassiopeia as an external library, as described in #72 there were compilation issues observed, likely because of missing definition of the rerefence epoch. This commit fixes that by ensuring the corresponding compile-time constant to be baked into the corresponding header file.

Btw. an alternative approach would maybe include adding this variable to the KommonConfig.cmake file via add_definitions, which however is less portable since that requires others to use the CMake build system to get the correct variables.

Closes #72.

@pslocum Could you test if this indeed fixes your issue?

2xB commented 1 year ago

After looking into this again, I think there has to be a better solution that is more similar to how we use e.g. KASPER_USE_GSL.

pslocum commented 1 year ago

FYI, this was tested in the latest P8 build framework, and it does fix the problem with the KConst Epoch selection.