diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe06a51 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +build +build-* diff --git a/.gitignore b/.gitignore index bddc66e..1c499f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .idea -*build* +build-* +build +slowmoFlowBuilder diff --git a/Dockerfile-ubuntu2004 b/Dockerfile-ubuntu2004 new file mode 100644 index 0000000..47278b1 --- /dev/null +++ b/Dockerfile-ubuntu2004 @@ -0,0 +1,10 @@ +FROM ubuntu:20.04 + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y freeglut3-dev libopencv-dev libglew-dev cmake build-essential + +RUN apt-get install -y cmake build-essential + +WORKDIR /_build + +CMD [ "/bin/sh", "./build.sh" ] diff --git a/Dockerfile-ubuntu2204 b/Dockerfile-ubuntu2204 new file mode 100644 index 0000000..220b1ac --- /dev/null +++ b/Dockerfile-ubuntu2204 @@ -0,0 +1,10 @@ +FROM ubuntu:22.04 + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y freeglut3-dev libopencv-dev libglew-dev cmake build-essential + +RUN apt-get install -y cmake build-essential + +WORKDIR /_build + +CMD [ "/bin/sh", "./build.sh" ] diff --git a/README.md b/README.md index 8608ded..c4295ea 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,21 @@ It can be used by slowmoVideo. ## Building -On Ubuntu 20.04, install the requirements `freeglut3-dev libopencv-dev libglew-dev ` +Before building, get the latest version with the following command: ```bash +# Get the latest commit of this branch +git pull --rebase + +# Update the libSvFlow submodule to the correct commit git submodule update --init +``` + +### Ubuntu 20.04 + +On Ubuntu 20.04, install the requirements `freeglut3-dev libopencv-dev libglew-dev ` + +```bash mkdir build cd build cmake .. @@ -20,3 +31,18 @@ make # or install: sudo make install ``` + +### Docker + +You can build slowmoFlowBuilder with Docker for different target systems. +Currently, Ubuntu 20.04 and Ubuntu 22.04 are supported. + +```bash +# Build the docker image which will build slowmoFlowBuilder +# For Ubuntu 20.04: use Dockerfile-ubuntu2004 instead +docker build . -t v3d-builder -f Dockerfile-ubuntu2204 + +# Build v3d-flow-builder inside the docker image. +# The executable will be copied to the working directory. +docker run -it --rm -v $(pwd):/_build -u $(id -u) v3d-builder +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..b38ece8 --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +mkdir -p build-docker +cd build-docker +cmake .. +make +cp src/slowmoFlowBuilder ..