E3SM-Project / E3SM-Project/scream

Members of physics::Constants must be instantiated, since they might be odr-used

Open
#1,448 0 comments 0 reactions 1 assignee Claimed by @bartgol View on GitHub
bug
Dominant language
No language data
Stars
79
Forks
54
PR merge metrics
No merged PRs in 30d

Description

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, Kokkos::Device >(std::mersenne_twister_engine&)':
/pscratch/sd/n/ndk/wacmy/s12-mar1/components/scream/src/diagnostics/tests/potential_temperature_test.cpp:174: undefined reference to `scream::physics::Constants::P0'
```

The fix is super easy: at the bottom of the file, for all constants do what's already done for some of them.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.