[cmake-developers] New platform file for Cray Compute Node Linux

Chuck Atkins chuck.atkins at kitware.com
Thu Aug 14 19:41:25 EDT 2014


Updated to allow for static and shared libs (yes, you can use shared libs
on a cray).  The expectation is that your toolchain file will have the
appropriate logic to deal with this.  Something like:

set(CMAKE_SYSTEM_NAME ComputeNodeLinux)
...
if(DEFINED ENV{CRAYPE_LINK_TYPE} AND
   "$ENV{CRAYPE_LINK_TYPE}" EQUALS "dynamic")
  set(_CRAY_LINK_OPTS "-dynamic")
else()
  # The default behavior if not specified is explicit static-only linkage
  set(_CRAY_LINK_OPTS "-static")

  # If we're using static linking then make sure that CMake explicitly
  # only looks for static libraries
  set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()
...
set(CMAKE_C_FLAGS       "... ${_CRAY_LINK}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS     "... ${_CRAY_LINK}" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS "... ${_CRAY_LINK}" CACHE STRING "" FORCE)




- Chuck


On Thu, Aug 14, 2014 at 6:46 PM, Chuck Atkins <chuck.atkins at kitware.com>
wrote:

> I've been using CMake on Cray's quite a bit lately and some of the cross
> compilation leaves a bit to be desired.  No particular capability is really
> missing but the "foo" of getting things to build and work seems to be
> rather dispersed across various individuals and corners of the internet.
> I'd like to start pooling some of this together to be shipped with CMake.
>
> For starters, I'd like to add a Platform file for the cross compilation
> target of ComputeNodeLinux.  While it's not entirely different from running
> Linux natively, some assumptions from native host Linux build environments
> aren't valid and building for it explicitly needs search paths defined by
> the Cray environment modules.  It's also distinctly different from the
> commonly used Catamount (which is very far removed from the currently used
> OS). Attached is a patch for a new Platform file that uses information from
> the loaded environment modules on the login nodes to define it's
> appropriate path and version info.  I've been using this successfully on
> Garnet (an XE6) and Titan (an XK7).
>
> - Chuck
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140814/b7c05cf0/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-platform-file-for-cross-compiling-to-Cray-Comp.patch
Type: text/x-patch
Size: 2715 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140814/b7c05cf0/attachment-0002.bin>


More information about the cmake-developers mailing list