Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost.python requires numpy. Fix function _run_python_script(). #5643

Merged
merged 2 commits into from
Jun 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import shlex
import shutil
import yaml
import re

try:
from cStringIO import StringIO
Expand Down Expand Up @@ -385,6 +386,13 @@ def validate(self):
if min_compiler_version is not None:
if tools.Version(self.settings.compiler.version) < min_compiler_version:
raise ConanInvalidConfiguration("Boost.Math requires a C++11 capable compiler")

if not self.options.without_python:
#Boost python library build will fail if python package numpy is not installed
try:
import numpy
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
except ImportError as e:
raise ConanInvalidConfiguration("Boost.python library requires numpy but this is not installed in your python environment")

def build_requirements(self):
if not self.options.header_only:
Expand Down Expand Up @@ -478,6 +486,8 @@ def _run_python_script(self, script):
# Conan is broken when run_to_output = True
if "\n-----------------\n" in output:
output = output.split("\n-----------------\n", 1)[1]
elif re.search('\n----+$', output) != None:
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
output = ''
return output if output != "None" else None

def _get_python_path(self, name):
Expand Down