OUTDATED: Check the new way to customize your toolchain with biicode in this post: Raspberry PI cross building native (C/C++)
Step by step we are making biicode easier to customize, our latest addition is to allow users using a custom CMake toolchain instead of the autogenerated one. Continue reading
The problem: C and C++ compilation times
Biicode is a file-based dependencies manager for C and C++, focused on sharing and reusing source code, specifically, source (and header) files.
Biicode uses the CMake building system to configure and build blocks, its unit of source code sharing. The default way to develop blocks is to include the required sources and any required extra configuration for building such files on a
CMakeLists.txt file at the root of the block. Also biicode provides other files for specific config such as
So writting our own biicode block is a process with three simple steps:
- Get the sources and copy them on the block directory.
- Configure the
CMakeLists.txt file of the block for the specific build instructions for that sources.
- Upload the block to the biicode cloud via
bii publish command.
So far so good. This approach works pretty well and the biicode community is growing everyday thanks to it. Whats exactly the problem with this approach? Its simple: Some C and C++ sources are hard to compile and it takes time. A lot of time.
Updated for biicode 2.0!
Once a library is uploaded to biicode, everyone can reuse it easily! Let’s see a new example about how to upload to biicode just following a few steps, again, this is another example about how to proceed when your library depends on others. For this matter we’re using the fantastic library Little CMS, a free, open source, CMM engine. It provides fast transforms between ICC profiles.
As you can guess, once we’re done everybody will be able to use this library just by typing
We have uploaded a docker image with biicode pre-installed. So, you can quickly try biicode thanks to docker!
Don’t you know what’s docker? Let’s start with a short explanation about it.
Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud.
Once you upload to biicode a library, everyone can reuse it! That’s why we explained how to upload to biicode any library just following a few steps, but that example didn’t cover the possibility of a library depending on other libraries, which is quite usual nowadays. So today, we’re going to see with an example how to proceed when your library depends on others. For this matter, we’re using BOX2D, an open source C++ engine to simulate rigid bodies in 2D, it is also used in different video-games like AngryBirds motor engine.
A few days ago, we came across this fantastic library from the Dropbox team, to encode and decode JSON using C++11. Syntax is very clean and attractive which makes the library very easy to use.
Also, this library is an ideal example to show how to upload to biicode your library like I did.
Why would you want to upload to biicode your library ?
Once it’s uploaded to biicode, everyone (including yourself) can reuse it easily and without any complex configuration.
This is key: If you make a good job configuring and uploading the library to biicode, nobody will EVER do this job again. The library will work for anyone just by typing #include “lasote/json11/json11.hpp”.
JSON11 by DROPBOX
ZMQ or ZeroMQ is one of the coolest open source libraries out there. It fills a real necessity in a new, brilliant way. It is very active, has bindings to many languages… that’s why it is so popular.
I was a professor in university, teaching C/C++, software engineering, distributed systems (plain old sockets, SOAP, web…), and I really enjoyed keeping my classes up to date and teaching last trends and technologies. If I was still a teacher, I would definitely teach some sessions using ZeroMQ.
Make a cute Arduino file manager and editor. It’s also intended for hosting sketches and interact with them in an easy way using a PS2 Keyboard.
Thanks to Juan who developed this project called blocporc!
As Nacho Lasheras points out in his blog Orcs and Fireballs
Once you’ve grasped the basics of coding (variables, execution flow, conditions, loops, functions, etc.) you can start learning how to develop “easy” games. It’s important to go step by step. Do not try to rush and start programming in C++, OpenGL and Android at the same time because it can be overwhelming.
Watchduino is an open source Arduino Smart Watch that combines inexpensive electronic parts with complex Arduino (C++) code. It’s fully hackable from hardware to software. You can build your own one, it’s useful and reprogrammable.