From 4c436eb214b28c2f7a8932b0b59877bb8dae97a5 Mon Sep 17 00:00:00 2001 From: pearce8 Date: Mon, 12 Jan 2026 08:01:43 -0600 Subject: [PATCH] System with alternative compilers --- docs/add-a-system-config.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/add-a-system-config.rst b/docs/add-a-system-config.rst index 7805c9872..0eb7abf98 100644 --- a/docs/add-a-system-config.rst +++ b/docs/add-a-system-config.rst @@ -491,3 +491,19 @@ modules: Therefore, the ``prefix`` is ``/usr/tce/packages/gcc/gcc-12.1.1/`` and the spec is ``gcc@12.1.1``. + + +1. Alternative compilers on the System +====================================== + +When some of the dependencies don't build with the default compiler, we use this syntax to provide an alternative compiler +while requiring that the main compiler is used where possible: + +:: + + packages: + all: + require: + - one_of: ["%cce", "%gcc"] # this line makes Spack use cce to build where possible, gcc otherwise + +This functionality depends on `Spack's one_of syntax `.