[CMake] CTest in a cross-compiling environment

Biddiscombe, John A. biddisco at cscs.ch
Tue Feb 22 10:27:44 EST 2011


You compile cmake etc on the platform on which you are working (XT5 etc) and then do things as usual. here's a snippet from some instructions I made about a year ago for our xt5 (I've not tried this on BG)

----begin snip
To actually run the tests : in ccmake configuration, ensure that the mpiexec is set to aprun, you will also want the -n and max nodes for testing around 20 for the mpi boost tests (which actually require 17 at most). NB. Boost tests ignore these MAX_NUMPROCS and NUMPROC_FLAG but for future/other projects you should set them correctly as most projects do use them.
MPIEXEC                          aprun
MPIEXEC_MAX_NUMPROCS             20
MPIEXEC_NUMPROC_FLAG             -n

Now allocate an interactive node using a command such as
qsub -I -V -l mppwidth=20 -l walltime=00:30:00

and from your interactive session, you can run ctest from your project build directory, to run just the mpi tests from boost, you would use the command
~/apps/cmake/bin/ctest/ctest -R mpi:: (add -V to get a verbose output)
tests which use mpi explicitly will be executed via aprun and will run on the compute node. Tests which are not explicitly mpi enabled will actually run on the login node as the executed command will not have apron prepended. I shall investigate how to force ctest to run all commands using aprun and update these instructions accordingly if I find a way.

-------end snip

the references to boost were for a (dead) cmakeified boost version that I was testing out with. Note that xt5 has the same architecture for login nodes as for compute nodes, so cross compiling isn't a big deal.

JB


-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Sebastian Schaetz
Sent: 22 February 2011 11:45
To: cmake at cmake.org
Subject: Re: [CMake] CTest in a cross-compiling environment

Hi,

James Amundson <amundson at ...> writes:

> Are there any CMake solutions for running tests in a cross-compiling
> environment? Right now I have a lovely test suite that runs over sixty
> different executables using the standard CMake and CTest setup. It works
> exactly as I want under Linux, but now I need to run it on a
> cross-compiling platform (in fact, two cross-compiling platforms: BG/P
> and Cray XT5). I don't have cmake compiled for the target platform, so I
> can't just run "ctest." Surely there must be other people with this
> problem, but this mornings Google searches aren't turning up anything
> for me.

This is a great question, I'm currently trying to answer this myself. I have an
idea that I think could work for me alas I did not yet implement it.

Setup:
Development system is connected to all test systems, I can SSH into all test
systems without giving a password using public key authentication; this could
differ for your setup, the point is that you can execute a command from your
development system on the remote system without interaction like
giving a password

Process:
1) cross-compile tests on development system
2) move tests to test systems (I mount some folders and just move binaries)
3) register tests (one for each binary and test system) with CMAKE using the
add_test(NAME <name> COMMAND <command>) syntax; the command for me would be
something like "ssh testbox1 /path/to/tests/name"

Now if you do make test, CMAKE should run all tests including the remote ones.

seb

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list