aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-08-19 21:15:24 -0700
committerGitHub <noreply@github.com>2020-08-19 21:15:24 -0700
commitec4e0c393480b1b508874d5106ecb0db547962af (patch)
tree5c5ec856c6077c6471fbea7c3c38b51ad8963eff
parent5c056a65bb316f0114f536fdbb04f344b84d38c3 (diff)
downloadvcpkg-ec4e0c393480b1b508874d5106ecb0db547962af.tar.gz
vcpkg-ec4e0c393480b1b508874d5106ecb0db547962af.zip
[openmpi/vcpkg_build_make] Disable parallel build (#12975)
-rw-r--r--ports/openmpi/CONTROL2
-rw-r--r--ports/openmpi/portfile.cmake2
-rw-r--r--scripts/cmake/vcpkg_build_make.cmake20
-rw-r--r--scripts/cmake/vcpkg_execute_build_process.cmake2
4 files changed, 22 insertions, 4 deletions
diff --git a/ports/openmpi/CONTROL b/ports/openmpi/CONTROL
index 37fe14b0c..b9c4df053 100644
--- a/ports/openmpi/CONTROL
+++ b/ports/openmpi/CONTROL
@@ -1,6 +1,6 @@
Source: openmpi
Version: 4.0.3
-Port-Version: 2
+Port-Version: 3
Homepage: https://www.open-mpi.org/
Description: The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.
Supports: !(windows|uwp)
diff --git a/ports/openmpi/portfile.cmake b/ports/openmpi/portfile.cmake
index 0ef3c3c6a..a51f55d0d 100644
--- a/ports/openmpi/portfile.cmake
+++ b/ports/openmpi/portfile.cmake
@@ -30,7 +30,7 @@ vcpkg_configure_make(
--enable-debug
)
-vcpkg_install_make()
+vcpkg_install_make(DISABLE_PARALLEL)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake
index 545e6d765..c957fc628 100644
--- a/scripts/cmake/vcpkg_build_make.cmake
+++ b/scripts/cmake/vcpkg_build_make.cmake
@@ -24,6 +24,9 @@
## The target passed to the make build command (`./make <target>`). If not specified, the 'all' target will
## be passed.
##
+## ### DISABLE_PARALLEL
+## The underlying buildsystem will be instructed to not parallelize
+##
## ## Notes:
## This command should be preceeded by a call to [`vcpkg_configure_make()`](vcpkg_configure_make.md).
## You can use the alias [`vcpkg_install_make()`](vcpkg_configure_make.md) function if your CMake script supports the
@@ -36,7 +39,7 @@
## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
function(vcpkg_build_make)
- cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT;BUILD_TARGET" "" ${ARGN})
+ cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" "LOGFILE_ROOT;BUILD_TARGET" "" ${ARGN})
if(NOT _bc_LOGFILE_ROOT)
set(_bc_LOGFILE_ROOT "build")
@@ -64,6 +67,7 @@ function(vcpkg_build_make)
find_program(MAKE make REQUIRED)
set(MAKE_COMMAND "${MAKE}")
set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f Makefile ${_bc_BUILD_TARGET})
+ set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} -j 1 --trace -f Makefile ${_bc_BUILD_TARGET})
string(REPLACE " " "\\\ " _VCPKG_PACKAGE_PREFIX ${CURRENT_PACKAGES_DIR})
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGE_PREFIX "${_VCPKG_PACKAGE_PREFIX}")
@@ -75,6 +79,7 @@ function(vcpkg_build_make)
set(MAKE_COMMAND "${MAKE}")
# Set make command and install command
set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f Makefile ${_bc_BUILD_TARGET})
+ set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j 1 -f Makefile ${_bc_BUILD_TARGET})
set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} install DESTDIR=${CURRENT_PACKAGES_DIR})
endif()
@@ -118,14 +123,25 @@ function(vcpkg_build_make)
if(MAKE_BASH)
set(MAKE_CMD_LINE "${MAKE_COMMAND} ${MAKE_OPTS}")
+ set(NO_PARALLEL_MAKE_CMD_LINE "${MAKE_COMMAND} ${NO_PARALLEL_MAKE_OPTS}")
else()
set(MAKE_CMD_LINE ${MAKE_COMMAND} ${MAKE_OPTS})
+ set(NO_PARALLEL_MAKE_CMD_LINE ${MAKE_COMMAND} ${NO_PARALLEL_MAKE_OPTS})
endif()
+ if (_bc_DISABLE_PARALLEL)
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE}
+ WORKING_DIRECTORY "${WORKING_DIRECTORY}"
+ LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
+ )
+ else()
vcpkg_execute_build_process(
COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE}
+ NO_PARALLEL_COMMAND ${MAKE_BASH} ${NO_PARALLEL_MAKE_CMD_LINE}
WORKING_DIRECTORY "${WORKING_DIRECTORY}"
LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
- )
+ )
+ endif()
if(_bc_ADD_BIN_TO_PATH)
set(ENV{PATH} "${_BACKUP_ENV_PATH}")
diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake
index 7097fbf1b..98e3648d5 100644
--- a/scripts/cmake/vcpkg_execute_build_process.cmake
+++ b/scripts/cmake/vcpkg_execute_build_process.cmake
@@ -65,6 +65,8 @@ function(vcpkg_execute_build_process)
# The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled.
OR err_contents MATCHES "Cannot create parent directory" OR err_contents MATCHES "Cannot write file"
# Multiple threads using the same directory at the same time cause conflicts, will try again.
+ OR err_contents MATCHES "Can't open"
+ # Multiple threads caused the wrong order of creating folders and creating files in folders
)
message(STATUS "Restarting Build without parallelism because memory exceeded")
set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out-1.log")