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

Update setup guides to include DEPEND_INSTALL env var #266

Closed
wants to merge 1 commit into from

Conversation

5abeel
Copy link
Collaborator

@5abeel 5abeel commented Aug 29, 2023

Setup guides had details setting DEPEND_INSTALL environment variable set after usage in previous section. Updating to re-order to set the DEPEND_INSTALL environment variable, and using it in the cmake command

Copy link
Contributor

@nupuruttarwar nupuruttarwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ffoulkes ffoulkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some reservations about doing this.

In the nomenclature used by the cmake listfiles, INSTALL is used for input install trees. PREFIX is used for output install trees.

Things get hairier when you're building for ES2K. There, you have two sets of dependency libraries: the host dependencies, which are built for the development system (nominally x86), and the target dependencies, which are built for the runtime system (nominally aarch64).

When we're building in the native environment, we use the same dependency libraries for both development and runtime systems. This is also true for ES2K if we are running P4 Control Plane on one of the x86 host cores. In both cases, DEPEND_INSTALL provides the path to the x86 dependencies.

When we're cross-compiling for the ACC:

  • The environment variable for the host dependencies is HOST_INSTALL. It is the path to the x86 libraries.
  • The environment variable for the target dependencies is DEPEND_INSTALL. It is the path to the aarch64 libraries.

You have to build the dependencies twice for cross-compilation. We provide a pair of helper scripts for the ES2K dependency builds, make-host-deps.sh and make-cross-deps.sh. You have to build the host dependencies first, because you need them to build the target dependencies.

The chances for confusion are high. To try to reduce this confusion, the helper scripts use distinct terminology:

  • --deps (-D) for the input target dependency tree, or the sole dependency tree if you're building in native mode
  • --host (-H) for the input host dependencies, used only when cross-compiling
  • --prefix (-P) for the output install tree

I make a point of using actual file paths (or, in some cases, purpose-specific environment variables) for CMAKE_INSTALL_PREFIX in the examples I create. You can damage things if you write to the wrong location. Better to be explicit.

I'm worried that using DEPEND_INSTALL as an output variable will muddy the waters.

@ffoulkes
Copy link
Contributor

dfoster@dgfoster-mobl1:~/latest$ ./make-all.sh -h

Configure and build P4 Control Plane software

Paths:
  --deps=DIR       -D  Target dependencies directory [/opt/deps]
  --host=DIR       -H  Host dependencies directory []
  --ovs=DIR        -O  OVS install directory [ovs/install]
  --prefix=DIR     -P  Install directory prefix [install]
  --sde=DIR        -S  SDE install directory [/home/dfoster/mev-p4-sde/install]
  --staging=DIR        Staging directory prefix []
  --toolchain=FILE -T  CMake toolchain file

[redacted]

Environment variables:
  CMAKE_TOOLCHAIN_FILE - Default toolchain file
  DEPEND_INSTALL - Default target dependencies directory
  HOST_INSTALL - Default host dependencies directory
  OVS_INSTALL - Default OVS install directory
  SDE_INSTALL - Default SDE install directory

@ffoulkes ffoulkes added documentation Improvements or additions to documentation question Further information is requested labels Oct 5, 2023
@5abeel 5abeel closed this Oct 12, 2023
@5abeel 5abeel deleted the documentation branch October 12, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants