Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53156 - in trunk: libs/mpi libs/mpi/src libs/mpi/test tools/build/CMake
From: troy_at_[hidden]
Date: 2009-05-21 11:36:37


Author: troy
Date: 2009-05-21 11:36:35 EDT (Thu, 21 May 2009)
New Revision: 53156
URL: http://svn.boost.org/trac/boost/changeset/53156

Log:
get mpi cmake tests working on trunk
Text files modified:
   trunk/libs/mpi/CMakeLists.txt | 22 +++---
   trunk/libs/mpi/src/CMakeLists.txt | 67 +++++++++------------
   trunk/libs/mpi/test/CMakeLists.txt | 123 ++++++++++++++++++++-------------------
   trunk/tools/build/CMake/BoostCore.cmake | 3
   4 files changed, 106 insertions(+), 109 deletions(-)

Modified: trunk/libs/mpi/CMakeLists.txt
==============================================================================
--- trunk/libs/mpi/CMakeLists.txt (original)
+++ trunk/libs/mpi/CMakeLists.txt 2009-05-21 11:36:35 EDT (Thu, 21 May 2009)
@@ -1,22 +1,20 @@
-#----------------------------------------------------------------------------
-# This file was automatically generated from the original CMakeLists.txt file
-# Add a variable to hold the headers for the library
-set (lib_headers
- mpi.hpp
- mpi
-)
+FIND_PACKAGE(MPI)
+
+if (NOT MPI_FOUND)
+ message(STATUS "MPI Not Found")
+endif (NOT MPI_FOUND)
+
 
-# Add a library target to the build system
 boost_library_project(
   mpi
- SRCDIRS src
+ SRCDIRS src
   TESTDIRS test
- HEADERS ${lib_headers}
- DOCDIRS doc
+ HEADERS mpi.hpp mpi
+ DOCDIRS doc
   # DESCRIPTION
   MODULARIZED
   # AUTHORS
   # MAINTAINERS
-)
+ )
 
 

Modified: trunk/libs/mpi/src/CMakeLists.txt
==============================================================================
--- trunk/libs/mpi/src/CMakeLists.txt (original)
+++ trunk/libs/mpi/src/CMakeLists.txt 2009-05-21 11:36:35 EDT (Thu, 21 May 2009)
@@ -1,45 +1,36 @@
-#-- Make sure MPI is installed on the users system
-FIND_PACKAGE(MPI)
-
-if (NOT MPI_FOUND)
- message(STATUS "MPI Not Found")
-endif (NOT MPI_FOUND)
-
 if (MPI_FOUND)
-message(STATUS "MPI Found")
-
 
-add_definitions(-DBOOST_MPI_SOURCE=1)
-include_directories(${MPI_INCLUDE_PATH})
+ add_definitions(-DBOOST_MPI_SOURCE=1)
+ include_directories(${MPI_INCLUDE_PATH})
 
-boost_add_library(
- boost_mpi
- broadcast.cpp
- communicator.cpp
- computation_tree.cpp
- content_oarchive.cpp
- environment.cpp
- exception.cpp
- graph_communicator.cpp
- group.cpp
- intercommunicator.cpp
- mpi_datatype_cache.cpp
- mpi_datatype_oarchive.cpp
- packed_iarchive.cpp
- packed_oarchive.cpp
- packed_skeleton_iarchive.cpp
- packed_skeleton_oarchive.cpp
- point_to_point.cpp
- request.cpp
- text_skeleton_oarchive.cpp
- DEPENDS boost_serialization
- COMPILE_FLAGS "${MPI_COMPILE_FLAGS}"
- LINK_FLAGS "${MPI_LINK_FLAGS}"
- LINK_LIBS ${MPI_LIBRARIES}
- SHARED_COMPILE_FLAGS "-DBOOST_MPI_DYN_LINK=1"
- )
+ boost_add_library(
+ boost_mpi
+ broadcast.cpp
+ communicator.cpp
+ computation_tree.cpp
+ content_oarchive.cpp
+ environment.cpp
+ exception.cpp
+ graph_communicator.cpp
+ group.cpp
+ intercommunicator.cpp
+ mpi_datatype_cache.cpp
+ mpi_datatype_oarchive.cpp
+ packed_iarchive.cpp
+ packed_oarchive.cpp
+ packed_skeleton_iarchive.cpp
+ packed_skeleton_oarchive.cpp
+ point_to_point.cpp
+ request.cpp
+ text_skeleton_oarchive.cpp
+ DEPENDS boost_serialization
+ COMPILE_FLAGS "${MPI_COMPILE_FLAGS}"
+ LINK_FLAGS "${MPI_LINK_FLAGS}"
+ LINK_LIBS ${MPI_LIBRARIES}
+ SHARED_COMPILE_FLAGS "-DBOOST_MPI_DYN_LINK=1"
+ )
 
-message(STATUS "boost::mpi::python needs love")
+ message(STATUS "boost::mpi::python needs love")
 
 endif (MPI_FOUND)
 

Modified: trunk/libs/mpi/test/CMakeLists.txt
==============================================================================
--- trunk/libs/mpi/test/CMakeLists.txt (original)
+++ trunk/libs/mpi/test/CMakeLists.txt 2009-05-21 11:36:35 EDT (Thu, 21 May 2009)
@@ -1,71 +1,76 @@
 if (MPI_FOUND)
-message(STATUS "MPI Found")
 
-boost_additional_test_dependencies(mpi BOOST_DEPENDS test )
+ boost_additional_test_dependencies(mpi BOOST_DEPENDS test)
 
-include_directories(${MPI_INCLUDE_PATH})
+ include_directories(${MPI_INCLUDE_PATH})
+
+ # Declare a test for the Boost.MPI library, which may involve both
+ # building the test and executing it with varying numbers of
+ # processes.
+ #
+ # boost_mpi_test(testname
+ # [source1 source2 ...]
+ # [ARGS arg1 arg2 ...]
+ # [SCHEDULE procs1 procs2 ...]
+ #
+ # testname is the name of the test. source1, source2, etc. are the
+ # source files that will be built and linked into the test
+ # executable. If no source files are provided, the file "testname.cpp"
+ # will be used instead.
+ macro(boost_mpi_test testname)
+ PARSE_ARGUMENTS(MPI_TEST "SCHEDULE;ARGS" "" ${ARGN})
+
+ # Determine the test sources
+ if (MPI_TEST_DEFAULT_ARGS)
+ set(MPI_TEST_SOURCES ${MPI_TEST_DEFAULT_ARGS})
+ else (MPI_TEST_DEFAULT_ARGS)
+ set(MPI_TEST_SOURCES "${testname}.cpp")
+ endif (MPI_TEST_DEFAULT_ARGS)
+
+ set(THIS_TEST_LOCATION tests/${PROJECT_NAME}/${testname})
+
+ # Build the test executable
+ boost_add_executable(${testname}
+ ${MPI_TEST_SOURCES}
+ OUTPUT_NAME ${THIS_TEST_LOCATION}
+ NO_INSTALL
+ DEPENDS boost_mpi
+ COMPILE_FLAGS "${MPI_COMPILE_FLAGS}"
+ LINK_FLAGS "${MPI_LINK_FLAGS}"
+ LINK_LIBS ${MPI_LIBRARIES}
+ SHARED_COMPILE_FLAGS "-DBOOST_MPI_DYN_LINK=1")
+
+ #
+ # 'mpi-test' depends on 'mpi-test-drivers' which should in turn
+ # depend on each test
+ #
+ add_dependencies(${PROJECT_NAME}-test-drivers ${PROJECT_NAME}-${testname})
 
-# Declare a test for the Boost.MPI library, which may involve both
-# building the test and executing it with varying numbers of
-# processes.
-#
-# boost_mpi_test(testname
-# [source1 source2 ...]
-# [ARGS arg1 arg2 ...]
-# [SCHEDULE procs1 procs2 ...]
-#
-# testname is the name of the test. source1, source2, etc. are the
-# source files that will be built and linked into the test
-# executable. If no source files are provided, the file "testname.cpp"
-# will be used instead.
-macro(boost_mpi_test testname)
- PARSE_ARGUMENTS(MPI_TEST "SCHEDULE;ARGS" "" ${ARGN})
-
- # Determine the test sources
- if (MPI_TEST_DEFAULT_ARGS)
- set(MPI_TEST_SOURCES ${MPI_TEST_DEFAULT_ARGS})
- else (MPI_TEST_DEFAULT_ARGS)
- set(MPI_TEST_SOURCES "${testname}.cpp")
- endif (MPI_TEST_DEFAULT_ARGS)
-
- # Build the test executable
- boost_add_executable(${testname}
- ${MPI_TEST_SOURCES}
- OUTPUT_NAME tests/${PROJECT_NAME}/${testname}
- NO_INSTALL
- DEPENDS boost_mpi
- COMPILE_FLAGS "${MPI_COMPILE_FLAGS}"
- LINK_FLAGS "${MPI_LINK_FLAGS}"
- LINK_LIBS ${MPI_LIBRARIES}
- SHARED_COMPILE_FLAGS "-DBOOST_MPI_DYN_LINK=1")
- if (THIS_EXE_OKAY)
     if (NOT MPI_TEST_SCHEDULE)
       set(MPI_TEST_SCHEDULE 1 2 3 4 7 8 13 17)
     endif (NOT MPI_TEST_SCHEDULE)
 
     foreach(PROCS ${MPI_TEST_SCHEDULE})
- add_test("${PROJECT_NAME}::${testname}-${PROCS}"
- ${MPIEXEC}
- -n ${PROCS}
- ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/tests/${PROJECT_NAME}/${testname}
- ${BOOST_TEST_ARGS}
- )
+ add_test("${PROJECT_NAME}-${testname}-${PROCS}"
+ ${MPIEXEC}
+ -n ${PROCS}
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${THIS_TEST_LOCATION}
+ ${BOOST_TEST_ARGS}
+ )
     endforeach(PROCS)
- endif (THIS_EXE_OKAY)
-endmacro(boost_mpi_test)
-
-boost_mpi_test(all_gather_test)
-boost_mpi_test(all_reduce_test)
-boost_mpi_test(all_to_all_test)
-boost_mpi_test(broadcast_test SCHEDULE 2 17)
-boost_mpi_test(graph_topology_test SCHEDULE 2 7 13)
-boost_mpi_test(is_mpi_op_test SCHEDULE 1)
-boost_mpi_test(nonblocking_test)
-boost_mpi_test(reduce_test)
-boost_mpi_test(ring_test SCHEDULE 2 3 4 7 8 13 17)
-boost_mpi_test(scan_test)
-boost_mpi_test(scatter_test)
-boost_mpi_test(skeleton_content_test SCHEDULE 2 3 4 7 8 13 17)
+ endmacro(boost_mpi_test)
 
+ boost_mpi_test(all_gather_test)
+ boost_mpi_test(all_reduce_test)
+ boost_mpi_test(all_to_all_test)
+ boost_mpi_test(broadcast_test SCHEDULE 2 17)
+ boost_mpi_test(graph_topology_test SCHEDULE 2 7 13)
+ boost_mpi_test(is_mpi_op_test SCHEDULE 1)
+ boost_mpi_test(nonblocking_test)
+ boost_mpi_test(reduce_test)
+ boost_mpi_test(ring_test SCHEDULE 2 3 4 7 8 13 17)
+ boost_mpi_test(scan_test)
+ boost_mpi_test(scatter_test)
+ boost_mpi_test(skeleton_content_test SCHEDULE 2 3 4 7 8 13 17)
 
-endif (MPI_FOUND)
\ No newline at end of file
+endif (MPI_FOUND)

Modified: trunk/tools/build/CMake/BoostCore.cmake
==============================================================================
--- trunk/tools/build/CMake/BoostCore.cmake (original)
+++ trunk/tools/build/CMake/BoostCore.cmake 2009-05-21 11:36:35 EDT (Thu, 21 May 2009)
@@ -340,9 +340,12 @@
       # Create a target <library name>-test, which will run all of
       # this library's tests.
       if (THIS_PROJECT_TESTDIRS)
+ add_custom_target(${PROJECT_NAME}-test-drivers)
         add_custom_target(${PROJECT_NAME}-test
           COMMAND ${CMAKE_CTEST_COMMAND} -R "^${PROJECT_NAME}-*"
           MESSAGE "Running tests for Boost.${PROJECT_NAME}...")
+ add_dependencies(${PROJECT_NAME}-test
+ ${PROJECT_NAME}-test-drivers)
       endif ()
 
       # Include the test directories.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk