GithubHelp home page GithubHelp logo

Issue in installing BMV2 about stratum HOT 10 CLOSED

stratum avatar stratum commented on May 24, 2024
Issue in installing BMV2

from stratum.

Comments (10)

drobinkent avatar drobinkent commented on May 24, 2024

After doing the steps freshly, when I try to complete the step of "Running the stratum_bmv2 binary
"

I face following problem

bazel build //stratum/hal/bin/bmv2:stratum_bmv2
ERROR: /home/deba/stratum/bazel/workspace_rule.bzl:19:1: load() statements must be called before any other statement. First non-load() statement appears at /home/deba/stratum/bazel/workspace_rule.bzl:17:1. Use --incompatible_bzl_disallow_load_after_statement=false to temporarily disable this check.
ERROR: error loading package '': in /home/deba/stratum/bazel/rules/build_tools.bzl: Extension 'bazel/workspace_rule.bzl' has errors
ERROR: error loading package '': in /home/deba/stratum/bazel/rules/build_tools.bzl: Extension 'bazel/workspace_rule.bzl' has errors
INFO: Elapsed time: 0.075s
INFO: 0 processes.

Any help ?

from stratum.

Yi-Tseng avatar Yi-Tseng commented on May 24, 2024

Hi @drobinkent , We are using Bazel version 0.23.2 in our environment and plain to upgrade the Bazel version to 1.0.0

If you want to try new version of Bazel, please follow the suggestion from your Bazel log to build it:

Use --incompatible_bzl_disallow_load_after_statement=false to temporarily disable this check.

from stratum.

playsand avatar playsand commented on May 24, 2024

I have a problem when I executed "bazel build //stratum/hal/bin/bmv2:stratum_bmv2"

bazel build //stratum/hal/bin/bmv2:stratum_bmv2  --incompatible_bzl_disallow_load_after_statement=false  --incompatible_disable_deprecated_attr_params=false
INFO: Writing tracer profile to '/root/.cache/bazel/_bazel_root/096eb34d74939df26d8ec3f987c86d06/command.profile.gz'
ERROR: /root/stratum/stratum/hal/bin/bmv2/BUILD:24:1: file '//bazel:rules.bzl' does not contain symbol 'stratum_cc_binary'
ERROR: /root/stratum/stratum/hal/bin/bmv2/BUILD:26:1: name 'stratum_cc_binary' is not defined
ERROR: error loading package 'stratum/hal/bin/bmv2': Package 'stratum/hal/bin/bmv2' contains errors
INFO: Elapsed time: 3.141s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)

from stratum.

Yi-Tseng avatar Yi-Tseng commented on May 24, 2024

I would suggest using the containerized environment to build the Stratum. It should include every necessary libraries and tool to build the binary.
https://github.com/stratum/stratum#development-environment

The ./setup_dev_env.sh script mounts the Stratum dir into the container, so you can edit the code using your IDE on your host machine and get the binary from the host machine after it compiled.

from stratum.

pudelkoM avatar pudelkoM commented on May 24, 2024

Closing for now. Please reopen if the issues still persist.

from stratum.

drobinkent avatar drobinkent commented on May 24, 2024

The issue persists.

DEBUG: Call stack for the definition of repository 'build_stack_rules_proto' which is a http_archive (rule definition at /home/deba/.cache/bazel/_bazel_deba/867697089ae78c5b510d61904b21961d/external/bazel_tools/tools/build_defs/repo/http.bzl:262:16):
 - /home/deba/stratum/bazel/workspace_rule.bzl:62:5
 - /home/deba/stratum/bazel/workspace_rule.bzl:144:22
 - /home/deba/stratum/bazel/deps.bzl:87:9
 - /home/deba/stratum/WORKSPACE:55:1
ERROR: /home/deba/stratum/stratum/hal/bin/bmv2/BUILD:24:1: file '//bazel:rules.bzl' does not contain symbol 'stratum_cc_binary'
ERROR: /home/deba/stratum/stratum/hal/bin/bmv2/BUILD:26:1: name 'stratum_cc_binary' is not defined
ERROR: error loading package 'stratum/hal/bin/bmv2': Package 'stratum/hal/bin/bmv2' contains errors
INFO: Elapsed time: 25.817s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)

Any help will be highly appreciated.

I need to work with the bmv2 project and stratum project together. If you have the script for building the whole project with bmv2, that would be really great.

from stratum.

pudelkoM avatar pudelkoM commented on May 24, 2024

Can you confirm you are using Bazel 0.23.2? (bazel version)

I also think the README is outdated about installing PI and bmv2 first. Building bmv2 (//stratum/hal/bin/bmv2:stratum_bmv2) in the dev container just works out-of-the-box.

Are you trying a native build?

from stratum.

drobinkent avatar drobinkent commented on May 24, 2024

Returning back to bazel 0.23.2 solves the problem of installing bmv2.

Yes, I am trying a native build.

from stratum.

drobinkent avatar drobinkent commented on May 24, 2024

Where to find the details of native installation?

from stratum.

pudelkoM avatar pudelkoM commented on May 24, 2024

There are no instructions for that. Your best bet is mimicking the build docker image as close as possible.
I was also wrong about the PI/bmv2 deps, we still install them.

I might be easier to build in docker and then copy the binary out.

from stratum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.