Skip to content

Commit

Permalink
(conan-io#3959) Boost/1.72.0/mpi
Browse files Browse the repository at this point in the history
* Enables Boost MPI when requested (boost:without_mpi=False)

The boost:without_mpi default value is switched to True (disabling Boost MPI support)

* Adds Boost:MPI configuration check when enabled

The mpi.jam file is patched to enable the error

* Applies patch to all version
  • Loading branch information
oleurodecision authored and AndreyMlashkin committed Jul 19, 2021
1 parent b548e06 commit a2fa0d7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
16 changes: 16 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.70.0:
- patch_file: "patches/0001-beast-fix-moved-from-executor.patch"
base_path: "source_subfolder"
Expand All @@ -73,6 +75,8 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.71.0:
- patch_file: "patches/bcp_namespace_issues_1_71.patch"
base_path: "source_subfolder"
Expand All @@ -86,6 +90,8 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.72.0:
- patch_file: "patches/bcp_namespace_issues_1_72.patch"
base_path: "source_subfolder"
Expand All @@ -103,27 +109,37 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.73.0:
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch"
base_path: "source_subfolder"
- patch_file: "patches/python_base_prefix.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.74.0:
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch"
base_path: "source_subfolder"
- patch_file: "patches/python_base_prefix_since_1_74.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.75.0:
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch"
base_path: "source_subfolder"
- patch_file: "patches/python_base_prefix_since_1_74.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
1.76.0:
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
base_path: "source_subfolder"
- patch_file: "patches/boost_mpi_check.patch"
base_path: "source_subfolder"
4 changes: 4 additions & 0 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,10 @@ def create_library_config(deps_name, name):
includes=self._python_includes,
libraries=self._python_libraries)

if not self.options.without_mpi:
# https://www.boost.org/doc/libs/1_72_0/doc/html/mpi/getting_started.html
contents += '\nusing mpi ;'

# Specify here the toolset with the binary if present if don't empty parameter :
contents += '\nusing "%s" : %s : ' % (self._toolset, self._toolset_version)

Expand Down
24 changes: 24 additions & 0 deletions recipes/boost/all/patches/boost_mpi_check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff -ru a/tools/build/src/tools/mpi.jam b/tools/build/src/tools/mpi.jam
--- a/tools/build/src/tools/mpi.jam 2019-12-10 01:20:16.000000000 +0100
+++ b/tools/build/src/tools/mpi.jam 2020-09-02 13:17:22.942349254 +0200
@@ -66,6 +66,8 @@
import type ;
import path ;

+import errors ;
+
# Make this module a project
project.initialize $(__name__) ;
project mpi ;
@@ -539,6 +541,11 @@
# Set up the "mpi" alias
alias mpi : : : : $(options) ;
}
+
+ if ! $(.configured)
+ {
+ errors.user-error "MPI not configured" ;
+ }
}

# States whether MPI has bee configured

0 comments on commit a2fa0d7

Please sign in to comment.