celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/
Other
64 stars 35 forks source link

Escape semicolons in exported CMake variables #1472

Closed drbenmorgan closed 3 weeks ago

drbenmorgan commented 3 weeks ago

Noted in ATLAS builds that the export of CMAKE_CUDA_ARCHITECTURES to the Config.hh and CeleritasConfig.cmake files resulted in newlines replacing the semicolons when this variable is a proper CMake list. For example, running CMake as

$ cmake -DCMAKE_CUDA_ARCHITECTURES="50;61;72;80" ...

as in ATLAS builds created a Config.hh with:

inline constexpr char celeritas_gpu_architectures[] = "50
61
75
80";

and thus a compile-time error. Similarly, CeleritasConfig.cmake got

set(CELERITAS_CMAKE_CUDA_ARCHITECTURES "50
61
75
80")

Assuming that we want to retain these as "X;Y;Z", the changes here explicitly escape any semicolons in variables exported to CMake files to ensure their retention, and also the CUDA/HIP architecture variable exported to Config.hh to retain them and prevent compilation error.

github-actions[bot] commented 3 weeks ago

Test summary

 3 350 files   5 176 suites   3m 53s :stopwatch:  1 557 tests  1 529 :white_check_mark: 28 :zzz: 0 :x: 17 183 runs  17 120 :white_check_mark: 63 :zzz: 0 :x:

Results for commit 7f83f86f.

:recycle: This comment has been updated with latest results.