How to setup - mhirano/islay GitHub Wiki
islay is designed to be cross-platform but it's currently verified with Ubuntu (18.04LTS, 20.04LTS) and Mac (newer than High-Sierra).
Check below to learn how to setup and be ready to drink :tumbler_glass:
There two ways to setup islay
- Setup on local environment
Install all the dependencies in your local environment. - Setup on Docker (only for ubuntu, experimental)
Setup build environment for islay in Docker and access to the container using SSH.
CLion provides a powerful way for remote build via SSH.
Note it seems almost no overhead for virtualization by Docker on Ubuntu.
This is not fully verified for now.
1. Setup on local environment
(Note islay is hosted on GitHub as a public template reposity. You can generate a repo using this template instead of git clone
)
On Ubuntu
1. Install dependencies
OpenCV
for image processingBoost
for file system- Dependencies for Dear ImGui
SDL2
for OpenGL libraryGLFW
for OpenGL libraryGLM
for math library for graphicsGLEW
for OpenGL library
sudo apt update # Be sure to update repository sudo apt install -y libsdl2-dev sudo apt install -y libx11-dev xorg-dev libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev sudo apt install -y libglfw3 libglfw3-dev sudo apt install -y libglm-dev sudo apt install -y libglew-dev
2. Build
git clone https://github.com/mhirano/islay.git --recursive
mkdir build
cd build
cmake -DOpenCV_DIR=/path_to_your_opencv/
make
On Mac
1. Install dependencies
Homebrew is a package manager for Mac. Visit https://brew.sh/index_ja to install Homebrew.
OpenCV
for image processing
Build OpenCV by yourself or via Homebrew.brew install opencv
Boost
for file systembrew install boost
- Dependencies for Dear ImGui
SDL2
for OpenGL libraryGLFW
for OpenGL libraryGLM
for math library for graphicsGLEW
for OpenGL library
brew install sdl2 brew install glfw brew install glm brew install glew
2. Build
git clone https://github.com/mhirano/islay.git --recursive
mkdir build
cd build
cmake -DOpenCV_DIR=/path_to_your_opencv/
make
On Windows 64bit (in preparation)
1. Install dependencies
OpenCV
with extra module for image processingBoost
for file system- Dependencies for Dear ImGui
vcpkg
provides an incredibly easy way to install all the dependenciesSDL2
for OpenGL libraryGLFW
for OpenGL libraryGLM
for math library for graphicsGLEW
for OpenGL library
vcpkg install sdl2:x64-windows vcpkg install glfw3:x64-windows vcpkg install glm:x64-windows vcpkg install glew:x64-windows
2. Build
2. Setup on Docker with CLion
0. Prerequisites
- Install docker
https://docs.docker.com/engine/install/
https://docs.docker.com/engine/install/linux-postinstall/ - Install docker-compose
https://docs.docker.com/compose/install/ - (Optional) NVIDIA GPU users need to set up NVIDIA Container Toolkit
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker
1. Setup build environment on Docker
- Install docker-compose
Install Docker Compose and make sure you successfully run the command below.
docker-compose -version
- Build docker image
cd docker-env chmod 755 build.sh && ./build.sh
- [For NVIDIA GPU users] Enable GPU in
docker_env/docker-compose.yml
by removing#
as below.<--- before ---> #deploy: # resources: # reservations: # devices: # - driver: nvidia # count: all # capabilities: [gpu, graphics, compute, utility] <--- after ---> deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu, graphics, compute, utility]
- Run container
chmod 755 create_and_start.sh && ./create_and_start.sh
2. Setup Xhost
- Allow X server to accept connections from Docker.
This has to be executed when you reboot your PC. To automatically do this at boot on Ubuntu, use the following command.xhost localhost
[TODO] This way is reportedly vulnerable. Fix this.echo "xhost localhost" >> ~/.bashrc
3. Setup CLion
- Install CLion
- Connect to the container via SSH.
Go to [File]->[Setting]->[Build, Execution, Deployment]->[Toolchains].
AddRemote Host
by pressing+
and click the gear icon atCredentials:
and configure as follows. Note, the password isclion
.
You should change the password or use SSH key when you deploy the container accessible from outside.
The password is set likeclion:clion
(username:password) atislay/docker-env/Dockerfile
.
- Change deployment setting
Go to [Deployment]->[Mapping] and setLocal path
to/path/to/your/islay
andDeployment path
to/work/islay
- Add
res
andresult
directories to [Excluded Paths]. Note thatcmake-build-debug-remote-host
will be automatically added.
- Setup CMake.
- Add a profile by pressing
+
. - Change
Build type:
to your desired type - Change
Toolchain:
toRemote Host
- Pass OpenCV's path to CMake
-DOpenCV_DIR=/opt/opencv-4.5.1/build
- Add a profile by pressing
4. Run islay
- Click [File]->[Reload CMake Project]
- Click [Run]->[Run 'islay']
- Play with islay! First step is to move widgets and find
Command Sample
and see what happens on click.
5. Configure OpenCV (Optional)
- Open
islay/docker-env/opencv_build.sh
- Configure installation command
- OpenCV version is specified at
OPENCV_VERSION
- OpenCV version is specified at
- Re-execute from Step 1 (Setup build environment on Docker).
Trouble shoot
- If you use a NVIDIA GPU for graphic output, make sure to enable GPU settings in
docker-compose.yml
as instructed above.