scream
scream copied to clipboard
Members of physics::Constants must be instantiated, since they might be odr-used
Some constants are already instantiated, but other aren't. Some compiler complain about it (if C++17 features are not supported), and give link errors of the form
/usr/bin/ld: CMakeFiles/potential_temperature.dir/potential_temperature_test.cpp.o: in function `void scream::run<ekat::Pack<double, 1>, Kokkos::Device<Kokkos::Cuda, Kokkos::CudaSpace> >(std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905\
998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul>&)':
/pscratch/sd/n/ndk/wacmy/s12-mar1/components/scream/src/diagnostics/tests/potential_temperature_test.cpp:174: undefined reference to `scream::physics::Constants<double>::P0'
The fix is super easy: at the bottom of the file, for all constants do what's already done for some of them.