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

Commit

Permalink
blt enable find mpi logic fix (#14)
Browse files Browse the repository at this point in the history
* blt enable find mpi logic fix
  • Loading branch information
cyrush authored Nov 30, 2021
1 parent 5a6ca80 commit eb57acc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
21 changes: 14 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# Ref:
# https://aka.ms/yaml

#####
# TO USE A NEW CONTAINER, UPDATE TAG NAME HERE AS PART OF YOUR PR!
#####
variables:
main_tag : alpinedav/ascent-ci:ubuntu-18-devel

# only build merge target pr to develop
trigger: none
pr:
Expand All @@ -19,14 +25,15 @@ stages:
###############################################################################
# Ubuntu build and test, using spack to build tpls
###############################################################################
- job: Ubuntu_16
- job: Main_Ubuntu_18
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-latest'
container: ${{ variables.main_tag }}
timeoutInMinutes: 0
variables:
COMPILER_CC: gcc-5
COMPILER_CXX: g++-5
COMPILER_FC: gfortran-5
COMPILER_CC: gcc
COMPILER_CXX: g++
COMPILER_FC: gfortran
strategy:
matrix:
shared_debug:
Expand Down Expand Up @@ -65,8 +72,8 @@ stages:
sudo apt-get update
# list pkgs we need
export APT_PKGS=binutils
export APT_PKGS="$APT_PKGS gcc-5"
export APT_PKGS="$APT_PKGS g++-5"
export APT_PKGS="$APT_PKGS gcc"
export APT_PKGS="$APT_PKGS g++"
export APT_PKGS="$APT_PKGS openmpi-bin"
export APT_PKGS="$APT_PKGS libopenmpi-dev"
export APT_PKGS="$APT_PKGS libncurses-dev"
Expand Down
23 changes: 16 additions & 7 deletions src/cmake/SetupBLT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,23 @@ if(ENABLE_MPI)
# the name mpi
set(apcomp_blt_mpi_deps mpi CACHE STRING "")
else()
if(TARGET MPI::MPI_CXX)
message(STATUS "Using MPI CMake imported target: MPI::MPI_CXX")
# newer cmake we use find mpi targets directly
set(apcomp_blt_mpi_deps MPI::MPI_CXX CACHE STRING "")
# if we are using BLT's enable mpi, then we must
# make sure the MPI targets exist
if(ENABLE_FIND_MPI)
if(TARGET MPI::MPI_CXX)
set(APCOMP_USE_CMAKE_MPI_TARGETS TRUE CACHE BOOL "")
message(STATUS "Using MPI CMake imported target: MPI::MPI_CXX")
# newer cmake we use find mpi targets directly
set(apcomp_blt_mpi_deps MPI::MPI_CXX CACHE STRING "")
else()
message(FATAL_ERROR "Cannot use CMake imported targets for MPI."
"(CMake > 3.15, ENABLE_MPI == ON, but "
"MPI::MPI_CXX CMake target is missing.)")
endif()
else()
message(FATAL_ERROR "Cannot use CMake imported targets for MPI."
"(CMake > 3.15, ENABLE_MPI == ON, but "
"MPI::MPI_CXX CMake target is missing.)")
set(APCOMP_USE_CMAKE_MPI_TARGETS FALSE CACHE BOOL "")
# compiler will handle them implicitly
set(apcomp_blt_mpi_deps "" CACHE STRING "")
endif()
endif()
endif()
Expand Down

0 comments on commit eb57acc

Please sign in to comment.