Skip to content
This repository was archived by the owner on Jul 14, 2022. It is now read-only.

Commit eb57acc

Browse files
authored
blt enable find mpi logic fix (#14)
* blt enable find mpi logic fix
1 parent 5a6ca80 commit eb57acc

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

azure-pipelines.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# Ref:
55
# https://aka.ms/yaml
66

7+
#####
8+
# TO USE A NEW CONTAINER, UPDATE TAG NAME HERE AS PART OF YOUR PR!
9+
#####
10+
variables:
11+
main_tag : alpinedav/ascent-ci:ubuntu-18-devel
12+
713
# only build merge target pr to develop
814
trigger: none
915
pr:
@@ -19,14 +25,15 @@ stages:
1925
###############################################################################
2026
# Ubuntu build and test, using spack to build tpls
2127
###############################################################################
22-
- job: Ubuntu_16
28+
- job: Main_Ubuntu_18
2329
pool:
24-
vmImage: 'ubuntu-16.04'
30+
vmImage: 'ubuntu-latest'
31+
container: ${{ variables.main_tag }}
2532
timeoutInMinutes: 0
2633
variables:
27-
COMPILER_CC: gcc-5
28-
COMPILER_CXX: g++-5
29-
COMPILER_FC: gfortran-5
34+
COMPILER_CC: gcc
35+
COMPILER_CXX: g++
36+
COMPILER_FC: gfortran
3037
strategy:
3138
matrix:
3239
shared_debug:
@@ -65,8 +72,8 @@ stages:
6572
sudo apt-get update
6673
# list pkgs we need
6774
export APT_PKGS=binutils
68-
export APT_PKGS="$APT_PKGS gcc-5"
69-
export APT_PKGS="$APT_PKGS g++-5"
75+
export APT_PKGS="$APT_PKGS gcc"
76+
export APT_PKGS="$APT_PKGS g++"
7077
export APT_PKGS="$APT_PKGS openmpi-bin"
7178
export APT_PKGS="$APT_PKGS libopenmpi-dev"
7279
export APT_PKGS="$APT_PKGS libncurses-dev"

src/cmake/SetupBLT.cmake

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,23 @@ if(ENABLE_MPI)
4444
# the name mpi
4545
set(apcomp_blt_mpi_deps mpi CACHE STRING "")
4646
else()
47-
if(TARGET MPI::MPI_CXX)
48-
message(STATUS "Using MPI CMake imported target: MPI::MPI_CXX")
49-
# newer cmake we use find mpi targets directly
50-
set(apcomp_blt_mpi_deps MPI::MPI_CXX CACHE STRING "")
47+
# if we are using BLT's enable mpi, then we must
48+
# make sure the MPI targets exist
49+
if(ENABLE_FIND_MPI)
50+
if(TARGET MPI::MPI_CXX)
51+
set(APCOMP_USE_CMAKE_MPI_TARGETS TRUE CACHE BOOL "")
52+
message(STATUS "Using MPI CMake imported target: MPI::MPI_CXX")
53+
# newer cmake we use find mpi targets directly
54+
set(apcomp_blt_mpi_deps MPI::MPI_CXX CACHE STRING "")
55+
else()
56+
message(FATAL_ERROR "Cannot use CMake imported targets for MPI."
57+
"(CMake > 3.15, ENABLE_MPI == ON, but "
58+
"MPI::MPI_CXX CMake target is missing.)")
59+
endif()
5160
else()
52-
message(FATAL_ERROR "Cannot use CMake imported targets for MPI."
53-
"(CMake > 3.15, ENABLE_MPI == ON, but "
54-
"MPI::MPI_CXX CMake target is missing.)")
61+
set(APCOMP_USE_CMAKE_MPI_TARGETS FALSE CACHE BOOL "")
62+
# compiler will handle them implicitly
63+
set(apcomp_blt_mpi_deps "" CACHE STRING "")
5564
endif()
5665
endif()
5766
endif()

0 commit comments

Comments
 (0)