Cray: Added documentation for cross compiling on a Cray

This commit is contained in:
Chuck Atkins 2015-11-13 14:37:56 -05:00
parent c54a621b55
commit 31d52139ca
2 changed files with 37 additions and 0 deletions

View File

@ -151,6 +151,36 @@ target system prefixes, whereas executables which must be run as part of the bui
should be found only on the host and not on the target. This is the purpose of
the ``CMAKE_FIND_ROOT_PATH_MODE_*`` variables.
.. _`Cray Cross-Compile`:
Cross Compiling for the Cray Linux Environment
----------------------------------------------
Cross compiling for compute nodes in the Cray Linux Environment can be done
without needing a separate toolchain file. Specifying
``-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment`` on the CMake command line will
ensure that the appropriate build settings and search paths are configured.
The platform will pull its configuration from the current environment
variables and will configure a project to use the compiler wrappers from the
Cray Programming Environment's ``PrgEnv-*`` modules if present and loaded.
The default configuration of the Cray Programming Environment is to only
support static libraries. This can be overridden and shared libraries
enabled by setting the ``CRAYPE_LINK_TYPE`` environment variable to
``dynamic``.
Running CMake without specifying :variable:`CMAKE_SYSTEM_NAME` will
run the configure step in host mode assuming a standard Linux environment.
If not overridden, the ``PrgEnv-*`` compiler wrappers will end up getting used,
which if targeting the either the login node or compute node, is likely not the
desired behavior. The exception to this would be if you are building directly
on a NID instead of cross-compiling from a login node. If trying to build
software for a login node, you will need to either first unload the
currently loaded ``PrgEnv-*`` module or explicitly tell CMake to use the
system compilers in ``/usr/bin`` instead of the Cray wrappers. If instead
targeting a compute node is desired, just specify the
:variable:`CMAKE_SYSTEM_NAME` as mentioned above.
Cross Compiling using Clang
---------------------------

View File

@ -0,0 +1,7 @@
add-cray-linux-platform
-----------------------
* A new platform file for cross-compiling in the Cray Linux Environment to
target compute nodes was added. See
:ref:`Cross Compiling for the Cray Linux Environment <Cray Cross-Compile>`
for usage details.