Coder Social home page Coder Social logo

centos-p4-scl's Introduction

SCL P4 Repository with the SCL environment

The repository containes files required for building and translation of projects related to P4 language.

Currently, the environment allows to build and use:

How to build packages

This SCL environment is prepared for the Centos 7, Centos Stream 8 and Centos Stream 9 Releases

Currently available spec files:

  • centos7/p4scl.spec - SPEC file with libs to build mentioned projects.
  • centos7/p4scl-tool.spec - SPEC file with tools (p4c, behavioral model). It requies packages RPM packages builded from the p4scl.spec file. The environment contains everything from p4scl.spec packages.
  • centos-stream8/p4scl.spec - SPEC file with libs to build mentioned projects.
  • centos-stream8/p4scl-tool.spec - SPEC file with tools (p4c, behavioral model). It requies packages RPM packages builded from the p4scl.spec file. The environment contains everything from p4scl.spec packages.
  • centos-stream9/p4scl.spec - SPEC file with libs to build mentioned projects.
  • centos-stream9/p4scl-tool.spec - SPEC file with tools (p4c, behavioral model). It requies packages RPM packages builded from the p4scl.spec file. The environment contains everything from p4scl.spec packages.

Centos Stream 9

Install plugins and enable CRB repo:

dnf install -y dnf-plugins-core
dnf config-manager --set-enabled crb

Install following packages which are required for the build:

dnf install autoconf automake binutils bison flex gcc gcc-c++ gdb glibc-devel libtool make pkgconf pkgconf-m4 pkgconf-pkg-config redhat-rpm-config rpm-build rpm-sign strace asciidoc byacc diffstat git intltool jna ltrace patchutils perl-Fedora-VSP perl-generators pesign source-highlight systemtap valgrind valgrind-devel cmake expect rpmdevtools rpmlint scl-utils scl-utils-build wget binutils cmake python3-pip openssl-devel boost-devel boost-static libffi-devel boost-devel python3-devel libpcap-devel gc-devel python3-wheel python3-cffi

The P4 Environment package can be builded like following:

rpmbuild -bb p4scl.spec --define 'scl p4lang-p4'

Install generated RPMS (find the rpmbuild folder):

dnf localinstall ~/rpmbuild/RPMS/*/*.rpm

After the instalation you can run the environment:

scl enable p4lang-p4 bash

Very similarly can be build the package with tools. You can also run the compile-and-install.sh script which removes all p4lang packages in the system. The script builds RPM packages and install everything from scratch. You can also inspect that file to see how you can build all RPM packages.

Centos Stream 8

Install the EPEL and dnf plugins:

dnf install epel-release dnf-plugins-core

We also need to enable the PowerTools repository (to get some libs):

dnf config-manager --set-enabled powertools

Install following packages which are required for the build:

dnf install autoconf automake binutils bison flex gcc gcc-c++ gdb glibc-devel libtool make pkgconf pkgconf-m4 pkgconf-pkg-config redhat-rpm-config rpm-build rpm-sign strace asciidoc byacc ctags diffstat git intltool jna ltrace patchutils perl-Fedora-VSP perl-generators pesign source-highlight systemtap valgrind valgrind-devel cmake expect rpmdevtools rpmlint scl-utils scl-utils-build wget binutils cmake python3-pip python3-pip openssl-devel boost169-devel boost169-static libffi-devel boost-devel python3-devel python36-devel libpcap-devel gc-devel ccache python3-cffi python3-wheel

The P4 Environment package can be builded like following:

rpmbuild -bb p4scl.spec --define 'scl p4lang-p4'

Install generated RPMS (find the rpmbuild folder):

dnf localinstall ~/rpmbuild/RPMS/*/*.rpm

After the installation you can run the environment:

scl enable p4lang-p4 bash

Very similarly can be build the package with tools. You can also run the compile-and-install.sh script which removes all p4lang packages in the system. The script builds RPM packages and install everything from scratch. You can also inspect that file to see how you can build all RPM packages.

Centos 7

In Centos 7, these packages are available in centos-release-scl-rh or centos-release-scl. So, you need to additionally install these packages:

yum install centos-release-scl-rh epel-release

Install following packages which are required for the build:

yum install scl-utils scl-utils-build rpm-build devtoolset-9 wget binutils cmake3 git autoconf automake libtool python-pip libatomic_ops-devel bison flex openssl-devel boost169-devel boost-devel-static python2-devel python3-devel python2-pip python3-pip python-cffi python36-cffi

The P4 Environment package can be builded like following:

rpmbuild -bb p4scl.spec --define 'scl p4lang-p4'

Install generated RPMS (find the rpmbuild folder):

yum localinstall ~/rpmbuild/RPMS/*/*.rpm

After the installation you can run the environment:

``bash scl enable p4lang-p4 bash


#### P4C Patch

The Centos 7 build is using the devtoolset-10 for compilation of all tools and libraries. The P4C project needs to be patched (so far) because it overloads some libstdc++ functions to achieve nicer error prints.
The not patched version leads to a situation that compilation fails during the linking. The patch itself comments out all multiple defined functions in `lib/backtrack.cpp` file. However, the community is already solving this and
I am hoping that this hack will be removed in near future.

## Sources

SCL build documentation: https://www.softwarecollections.org/en/docs/guide/

## Authors:

* Pavel Benáček

Contributions from other authors are welcomed!!

P.S. Sorry if something is not perfect but I am using the [Debian](https://www.debian.org) and this is one of my first attempt for RPMs :-). If you want to improve something, feel free to send me a merge request ;-).

centos-p4-scl's People

Contributors

benycze avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.