-
Notifications
You must be signed in to change notification settings - Fork 170
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
Build Errors on Mac OS #849
Comments
Simply rerunning the above command results in a different error which makes me think that maybe there is something wrong with the configuration?
I assume this is because bazel is running with the wrong C++ version where |
Resolved the previous problem by passing |
Okay, using the patch from hdl/bazel_rules_hdl#141, the above error is fixed but now there is a new error about constant expressions:
or non-deterministically:
|
StrSplit
We only build and test XLS on Ubuntu so we can't guarantee much will work on other platforms. The option In any case, the immediate build problem you point to looks like unintential narrowing which we'll fix. |
Another note: need to |
Unfortunately the
From running the command:
|
@rachitnigam Python targets will have issues with the hermetic toolchain, but all the cc_binary / cc_test targets should be ok. (That one you're running is looks like a Python target even though it doesn't have Python explicitly in the target name.) I think changing |
TL;DROn my M1 (12.5) I am able to able to build all of the bazel build -c opt --sandbox_debug \
--extra_toolchains=@llvm_toolchain//:cc-toolchain-aarch64-darwin \
//xls/dslx:interpreter_main \
//xls/dslx/ir_convert:ir_converter_main \
//xls/tools:opt_main \
//xls/tools:codegen_main \
//xls/tools:proto_to_dslx_main \
//xls/tools:package_bazel_build \
//xls/public/python:builder \
//xls/common:xls_error \
//xls/common:memoize \
//xls/common:runfiles \
//xls/common:multiprocess \
//xls/common:test_base \
//xls/common:gfile \
//xls/common:check_simulator \
//xls/common:revision \
//xls/common/file/python:filesystem \
//xls/delay_model:delay_model \
//xls/delay_model:op_module_generator \
//xls/synthesis:client_credentials \
//xls/synthesis:synthesis_utils \
//xls/synthesis:timing_characterization_client \
//xls/solvers/python:lec_characterizer \
//xls/ir:op_specification_typechecked \
//xls/fuzzer:cli_helpers \
//xls/fuzzer:run_fuzz \
//xls/fuzzer:sample_runner \
//xls/fuzzer:run_fuzz_multiprocess_lib \
//xls/experimental/smtlib:flags_checks \
//xls/experimental/smtlib:n_bit_nested_add_generator \
//xls/experimental/smtlib:n_bit_nested_mul_generator \
//xls/experimental/smtlib:n_bit_nested_shift_generator \
//xls/experimental/smtlib:solvers_op_comparison_functions \
//xls/public/python:runtime_build_actions \
//xls/common/python:init_xls \
//xls/codegen/python:module_signature \
//xls/codegen/python:pipeline_generator \
//xls/simulation/python:module_simulator \
//xls/solvers/python:z3_lec \
//xls/ir/python:bits \
//xls/ir/python:fileno \
//xls/ir/python:function \
//xls/ir/python:function_builder \
//xls/ir/python:ir_parser \
//xls/ir/python:lsb_or_msb \
//xls/ir/python:package \
//xls/ir/python:source_location \
//xls/ir/python:type \
//xls/ir/python:op \
//xls/ir/python:value \
//xls/ir/python:verifier \
//xls/passes/python:standard_pipeline \
//xls/fuzzer/python:cpp_ast_generator \
//xls/fuzzer/python:cpp_sample \
//xls/dslx/python:ast \
//xls/dslx/python:interp_value \
//xls/dslx/python:create_import_data \
//xls/dslx/python:parse_and_typecheck \
//xls/dslx/python:interpreter \
//xls/tools/python:eval_helpers \
//xls/visualization/ir_viz/python:ir_to_json using this patch diff --git a/.bazelrc b/.bazelrc
index 077f5fa4..7068016e 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,10 +1,17 @@
build --action_env=BAZEL_CXXOPTS=-std=c++17
+build --action_env=PYTHON_BIN_PATH=/Users/mlevental/miniforge3/envs/xls/bin/python
+build --repo_env PYTHON_BIN_PATH=/Users/mlevental/miniforge3/envs/xls/bin/python
build --cxxopt "-std=c++17"
+build --cxxopt "-Wno-deprecated-builtins"
build --copt "-Wno-sign-compare"
+build --copt "-Wno-deprecated-builtins"
build --copt "-Wno-comment"
build --host_copt "-Wno-sign-compare"
+build --host_copt "-Wno-deprecated-builtins"
build --host_copt "-Wno-comment"
# TODO(leary): 2020-09-09 Make it possible to enable this option.
# Currently m4 doesn't seem to work as a dependency.
# build --crosstool_top=@llvm_toolchain_llvm//:toolchain
+build --incompatible_enable_cc_toolchain_resolution
diff --git a/dependency_support/pip_requirements.txt b/dependency_support/pip_requirements.txt
index 2adb5d6e..9ebe4bc9 100644
--- a/dependency_support/pip_requirements.txt
+++ b/dependency_support/pip_requirements.txt
@@ -12,5 +12,5 @@ pyyaml==5.4.1
# Note: numpy and scipy version availability seems to differ between Ubuntu
# versions that we want to support (e.g. 18.04 vs 20.04), so we accept a
# range that makes successful installation on those platforms possible.
-numpy>=1.21
-scipy>=1.5.4,<=1.8.1
+numpy
+scipy
diff --git a/xls/common/subprocess.cc b/xls/common/subprocess.cc
index 866e723f..c796db28 100644
--- a/xls/common/subprocess.cc
+++ b/xls/common/subprocess.cc
@@ -19,6 +19,7 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <csignal>
#include <cerrno>
#include <cstdlib>
#include <cstring> ExplanationOf key changes (in my understanding):
Note, for Possibly I did some things wrong (I'm not super familiar with bazel). FYI I would like to get python wheels working (to make prototyping a frontend easier). UpdateBy adding diff --git a/xls/BUILD b/xls/BUILD
index 2750753e..86ebf444 100644
--- a/xls/BUILD
+++ b/xls/BUILD
@@ -70,3 +70,85 @@ package_group(
packages = ["//..."],
)
# LINT.ThenChange(//xls/BUILD)
+
+
+load("@rules_python//python:packaging.bzl", "py_package")
+load("@rules_python//python:packaging.bzl", "py_wheel")
+
+# Use py_package to collect all transitive dependencies of a target,
+# selecting just the files within a specific python package.
+py_package(
+ name = "pyxls",
+ # Only include these Python packages.
+ packages = [
+"xls.public.python.runtime_build_actions",
+"xls.common.python.init_xls",
+"xls.codegen.python.module_signature",
+"xls.codegen.python.pipeline_generator",
+#"xls.simulation.python.module_simulator",
+#"xls.solvers.python.z3_lec",
+"xls.ir.python.bits",
+"xls.ir.python.fileno",
+"xls.ir.python.function",
+"xls.ir.python.function_builder",
+"xls.ir.python.ir_parser",
+"xls.ir.python.lsb_or_msb",
+"xls.ir.python.package",
+"xls.ir.python.source_location",
+"xls.ir.python.type",
+"xls.ir.python.op",
+"xls.ir.python.value",
+"xls.ir.python.verifier",
+#"xls.passes.python.standard_pipeline",
+"xls.fuzzer.python.cpp_ast_generator",
+"xls.fuzzer.python.cpp_sample",
+"xls.dslx.python.ast",
+"xls.dslx.python.interp_value",
+"xls.dslx.python.create_import_data",
+"xls.dslx.python.parse_and_typecheck",
+"xls.dslx.python.interpreter",
+"xls.tools.python.eval_helpers",
+"xls.visualization.ir_viz.python.ir_to_json",
+ ],
+ deps = [
+"//xls/public/python:runtime_build_actions",
+"//xls/common/python:init_xls",
+"//xls/codegen/python:module_signature",
+"//xls/codegen/python:pipeline_generator",
+#"//xls/simulation/python:module_simulator",
+#"//xls/solvers/python:z3_lec",
+"//xls/ir/python:bits",
+"//xls/ir/python:fileno",
+"//xls/ir/python:function",
+"//xls/ir/python:function_builder",
+"//xls/ir/python:ir_parser",
+"//xls/ir/python:lsb_or_msb",
+"//xls/ir/python:package",
+"//xls/ir/python:source_location",
+"//xls/ir/python:type",
+"//xls/ir/python:op",
+"//xls/ir/python:value",
+"//xls/ir/python:verifier",
+#"//xls/passes/python:standard_pipeline",
+"//xls/fuzzer/python:cpp_ast_generator",
+"//xls/fuzzer/python:cpp_sample",
+"//xls/dslx/python:ast",
+"//xls/dslx/python:interp_value",
+"//xls/dslx/python:create_import_data",
+"//xls/dslx/python:parse_and_typecheck",
+"//xls/dslx/python:interpreter",
+"//xls/tools/python:eval_helpers",
+"//xls/visualization/ir_viz/python:ir_to_json",
+"@pybind11_abseil//pybind11_abseil:absl_casters",
+"@pybind11_abseil//pybind11_abseil:statusor_caster",
+ ],
+)
+
+py_wheel(
+ name = "pyxls_wheel",
+ # Package data. We're building "example_minimal_package-0.0.1-py3-none-any.whl"
+ distribution = "pyxls",
+ python_tag = "py3",
+ version = "0.0.1",
+ deps = [":pyxls"],
+) then running bazel build -c opt --sandbox_debug \
--extra_toolchains=@llvm_toolchain//:cc-toolchain-aarch64-darwin \
//xls:pyxls_wheel I get a wheel at (xls) wheelhouse % unzip pyxls-0.0.1-py3-none-any.whl
...
(xls) wheelhouse % cp -R ../bazel-xls/bazel-out/darwin_arm64-opt/bin/xls/public/python/builder_test.runfiles/pybind11_abseil .
(xls) wheelhouse % cp -R ../bazel-xls/bazel-out/darwin_arm64-opt/bin/_solib_darwin . and then I am able to get (xls) wheelhouse % PYTHONPATH=. python function_builder_test.py
Running tests under Python 3.9.16: /Users/mlevental/miniforge3/envs/xls/bin/python
[ RUN ] FunctionBuilderTest.test_all_add_methods
[ OK ] FunctionBuilderTest.test_all_add_methods
[ RUN ] FunctionBuilderTest.test_bvalue_methods
[ OK ] FunctionBuilderTest.test_bvalue_methods
[ RUN ] FunctionBuilderTest.test_invoke_adder_2_plus_3_eq_5
[ OK ] FunctionBuilderTest.test_invoke_adder_2_plus_3_eq_5
[ RUN ] FunctionBuilderTest.test_literal_array
[ OK ] FunctionBuilderTest.test_literal_array
[ RUN ] FunctionBuilderTest.test_match_true
[ OK ] FunctionBuilderTest.test_match_true
[ RUN ] FunctionBuilderTest.test_simple_build_and_dump_package
[ OK ] FunctionBuilderTest.test_simple_build_and_dump_package
----------------------------------------------------------------------
Ran 6 tests in 0.001s
OK Obviously I'm doing a whole bunch of things manually that bazel can do for me - would appreciate some advice. Possibly |
@makslevental I think the plan of record is to revisit the approach described in one of the paragraph of #108 (comment) w/ higher level CFFI bindings filed #1256 to track this. |
I'm trying to build XLS from source on a mac os machine with the following command line invocation:
(The additional
--action_env
is for another error I was running into where the python autoconfiguration was failing because it was trying to access an empty include folder)I get the following build error:
It seems that for some reason it can neither convert the arguments to the right type to match a string split call, nor match against one of the other overloaded methods.
I'm not profoundly familiar with debugging with bazel so couldn't explore any deeper but would be happy to be linked to other resources and run more commands to investigate
The text was updated successfully, but these errors were encountered: