-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce "Hello, world" application example in C++
Signed-off-by: Alexander Jung <[email protected]>
- Loading branch information
Showing
6 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
spec: v0.6 | ||
|
||
name: helloworld | ||
|
||
unikraft: | ||
version: stable | ||
kconfig: | ||
CONFIG_LIBPOSIX_SYSINFO: y | ||
CONFIG_LIBUKSIGNAL: y | ||
|
||
targets: | ||
- linuxu/x86_64 | ||
- qemu/x86_64 | ||
- xen/x86_64 | ||
- qemu/arm64 | ||
- fc/x86_64 | ||
|
||
libraries: | ||
libcxxabi: stable | ||
libcxx: stable | ||
libunwind: stable | ||
compiler-rt: | ||
version: stable | ||
kconfig: | ||
CONFIG_LIBCOMPILER_RT: 'y' | ||
musl: stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$(eval $(call addlib,apphelloworldcpp)) | ||
|
||
APPHELLOWORLDCPP_SRCS-y += $(APPHELLOWORLDCPP_BASE)/main.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Simple "Hello, world!" C++ Program on Unikraft | ||
|
||
This directory contains an example "Hello, world!" application written in C++. | ||
|
||
To run this example, [install Unikraft's companion command-line toolchain `kraft`](https://unikraft.org/docs/cli). | ||
|
||
Then, clone this repository and cd into this directory. | ||
You can then build the project with: | ||
|
||
``` | ||
kraft build | ||
``` | ||
|
||
In the above command, `kraft build` will prompt you with the target you wish to compile for. | ||
If you are unsure, select `qemu/` and your host's architecture, e.g. `qemu/x86_64`. | ||
|
||
Once built, you can execute the unikernel via: | ||
|
||
``` | ||
kraft run | ||
``` | ||
|
||
## Learn more | ||
|
||
- [How to build unikernels](https://unikraft.org/docs/cli/building) | ||
- [How to run unikernels locally](https://unikraft.org/docs/cli/running) | ||
- [The `Kraftfile` specification](https://unikraft.org/docs/cli/reference/kraftfile/latest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << "Hello World!" << std::endl; | ||
return 0; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.