Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

build more versions #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .circleci/build-sdklt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ set -x
export YAML=/usr
export YAML_LIBDIR=$YAML/src/.libs

export KDIR=$HOME/linux-4.14.49-OpenNetworkLinux
KERNEL_VERSION=${KERNEL_VERSION:-4.14.49}
export KDIR=$HOME/linux-${KERNEL_VERSION}-OpenNetworkLinux

export TOOLCHAIN_DIR=/usr
export TARGET_ARCHITECTURE=""
Expand All @@ -24,11 +25,17 @@ export SDK=$SDKLT/src

cd $SDK/appl/demo
make TARGET_PLATFORM=xlr_linux clean -j
make TARGET_PLATFORM=xlr_linux -j 4

tar czf $HOME/sdklt-4.14.49.tgz \
-C $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/ linux_ngknet.ko \
-C $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/ linux_ngbde.ko \
-C $SDKLT/src/appl/demo/build/xlr_linux/ sdklt \
-C $SDKLT/src/appl/sdklib/build/xlr_linux/ include/sdklt \
-C $SDKLT/src/appl/sdklib/build/xlr_linux/ lib/libsdklt.a lib/libsdklt.so
make TARGET_PLATFORM=xlr_linux -j 2

TAR_FOLDER=/tmp/sdklt-${KERNEL_VERSION}
mkdir -p ${TAR_FOLDER}

cp -r $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/linux_ngknet.ko \
$SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/linux_ngbde.ko \
$SDKLT/src/appl/demo/build/xlr_linux/sdklt \
$SDKLT/src/appl/sdklib/build/xlr_linux/include \
$SDKLT/src/appl/sdklib/build/xlr_linux/lib \
${TAR_FOLDER}

tar czf $HOME/sdklt-${KERNEL_VERSION}.tgz \
-C /tmp sdklt-${KERNEL_VERSION}
79 changes: 56 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,80 @@

version: 2.1

jobs:
build:
docker:
- image: debian:testing
commands:
build-sdklt:
description: "Build SDKLT for a given Kernel version"
parameters:
kernel_version:
type: string
steps:
- run:
name: Setup build environment
command: |
apt update
apt install -y --no-install-recommends libyaml-dev python python-pip python-setuptools libelf-dev wget clang-8 gcc-9 make git ca-certificates ssh
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 10
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10
apt install -y --no-install-recommends libyaml-dev python python-pip python-setuptools libelf-dev wget make git ca-certificates ssh
pip install pyyaml
- run:
name: Get Kernel sources
command: |
pushd $HOME
wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/onlpv2-dev-1.0.1/linux-4.14.49-OpenNetworkLinux.tar.xz
tar xf linux-4.14.49-OpenNetworkLinux.tar.xz
rm linux-4.14.49-OpenNetworkLinux.tar.xz
wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/onlpv2-dev-1.0.1/linux-<< parameters.kernel_version >>-OpenNetworkLinux.tar.xz
tar xf linux-<< parameters.kernel_version >>-OpenNetworkLinux.tar.xz
rm linux-<< parameters.kernel_version >>-OpenNetworkLinux.tar.xz
popd
- checkout
- run:
name: Create build directory
command: mkdir -p ~/build
name: Create staging directory
command: mkdir -p ~/staging
- run:
name: Build SDKLT
command: |
export ADD_CFLAGS="-fomit-frame-pointer -O3"
.circleci/build-sdklt.sh
mv ~/sdklt-4.14.49.tgz ~/build/sdklt-4.14.49.tgz
KERNEL_VERSION=<< parameters.kernel_version >> .circleci/build-sdklt.sh
mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/staging/sdklt-<< parameters.kernel_version >>.tgz
- run:
name: Build SDKLT debug
command: |
export ADD_CFLAGS="-g -fno-omit-frame-pointer -O0 -fsanitize=address"
export ADD_LDFLAGS="-fsanitize=address"
.circleci/build-sdklt.sh
mv ~/sdklt-4.14.49.tgz ~/build/sdklt-debug-4.14.49.tgz
KERNEL_VERSION=<< parameters.kernel_version >> .circleci/build-sdklt.sh
mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/staging/sdklt-debug-<< parameters.kernel_version >>.tgz
- persist_to_workspace:
root: ~/build/
root: ~/staging/
paths:
- sdklt-4.14.49.tgz
- sdklt-debug-4.14.49.tgz
- sdklt-<< parameters.kernel_version >>.tgz
- sdklt-debug-<< parameters.kernel_version >>.tgz

jobs:
build-4-14-49:
docker:
- image: debian:testing
steps:
- run:
name: Setup compiler
command: |
apt update
apt install -y --no-install-recommends clang-8 gcc-9
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 10
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10
- build-sdklt:
kernel_version: "4.14.49"

build-3-16-56:
docker:
- image: debian:stretch
steps:
- run:
name: Setup compiler
command: |
apt update
apt install -y --no-install-recommends clang-4.0 gcc-6
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 10
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10
- build-sdklt:
kernel_version: "3.16.56"

publish-github-release:
docker:
Expand Down Expand Up @@ -89,16 +119,19 @@ workflows:
version: 2
sdklt:
jobs:
- build
- build-4-14-49
- build-3-16-56
- publish-github-release:
requires:
- build
- build-4-14-49
- build-3-16-56
filters:
branches:
only: master
- publish-github-pre-release:
requires:
- build
- build-4-14-49
- build-3-16-56
filters:
branches:
ignore: master