Enable Verbose Mode in CMake-Generated Makefiles

CMake is a powerful, cross-platform tool for managing the build process of software. It is able to identifiy the location of the software’s requirements and the available compiler/s. Based on that, CMake configures and generates a makefile which is ready to be executed.

This week’s post shows how to enable the verbose mode which CMake integrates into the makefile.

After generating a makefile with: cmake . [options]

  • one can use: make VERBOSE=1
  • or : cmake --build . -- VERBOSE=1

Is is also possible to enable verbose mode by default while generating the makefile: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

Disable Locale Environment Passing in SSH

Some UNIX-based systems, like Linux and macOS, can have an SSH feature enabled which may lead to odd outputs after connecting to a remote host over SSH.

An example output after executing locale on the remote host could be:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory 
LANG=en_US.UTF-8
LANGUAGE=en_US:en
...
LC_ALL=

Executing other random programs like git can bring up outputs like:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
...
LC_ALL=
...	 

In this case, SSH on your local system is configured to pass its locale environment values to the remote system. If the remote host, though, does not know or support them, error messages like the ones above can appear.

To fix this, you can either set up the remote host in a way so that it supports the passed locale environments, or you can configure SSH on your remote host to ignore passed locale environments.

Since often you may not have the rights to change these things on a remote system, I found the more general way for fixing this problem is to disable the locale environment passing on your local system.

You can do this by editing with admin rights /etc/ssh/ssh_config and commenting out:

# SendEnv LANG LC_*

Recent versions of macOs have this setting enabled by default.

Check Which UNIX-Based OS Is Installed

This week’s post will show you how to quickly check in the terminal which OS is installed. It may sound silly, but connecting to a new remote machine can give you the need to know which OS is actually running.

That’s the command: uname -a

Disable Kext Singing on macOS

Since macOS 10.10 Yosemite, Apple featured System Integrity Protection (SIP) in its operating system. SIP is a good thing. It is an extra protection layer which checks if kernel extensions, or kexts, are signed with a developer ID.

Unfortunately, this can break compatibility to some older software. Other reasons for disabling SIP would be the testing of self-written unsinged kexts.

With this command you can disable SIP: sudo nvram boot-args=kext-dev-mode=1

… and with this one re-enable it again: sudo nvram -d boot-args

Essential apt Commands

Some of the most popular Linux distributions, like Debian or Ubuntu, use .deb packages. For those systems, the Advanced Packaging Tool or apt is an essential tool working as the upper layer of the package managing stack, allowing package and dependency management as well as automatic updates.

These are the most important commands for yum:

  1. Check if updates are available: apt-get update

  2. Install new updates: apt-get upgrade or sudo apt-get dist-upgrade (like upgrade, but removes packages which are not part of the distribution anymore)

  3. Install a specific package: apt-get install [package]

  4. Remove a specific package: apt-get remove [package] or sudo apt-get purge [package] (removes also any configuration files)