This repository was archived by the owner on Aug 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed
Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change 44"""
55import os
66import sys
7+ import pathlib
8+ import inspect
9+ import tempfile
710import contextlib
11+ import subprocess
812import importlib .util
913
1014
@@ -58,8 +62,39 @@ def check_daal4py():
5862 return bool (spec is not None )
5963
6064
65+ def check_boost ():
66+ # TODO Implement check on Windows
67+ if os .name == "nt" :
68+ return True
69+ with tempfile .TemporaryDirectory () as tempdir :
70+ c_file = pathlib .Path (tempdir , "main.c" )
71+ c_file .write_text (
72+ inspect .cleandoc (
73+ r"""
74+ #include <boost/version.hpp>
75+
76+ int main() {
77+ return 0;
78+ }
79+ """
80+ )
81+ )
82+ return bool (
83+ subprocess .call (
84+ ["c++" , str (c_file )],
85+ cwd = tempdir ,
86+ stdout = subprocess .DEVNULL ,
87+ stderr = subprocess .DEVNULL ,
88+ )
89+ == 0
90+ )
91+
92+
6193CORE_PLUGIN_DEPS = {
62- ("model" , "vowpalWabbit" ): {"cmake" : lambda : inpath ("cmake" )},
94+ ("model" , "vowpalWabbit" ): {
95+ "cmake" : lambda : inpath ("cmake" ),
96+ "boost" : check_boost ,
97+ },
6398 ("model" , "autosklearn" ): {
6499 "swig" : lambda : inpath ("swig" ),
65100 "cython" : lambda : inpath ("cython" ),
You can’t perform that action at this time.
0 commit comments