What is Cinder?
Cinder is an OpenStack Block Storage service. It provides virtual management of block storage devices. It offers end users with a self-service API to request and utilize those resources without requiring any understanding of where their storage is deployed or what type of device is being used.
Cinder with Raspberry Pi 3
Prerequisites
-
Raspbian Jessie or later
-
CMake 3.0+
Installing CMake
sudo apt-get install cmake
Dependencies for Cinder
Run the below command to get Cinder Raspberry Pi 3 with its dependencies.
sudo apt-get install libxcursor-dev \
libgles2-mesa-dev \
zlib1g-dev \
libfontconfig1-dev \
libmpg123-dev \
libsndfile1 \
libsndfile1-dev \
libpulse-dev \
libasound2-dev \
libcurl4-gnutls-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-bad1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-libav \
gstreamer1.0-alsa \
gstreamer1.0-pulseaudio \
gstreamer1.0-plugins-bad \
libboost-filesystem-dev
Building the Cinder
Fetching and Building the Cinder
git clone --recursive https://github.com/cinder/Cinder.git
cd Cinder
mkdir build && cd build
cmake .. -DCINDER_TARGET_GL=es2-rpi
make -j 3
Due to GCC memory requirements, attempting to build Cinder with more than three jobs, specified with the -j 3 parameter, will almost certainly result in a hard crash. For example, when compiling a 5 MB C file with 65337 functions to assemble, GCC consumes over 700 MB of RAM. Files with fewer functions (32769 and 16385) take a fraction of the time. A workaround is to divide the file into multiple C files and compile each separately.
Check out most important Git Interview Questions here.
Clang
Clang is a front-end compiler that converts programming languages like C++, C, Objective C++, and Objective C into machine code. Compared to GCC, Clang reduces single-thread compilation time by 5% to 10%. As a result, Clang provides more benefits for large-scale project development.
Cinder can be used with the Raspbian Jessie version of Clang (v3.5.0). Install it with apt-get:
sudo apt-get install clang
When prompted by this command, type /usr/bin/clang++ to make Clang the default compiler:
sudo update-alternatives --config c++
Building and Running BasicApp
Building
cd samples/BasicApp/proj/cmake
mkdir build && cd build
cmake .. -DCINDER_TARGET_GL=es2-rpi
make
Running
Starting from samples/BasicApp/proj/cmake/build:
./Debug/BasicApp
Exiting
To exit the BasicApp, press the Esc key. Cinder, which is for Linux on the Raspberry Pi 3, is currently having Esc hardcoded to exit an application.
Troubleshooting
Audio–Starting the pulsedeamon
Raspbian ships with PulseAudio installed. However, it would be best if you started the pulsedeamon before you can utilize audio in your application. Do that by running the following:
pulseaudio -D
Audio–No Output Using a 3.5mm headphone jack
Try the following. It will force output to the 3.5mm jack (more information here):
sudo amixer cset numid=3 1
Frequently Asked Questions
What are the requirements for Cinder-Raspberry Pi 3 Platform?
Raspbian Jessie or a later version and CMake 3.0+ is required for Cinder-Raspberry Pi 3 Platform.
What are the constraints kept in mind while building Cinder?
Due to GCC memory requirements, attempting to build Cinder with more than three jobs, specified with the -j 3 parameter, will almost certainly result in a hard crash.
How do you use clang while building a Cinder?
Cinder can be used with the Raspbian Jessie version of Clang (v3.5.0). Install it with apt-get: sudo apt-get install clang.
How to exit the BasicApp of Cinder-Raspberry Pi 3?
To exit the BasicApp, press the Esc key. Cinder for Linux on the Raspberry Pi 3 currently have Esc hardcoded to exit an application.
Conclusion
In this article, we have learned about Cinder with the Raspberry Pi 3 platform with a brief introduction to Raspberry Pi and Cinder.
You can refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enrol in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.
Happy Learning!