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

Improve Unikraft support in build files #9

Merged
Merged
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
332 changes: 0 additions & 332 deletions L2E_amd64_qemu.config

This file was deleted.

12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@ run_clang_static_strlit: ## - Optimized Static clang + embedded model build
./strlit -i emb_Model_data $(MOD_PATH) model.h
./strlit -i emb_Tokenizer_data $(TOK_PATH) tokenizer.h
clang -Ofast -static -march=native -D STRLIT -D LLOOP run.c -lm -o run

# Unikraft Unikernel build
.PHONY: run_unik_qemu_x86_64
run_unik_qemu_x86_64: run.c
[ ! -d "UNIK" ] && echo "Cloning unikraft and musl sources..." || true
[ ! -d "UNIK/unikraft" ] && git clone https://github.com/unikraft/unikraft UNIK/unikraft || true
[ ! -d "UNIK/libs/musl" ] && git clone https://github.com/unikraft/lib-musl UNIK/libs/musl || true
UK_DEFCONFIG=$(shell pwd)/defconfigs/qemu-x86_64 make -f Makefile.unikernel defconfig
gcc -Ofast strliteral.c -o strlit
./strlit -i emb_Model_data $(MOD_PATH) model.h
./strlit -i emb_Tokenizer_data $(TOK_PATH) tokenizer.h
make -f Makefile.unikernel

# Build for termux on Android
##@ ---> Android
Expand Down
7 changes: 0 additions & 7 deletions Makefile.unikernel
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
UK_ROOT ?= $(PWD)/UNIK/unikraft
UK_LIBS ?= $(PWD)/UNIK/libs
LIBS := $(UK_LIBS)/musl
# Model / Tokenizer Paths
MOD_PATH = out/model.bin
TOK_PATH = tokenizer.bin

all:
cp L2E_amd64_qemu.config .config
gcc -Ofast strliteral.c -o strlit
./strlit -i emb_Model_data $(MOD_PATH) model.h
./strlit -i emb_Tokenizer_data $(TOK_PATH) tokenizer.h
@$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS)

$(MAKECMDGOALS):
Expand Down
8 changes: 8 additions & 0 deletions defconfigs/qemu-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_UK_DEFNAME="L2E"
CONFIG_PLAT_KVM=y
CONFIG_LIBUKBOOT_BANNER_NONE=y
CONFIG_LIBUKBUS=y
# CONFIG_LIBUKDEBUG_ENABLE_ASSERT is not set
CONFIG_LIBUKSGLIST=y
CONFIG_OPTIMIZE_DEADELIM=y
CONFIG_OPTIMIZE_LTO=y