From 9be81ac4d9eb459e15637c40913a767785e10742 Mon Sep 17 00:00:00 2001 From: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com> Date: Mon, 30 Aug 2021 04:17:03 -0500 Subject: Add documentation on compiler `environment` (#25508) --- lib/spack/docs/getting_started.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/spack/docs/getting_started.rst b/lib/spack/docs/getting_started.rst index c89b46d441..419e1293bb 100644 --- a/lib/spack/docs/getting_started.rst +++ b/lib/spack/docs/getting_started.rst @@ -460,6 +460,34 @@ then inject those flags into the compiler command. Compiler flags entered from the command line will be discussed in more detail in the following section. +Some compilers also require additional environment configuration. +Examples include Intels oneAPI and AMDs AOCC compiler suites, +which have custom scripts for loading environment variables and setting paths. +These variables should be specified in the ``environment`` section of the compiler +specification. The operations available to modify the environment are ``set``, ``unset``, +``prepend_path``, ``append_path``, and ``remove_path``. For example: + +.. code-block:: yaml + + compilers: + - compiler: + modules: [] + operating_system: centos6 + paths: + cc: /opt/intel/oneapi/compiler/latest/linux/bin/icx + cxx: /opt/intel/oneapi/compiler/latest/linux/bin/icpx + f77: /opt/intel/oneapi/compiler/latest/linux/bin/ifx + fc: /opt/intel/oneapi/compiler/latest/linux/bin/ifx + spec: oneapi@latest + environment: + set: + MKL_ROOT: "/path/to/mkl/root" + unset: # A list of environment variables to unset + - CC + prepend_path: # Similar for append|remove_path + LD_LIBRARY_PATH: /ld/paths/added/by/setvars/sh + + ^^^^^^^^^^^^^^^^^^^^^^^ Build Your Own Compiler ^^^^^^^^^^^^^^^^^^^^^^^ -- cgit v1.2.3-70-g09d2