![]() ![]() This comes from the representation of the quantized numbers: Important restrictions apply to operations performed on quantized inputs.įirst, additions between the integer mantissa of quantized inputs can only be performed if they are in the same scale. Here is for instance the glib-2.0 pkg-configfile:Īligning quantization scales before incompatible operations by David CorvoysierĪs explained in my introduction to (/2023/05/ml-quantization-introduction#quantized-linear-operations), Pkg-config compatible packages declare their include path, compiler options and linking flags in dedicated. It is language-agnostic, so it can be used for defining the location of documentation tools, for instance. It helps you insert the correct compiler options on the command line so an application can use gcc -o test test.c pkg-config -libs -cflags glib-2.0 for instance, rather than hard-coding values on where to find glib (or other libraries). Pkg-config is a helper tool used when compiling applications and libraries. Other packages: pkg-configįor package whose definition is not maintained in CMake (ie there is no FIND_PACKAGE macro written for them), you may rely on the generic pkg-config tool instead. There is therefore no need to add them explicitly using an INCLUDE_DIRECTORIES directive. Just like when referencing an internal module, the paths to the specific includes of libraries found using FIND_PACKAGE are automatically added to the include search path. ![]() Note: The FIND_PACKAGE command will also export several related variables. The moduleX directories contain libraries to be used by either the tests or main executables.Īt the root of the project, the main CMakeLists.txt should contain the common CMake directives that apply to all subdirectories.įirst, the CMakeLists.txt would specify a minimum Cmake version, name your project and define a few common behaviours. The test directory contains one or more test executables. The main subdirectory contains the main project target, typically an executable. The project structure is partly driven by the project design, but it would ususally contain at least two common sub-directories, along with several “module” sub-directories: This is therefore my own tutorial to CMake, based on my primary requirement: just generate the makefiles using CMake, and use my own tools for everything else. This article is about how I have used it to build plain old Linux packages almost effortlessly.Īlthough CMake is fairly well documented, I personnally found the documentation (and especially the tutorial) a bit too CMake-oriented, forcing me to use cmake dedicated tools for tasks I had already tools for (tests and delivery for instance). I have always found Autotools a bit counter-intuitive, but was reluctant to make the effort to switch to CMake because I was worried the learning curve would be too steep for a task you don’t have to perform that much often (I mean, you usually spend more time writing code than writing build rules).Ī recent project of mine required writing a lot of new Linux packages, and I decided it was a good time to give CMake a try. When it comes to choosing a make system on Linux, you basically only have two options: autotools or CMake. A typical Linux project using CMake by David Corvoysier ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |