<div dir="ltr"><div>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:<br>

<br><span style="font-family:courier new,monospace">set(CMAKE_SYSTEM_NAME ComputeNodeLinux)<br>...<br>if(DEFINED ENV{CRAYPE_LINK_TYPE} AND<br>   "$ENV{CRAYPE_LINK_TYPE}" EQUALS "dynamic")<br>  set(_CRAY_LINK_OPTS "-dynamic")<br>

else()<br>  # The default behavior if not specified is explicit static-only linkage<br>  set(_CRAY_LINK_OPTS "-static")<br><br>  # If we're using static linking then make sure that CMake explicitly<br>  # only looks for static libraries<br>

  set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")<br>endif()<br>...<br>set(CMAKE_C_FLAGS       "... ${_CRAY_LINK}" CACHE STRING "" FORCE)<br>set(CMAKE_CXX_FLAGS     "... ${_CRAY_LINK}" CACHE STRING "" FORCE)<br>

set(CMAKE_Fortran_FLAGS "... ${_CRAY_LINK}" CACHE STRING "" FORCE)</span><br><br><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">- Chuck<br></div></div>
<br><br><div class="gmail_quote">On Thu, Aug 14, 2014 at 6:46 PM, Chuck Atkins <span dir="ltr"><<a href="mailto:chuck.atkins@kitware.com" target="_blank">chuck.atkins@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">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.<br>


<br>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).<span class="HOEnZb"><font color="#888888"><br>


<br clear="all"><div><div><div dir="ltr">- Chuck<br></div></div>
</div></font></span></div>
</blockquote></div><br></div>