summaryrefslogtreecommitdiff
path: root/lib/spack/docs/getting_started.rst
diff options
context:
space:
mode:
authorkwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>2021-08-30 04:17:03 -0500
committerGitHub <noreply@github.com>2021-08-30 11:17:03 +0200
commit9be81ac4d9eb459e15637c40913a767785e10742 (patch)
tree0a798f15a3a193ee02190621e1cc5d8ffdef169a /lib/spack/docs/getting_started.rst
parente60e41d9ca597fac97d495df62550d9c5544090e (diff)
downloadspack-9be81ac4d9eb459e15637c40913a767785e10742.tar.gz
spack-9be81ac4d9eb459e15637c40913a767785e10742.tar.bz2
spack-9be81ac4d9eb459e15637c40913a767785e10742.tar.xz
spack-9be81ac4d9eb459e15637c40913a767785e10742.zip
Add documentation on compiler `environment` (#25508)
Diffstat (limited to 'lib/spack/docs/getting_started.rst')
-rw-r--r--lib/spack/docs/getting_started.rst28
1 files changed, 28 insertions, 0 deletions
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
^^^^^^^^^^^^^^^^^^^^^^^