mirror of
https://github.com/boostorg/boost_install.git
synced 2026-07-21 13:13:30 +00:00
Add test/mpi
This commit is contained in:
@@ -18,6 +18,11 @@ env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libopenmpi-dev
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
@@ -109,6 +114,8 @@ matrix:
|
||||
- env: LIB=iostreams UBP=1 STAGE=1
|
||||
- env: LIB=log
|
||||
- env: LIB=log UBP=1
|
||||
- env: LIB=mpi
|
||||
- env: LIB=mpi UBP=1
|
||||
- env: LIB=program_options
|
||||
- env: LIB=program_options UBP=1
|
||||
- env: LIB=python PYTHON=2.7,3.5
|
||||
@@ -146,6 +153,8 @@ script:
|
||||
echo "using python : 2.7 ;" >> ~/user-config.jam
|
||||
- |-
|
||||
echo "using python : 3.5 ;" >> ~/user-config.jam
|
||||
- |-
|
||||
echo "using mpi ;" >> ~/user-config.jam
|
||||
- if [ -z "$STAGE" ]; then export B2_INSTALL="--prefix=$HOME/.local install"; fi
|
||||
- ./b2 -j3 --with-$LIB ${LAYOUT:+--layout=$LAYOUT} ${TOOLSET:+toolset=$TOOLSET} ${LINK:+link=$LINK} ${PYTHON:+python=$PYTHON} ${THREADING:+threading=$THREADING} ${B2_INSTALL}
|
||||
- cd tools/boost_install/test/$LIB
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# Copyright 2018, 2019 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
|
||||
project(CmakeConfigMpiTest LANGUAGES CXX)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../BoostVersion.cmake)
|
||||
|
||||
set(BOOST_HINTS)
|
||||
|
||||
if(USE_STAGED_BOOST)
|
||||
set(BOOST_HINTS HINTS ../../../../stage)
|
||||
endif()
|
||||
|
||||
if(USE_BOOST_PACKAGE)
|
||||
|
||||
find_package(Boost ${BOOST_VERSION} EXACT REQUIRED COMPONENTS mpi ${BOOST_HINTS})
|
||||
|
||||
else()
|
||||
|
||||
find_package(boost_mpi ${BOOST_VERSION} EXACT CONFIG REQUIRED ${BOOST_HINTS})
|
||||
|
||||
endif()
|
||||
|
||||
add_executable(main quick.cpp)
|
||||
target_link_libraries(main Boost::mpi)
|
||||
|
||||
enable_testing()
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
||||
add_test(main main)
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
// Copyright 2019 Peter Dimov.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
//
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mpi/environment.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::pair<int, int> ver = boost::mpi::environment::version();
|
||||
|
||||
BOOST_TEST_EQ( ver.first, MPI_VERSION );
|
||||
BOOST_TEST_EQ( ver.second, MPI_SUBVERSION );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user