This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  f53fe86cef5a6ff342d8ac5b931e1998e5b7744c (commit)
       via  d0c697e47f54fcb626f3ea9385c7664deb78c637 (commit)
       via  030ed07d4c22542422af9ae6e226ebec6300d36f (commit)
      from  1c2a6406a4311c59afeb3993982e74c7c8e38bdd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f53fe86cef5a6ff342d8ac5b931e1998e5b7744c
commit f53fe86cef5a6ff342d8ac5b931e1998e5b7744c
Merge: 1c2a640 d0c697e
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Fri Nov 13 14:50:10 2015 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri Nov 13 14:50:10 2015 -0500

    Merge topic 'add-cray-linux-platform' into next
    
    d0c697e4 Cray: Added documentation for cross compiling on a Cray
    030ed07d Cray: New platform file for Cray Linux Environment and PrgEnv


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0c697e47f54fcb626f3ea9385c7664deb78c637
commit d0c697e47f54fcb626f3ea9385c7664deb78c637
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Fri Nov 13 14:37:56 2015 -0500
Commit:     Chuck Atkins <chuck.atk...@kitware.com>
CommitDate: Fri Nov 13 14:50:00 2015 -0500

    Cray: Added documentation for cross compiling on a Cray

diff --git a/Help/manual/cmake-toolchains.7.rst 
b/Help/manual/cmake-toolchains.7.rst
index 492fcac..3d1973e 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -151,6 +151,34 @@ 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.
 
+Cross Compiling for the Cray Linux Environment
+----------------------------------------------
+
+Cross compiling for compute nodes in the Cray Linux Environment can be done
+without needing a seperate toolchain file.  Specifying
+``-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment`` on the CMake comamnd 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 overriden, 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
 ---------------------------
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=030ed07d4c22542422af9ae6e226ebec6300d36f
commit 030ed07d4c22542422af9ae6e226ebec6300d36f
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Fri Nov 13 10:13:24 2015 -0600
Commit:     Chuck Atkins <chuck.atk...@kitware.com>
CommitDate: Fri Nov 13 14:49:53 2015 -0500

    Cray: New platform file for Cray Linux Environment and PrgEnv

diff --git a/Modules/Platform/CrayLinuxEnvironment.cmake 
b/Modules/Platform/CrayLinuxEnvironment.cmake
new file mode 100644
index 0000000..406b03a
--- /dev/null
+++ b/Modules/Platform/CrayLinuxEnvironment.cmake
@@ -0,0 +1,111 @@
+# Compute Node Linux doesn't quite work the same as native Linux so all of this
+# needs to be custom.  We use the variables defined through Cray's environment
+# modules to set up the right paths for things.
+
+# Guard against multiple inclusions
+if(__CrayLinuxEnvironment)
+  return()
+endif()
+set(__CrayLinuxEnvironment 1)
+
+set(UNIX 1)
+
+if(DEFINED ENV{CRAYOS_VERSION})
+  set(CMAKE_SYSTEM_VERSION "$ENV{CRAYOS_VERSION}")
+elseif(DEFINED ENV{XTOS_VERSION})
+  set(CMAKE_SYSTEM_VERSION "$ENV{XTOS_VERSION}")
+else()
+  message(FATAL_ERROR "Neither the CRAYOS_VERSION or XTOS_VERSION environment 
variables are defined.  This platform file should be used inside the Cray Linux 
Environment for targeting compute nodes (NIDs)")
+endif()
+message(STATUS "Cray Linux Environment ${CMAKE_SYSTEM_VERSION}")
+
+# All cray systems are x86 CPUs and have been for quite some time
+# Note: this may need to change in the future with 64-bit ARM
+set(CMAKE_SYSTEM_PROCESSOR "x86_64")
+
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+set(CMAKE_DL_LIBS dl)
+
+# Note: Much of this is pulled from UnixPaths.cmake but adjusted to the Cray
+# environment accordingly
+
+# Get the install directory of the running cmake to the search directories
+# CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels 
up
+get_filename_component(__cmake_install_dir "${CMAKE_ROOT}" PATH)
+get_filename_component(__cmake_install_dir "${__cmake_install_dir}" PATH)
+
+
+# Note: Some Cray's have the SYSROOT_DIR variable defined, pointing to a copy
+# of the NIDs userland.  If so, then we'll use it.  Otherwise, just assume
+# the userland from the login node is ok
+
+# List common installation prefixes.  These will be used for all
+# search types.
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+  # Standard
+  $ENV{SYSROOT_DIR}/usr/local $ENV{SYSROOT_DIR}/usr $ENV{SYSROOT_DIR}/
+
+  # CMake install location
+  "${__cmake_install_dir}"
+  )
+if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
+  list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+    # Project install destination.
+    "${CMAKE_INSTALL_PREFIX}"
+  )
+  if(CMAKE_STAGING_PREFIX)
+    list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+      # User-supplied staging prefix.
+      "${CMAKE_STAGING_PREFIX}"
+    )
+  endif()
+endif()
+
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+  $ENV{SYSROOT_DIR}/usr/include
+  $ENV{SYSROOT_DIR}/usr/include/X11
+)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+  $ENV{SYSROOT_DIR}/usr/local/lib64
+  $ENV{SYSROOT_DIR}/usr/lib64
+  $ENV{SYSROOT_DIR}/lib64
+)
+
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+  $ENV{SYSROOT_DIR}/usr/local/lib64
+  $ENV{SYSROOT_DIR}/usr/lib64
+  $ENV{SYSROOT_DIR}/lib64
+)
+list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
+  $ENV{SYSROOT_DIR}/usr/include
+)
+list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
+  $ENV{SYSROOT_DIR}/usr/include
+)
+list(APPEND CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES
+  $ENV{SYSROOT_DIR}/usr/include
+)
+
+# Enable use of lib64 search path variants by default.
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
+
+# Check to see if we're using the cray compiler wrapers and load accordingly 
if we are
+if(DEFINED ENV{CRAYPE_DIR})
+  set(_CRAYPE_ROOT "$ENV{CRAYPE_DIR}")
+elseif(DEFINED ENV{ASYNCPE_DIR})
+  set(_CRAYPE_ROOT "$ENV{ASYNCPE_DIR}")
+endif()
+if(_CRAYPE_ROOT AND
+   ((CMAKE_C_COMPILER MATCHES "${_CRAYPE_ROOT}") OR
+    (CMAKE_CXX_COMPILER MATCHES "${_CRAYPE_ROOT}") OR
+    (CMAKE_Fortran_COMPILER MATCHES "${_CRAYPE_ROOT}")))
+  include(Platform/CrayPrgEnv)
+endif()
diff --git a/Modules/Platform/CrayPrgEnv.cmake 
b/Modules/Platform/CrayPrgEnv.cmake
new file mode 100644
index 0000000..a78846d
--- /dev/null
+++ b/Modules/Platform/CrayPrgEnv.cmake
@@ -0,0 +1,127 @@
+# Guard against multiple inclusions
+if(__CrayPrgEnv)
+  return()
+endif()
+set(__CrayPrgEnv 1)
+if(DEFINED ENV{CRAYPE_VERSION})
+  message(STATUS "Cray Programming Environment $ENV{CRAYPE_VERSION}")
+  set(__verbose_flag "-craype-verbose")
+elseif(DEFINED ENV{ASYNCPE_VERSION})
+  message(STATUS "Cray Programming Environment $ENV{ASYNCPE_VERSION}")
+  set(__verbose_flag "-v")
+else()
+  message(STATUS "Cray Programming Environment")
+endif()
+
+if(NOT __CrayLinuxEnvironment)
+  message(FATAL_ERROR "The CrayPrgEnv platform file must not be used on its 
own and is intented to be included by the CrayLinuxEnvironment platform file")
+endif()
+
+# Flags for the Cray wrappers
+foreach(__lang C CXX Fortran)
+  set(CMAKE_STATIC_LIBRARY_LINK_${__lang}_FLAGS "-static")
+  set(CMAKE_SHARED_LIBRARY_${__lang}_FLAGS "")
+  set(CMAKE_SHARED_LIBRARY_CREATE_${__lang}_FLAGS "-shared")
+  set(CMAKE_SHARED_LIBRARY_LINK_${__lang}_FLAGS "-dynamic")
+endforeach()
+
+# If the link type is not explicitly specified in the environment then
+# the Cray wrappers assume that the code will be built staticly
+if(NOT ((CMAKE_C_FLAGS MATCHES "(^| )-dynamic($| )") OR
+        (CMAKE_EXE_LINKER_FLAGS MATCHES "(^| )-dynamic($| )") OR
+        ("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic")))
+  set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+  set(BUILD_SHARED_LIBS FALSE CACHE BOOL "")
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+  set(CMAKE_LINK_SEARCH_START_STATIC TRUE)
+endif()
+
+# Parse the implicit directories used by the wrappers
+get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+foreach(__lang IN LISTS __langs)
+  if(__lang STREQUAL "C")
+    set(__empty_fname empty.c)
+  elseif(__lang STREQUAL CXX)
+    set(__empty_fname empty.cxx)
+  elseif(__lang STREQUAL Fortran)
+    set(__empty_fname empty.f90)
+  else()
+    continue()
+  endif()
+
+  execute_process(
+    COMMAND ${CMAKE_${__lang}_COMPILER} ${__verbose_flag} ${__empty_fname}
+    OUTPUT_VARIABLE __cray_output
+    ERROR_QUIET
+  )
+  string(REGEX MATCH "(^|\n)[^\n]*${__empty_fname}[^\n]*" __cray_driver_cmd 
"${__cray_output}")
+
+  # Parse include paths
+  string(REGEX MATCHALL " -I([^ ]+)" __cray_include_flags 
"${__cray_driver_cmd}")
+  foreach(_flag IN LISTS __cray_include_flags)
+    string(REGEX REPLACE "^ -I([^ ]+)" "\\1" _dir "${_flag}")
+    list(APPEND CMAKE_${__lang}_IMPLICIT_INCLUDE_DIRECTORIES ${_dir})
+  endforeach()
+  if(CMAKE_${__lang}_IMPLICIT_INCLUDE_DIRECTORIES)
+    list(REMOVE_DUPLICATES CMAKE_${__lang}_IMPLICIT_INCLUDE_DIRECTORIES)
+  endif()
+
+  # Parse library paths
+  string(REGEX MATCHALL " -L([^ ]+)" __cray_library_dir_flags 
"${__cray_driver_cmd}")
+  foreach(_flag IN LISTS __cray_library_dir_flags)
+    string(REGEX REPLACE "^ -L([^ ]+)" "\\1" _dir "${_flag}")
+    list(APPEND CMAKE_${__lang}_IMPLICIT_LINK_DIRECTORIES ${_dir})
+  endforeach()
+  if(CMAKE_${__lang}_IMPLICIT_LINK_DIRECTORIES)
+    list(REMOVE_DUPLICATES CMAKE_${__lang}_IMPLICIT_LINK_DIRECTORIES)
+  endif()
+
+  # Parse library paths
+  string(REGEX MATCHALL " -l([^ ]+)" __cray_library_flags 
"${__cray_driver_cmd}")
+  foreach(_flag IN LISTS __cray_library_flags)
+    string(REGEX REPLACE "^ -l([^ ]+)" "\\1" _dir "${_flag}")
+    list(APPEND CMAKE_${__lang}_IMPLICIT_LINK_LIBRARIES ${_dir})
+  endforeach()
+  if(CMAKE_${__lang}_IMPLICIT_LINK_DIRECTORIES)
+    list(REMOVE_DUPLICATES CMAKE_${__lang}_IMPLICIT_LINK_LIBRARIES)
+  endif()
+endforeach()
+
+# Compute the intersection of several lists
+macro(__list_intersection L_OUT L0)
+  if(ARGC EQUAL 2)
+    list(APPEND ${L_OUT} ${${L0}})
+  else()
+    foreach(I IN LISTS ${L0})
+      set(__is_common 1)
+      foreach(L IN LISTS ARGN)
+        list(FIND ${L} "${I}" __idx)
+        if(__idx EQUAL -1)
+          set(__is_common 0)
+          break()
+        endif()
+      endforeach()
+      if(__is_common)
+        list(APPEND ${L_OUT}  "${I}")
+      endif()
+    endforeach()
+  endif()
+  if(${L_OUT})
+    list(REMOVE_DUPLICATES ${L_OUT})
+  endif()
+endmacro()
+
+# Determine the common directories between all languages and add them
+# as system search paths
+set(__cray_include_path_vars)
+set(__cray_library_path_vars)
+foreach(__lang IN LISTS __langs)
+  list(APPEND __cray_include_path_vars 
CMAKE_${__lang}_IMPLICIT_INCLUDE_DIRECTORIES)
+  list(APPEND __cray_library_path_vars 
CMAKE_${__lang}_IMPLICIT_LINK_DIRECTORIES)
+endforeach()
+if(__cray_include_path_vars)
+  __list_intersection(CMAKE_SYSTEM_INCLUDE_PATH ${__cray_include_path_vars})
+endif()
+if(__cray_library_path_vars)
+  __list_intersection(CMAKE_SYSTEM_LIBRARY_PATH ${__cray_library_path_vars})
+endif()

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to