Showing posts with label CMake. Show all posts
Showing posts with label CMake. Show all posts

Monday, 11 December 2017

Crashed my Build Server....

When I say I crashed it, I mean... It just locked up and I had to soft reboot it... And when I say build server I mean one of the virtual machines on one of my Xen Hosts....

So, the machine is a fairly beefy 16 core machine with 48GB of RAM running on a Dell server under the desk, this disk base is a RAID-0 200GB unit over a bunch of 2.5" 10,000 RPM SAS Drives to a Perci5 RAID Controller....

The machine is only really spooled up for big builds, and this was one of them, I wanted to build LLVM support before bed.

The problem?  When I performed the build with "make -j all" it would get to 16% and then blank the screen, and totally lock up, nothing, nada, nowt... I left it for a while but nothing happened, and yes the LLVM build is time consuming but it doesn't lock at 16% for minutes.

Soft reboot, and the same happened again...


I've started the build again with "make -j 15" rather than all sixteen cores.  And it's already up into the 35% area of the build whilst I've been typing this....

But, what the heck locked the machine up before?  It wasn't actually using all the processors all of the time, surely?  Maybe?

I might have to set up one of the older 2950's and have a play about with this, leaving my one beefy machine alone.

Just on a side note, could you imagine the mess your system would be left in if you soft rebooted this kind of kit, mid-build, with no warning... LOL.

Tuesday, 28 November 2017

CMake rather than Mammoth makefile marathons

I'm having difficulty communicating with some folks about the beauty of cmake and using ccmake to leverage that beauty.

These are folks whom are either completely ignorant of what a makefile should look like, are happy to manage their own or at worst case are folks put off of makefiles by having inherited projects which have spiralled out of control with mammoth makefiles and a propensity to being so complex as to prevent any cost-effective entry grade for new developers to key into - i.e. they're too hard to learn, or obfuscated sufficiently to allow established developers to retain their positions of glory and power.

I don't subscribe to that ethos however, and believe that as a leader in development you should facilitate everyone to be being able to do everyone else's development role, be that starting a new project or continuing an old.

It perhaps comes from my being able to work alone and defining a role which others are then keyed into, I have been forced to allow entry to my work, to make the cost of someone else bootstrapping my work into their wetware (brain) as simple as possible.

Mammoth makefile marathons are not the way for me to do that, a CMakeLists.txt file, now that's a better proposition.  However, even here you have to take care, some folks are ignorant of the tools available, to leverage cmake in this way one might use this kind of command line...


This is daunting for a newbie, and even an experienced developer has to admit...

ccmake <PATH_TO_CMAKELISTS>

This is a much more succinct and easy to access way of getting into your CMake way of working, the cost of entry being so low as to actually make introducing new developers to Linux development, or just general CMake usage, trivial.

So where am I failing to communicate this?

Well, cmake, ccmake... The naming conventions of both are so close as to confuse people, they don't hear the second C in CCmake, or they think I'm talking about the C Programming language.  This is a lack of understanding on their part, people being people however, they don't want to admit they've no idea what you're talking about.

(As an aside, folks, if you want to be a good developer, a good person, please admit when you don't know something, it causes so much less issues in at development scrum time if you are handed work, and you simply state "I know nothing about that".  Someone else can be assigned the role, or better still, you can get training and schedule the work more effectively!)

My solution to this difficulty therefore?

Rename the programs, I've created two symbolic links in /usr/bin....

sudo ln -s /usr/local/cmake/bin/ccmake /usr/bin/makefile_prep_gui
sudo ln -s /usr/local/cmake/bin/cmake /usr/bin/makefile_prep_cmd

I've essentially bamboozled the communication factor by giving cmake the working name "makefile_prep", this means that those opposed to ceasing direct use of makefiles still feel empowered, but are subtly diverted to using an automated tool.

Immediately questions and opposite to changing the status quo has ceased, and folks are talking about using the new "makefile_prep" tools.... How clean they are, how nice the builds look, how they integrate with CLion easily, and "the output from my makefile_prep looks exactly like the build going on inside the IDE (CLion)"... Little do they realise they're both cmake!

Oiling the cogs of resistance to change, this is where I'm living at present... Its not an easy task, but sometimes it's rewarding.... Now to do the same in the day-office.

Wednesday, 7 September 2016

Software Engineering : Building Cryptozoidberg (Boolberry)

I recently received a request via YouTube to help a fellow programmer out, they were having issues building this library against the boost libraries... https://github.com/cryptozoidberg/boolberry

The problem essentially is the lack of transparency in CMake when it looks for boost with it's "FindBoost" functionality, because neither he, nor I build boost with CMake.  I personally don't use or like CMake, I do use make however, and am happy to look around in the make files.

So, I did... And there's nothing specifically wrong with this makefile, but it is insisting on looking for boost within the system, not the version built by yourself.

My Solution therefore has been:

sudo apt-get install libboost-all-dev
sudo apt-get install git
sudo apt-get install cmake
cd ~
mkdir c++
cd c++
git clone //https://github.com/cryptozoidberg/boolberry.git
cd boolberry
make -j4

(Note, replace 4 here with as many cores as your PC has available!  More cores will speed this build up, and it will take a long while)

And this works fine:


As you can see.  However, I did this from my main build machine, which has a whole bunch of additional and historic settings.  Which is the most common pitfall for others coming to build your software later, they lack these customisation's.

My build environment: Ubuntu 16.04 Desktop, with the i3 Window Manager (just open a terminal), and I have installed gcc (sudo apt-get install gcc).  These are the only steps before running the above script in a terminal window.

I therefore decided to perform a full clean setup of this system in a new Ubuntu 16.04 (64bit) VMware Virtual machine.

From this, I realise I needed to explain how to install the boost libraries, how to set up cmake and how to get git working before the build would work....

You can see this whole process below, please accept my apologies that this was recorded on an extremely slow internet connection, it got smushed during recording over the mobile link, and I've not had chance to re-shoot or edit the video.



As you can see however, the build worked perfectly.

To Muhmad whom asked for this, you'll find the Donate page at the top right!