A fuzzy logic C++ library
Building the software

This page gives information about how to build the software. More...

This page gives information about how to build the software.

Page content:

  1. Introduction
  2. Build targets
  3. Build options
  4. Dependencies
  5. Building on Windows


Build timing: on a quad-core standard Linux/Ubuntu desktop, the following have been measured, following a make cleanall:

Build targets

The makefile has a lot of targets, some of them are dedicated to debugging and/or development tasks, here are only the ones that the end-user will find useful.

The most complete way to build the whole thing, assuming you have all that is required, is:

make all
make install

On Linux, you will need to 'sudo' the second line, of course. On Windows, you might need administrative privileges, as the default installation path is c:\program files.

This latter target also associates the .fis file extension to a mime type "Slifis-FIS", that itself is associated to the try-fis application.

Alternatively, if you don't want/need to rebuild the documentation, nor want to build'n'run the test suite, you can do:

make app
make install

This will only build the libraries and the demos and applications, and install it on the local machine, so it is available for the users apps. Replace app with lib to build only the two libraries (core + gapi).

If you don't have the graphical back-end library available on your machine and only want the core library, then it will be:

make core
make install

If you want to run the test suite:

make test

To build the documentation, html + pdf (assuming you have doxygen, latex and gnuplot installed):

make doc

Beware, this target needs

For a list of available targets, just run:


This should give the output below, showing all the targets. Please note that most of these are dev-oriented, the most important ones are listed above.

Please specify one of these targets:
 -core   : builds core library only (gapi lib not needed)
 -lib    : builds all the libraries (core + gapi)
 -app-cl : builds the command-line demos and applications (gapi lib not needed)
 -app    : builds the demos and applications (needs the gapi lib)
 -doc      : builds html and pdf documentation (needs the gapi lib)
 -doc-html : builds html documentation (needs the gapi lib)
 -doc-pdf  : builds pdf documentation (needs the gapi lib)
 -test   : builds and runs the unit tests (needs only the core lib)
 -all    : all of the above

 -clean-obj : removes object files
 -clean-lib : removes all produced libraries
 -clean-bin : removes all produced binaries
 -clean-doc : removes all produced documentation (html and latex/pdf)
 -clean-gen : removes all run-time generated files (log files, images, ...)
 -clean-gapi: removes all 'gapi' related files (lib, demos and apps)
 -clean-app : removes binaries and obj files of demos and applications
 -cleanall  : all of the above 'clean-xxx' targets

 -archive   : produces an archive with binaries and documentation
 -install   : install library and headers on local machine

* build general options:
 -XML_SUPPORT={yes|no} : if yes, integrates TinyXML library to enable XML I/O support (default is 'yes').
 -USE_EIGEN={yes|no} : if yes, integrates Eigen library to enable linear lest squares fitting for Takagi-Sugeno Fis type (default is 'yes').
 -SHORTDOC={yes|no} : generates web-type (short) html documentation (default is 'no').
 -GRAPHICS={cairo|opencv} : back-end graphical library to use: cairo+GTK or Opencv  (default is 'cairo').
 -DO_CHECKING={yes|no} : builds with runtime checks enables (default is 'yes).
 -NDEBUG={yes|no} : removes all assertions from code  (default is 'no').
 -SHARED={yes|no} : demo/apps use shared version of library (default is 'no').

* build dev/debug options:
 -DEBUG={yes|no} : builds debug version (default is 'no')
 -DO_LOGGING={yes|no} : add (useful) information on run-time to log file. Debug usage only, default is 'no'.
 -TRACELEVEL=n : add tracing of function calls up to level 'n'. Debug usage only, default is 0, no build overhead.

* makefile options:
 -SHOW={yes|no} : if yes, shows each command run by makefile (default is 'no').

In case of trouble, you can try:

make info

that will list the current options (the default ones if typed "as-is", or the ones you give, if any), and

make showpath

that will print the current search paths for dependencies. If they are wrong, you need to edit some makefile variables in the makefile (see top lines).

Finally, to speed up building, note that you can use the -j option of Gnu Make that enables parallel processing and speeds up the build process.

Build options

The makefile can be called with the following options. Note that only the DEBUG option compiles object files in a separate path. This means that when compiling the whole thing with a given set of options, then editing a .cpp file, then calling make with a different option set, then only this last edited file will be compiled with the second option set. If you want to rebuild all with the second option set, you need to call make clean-obj before.

Options list:


Build insides

Building on Windows

On Windows, building the software is a bit more complicated then it is on Linux, but it is actually only a matter of downloading and installing additional pieces of FOSS. Build is based on the same makefile, that has been specially adapted to run both on Linux and Windows.

You will only need the following requirements to build the 'core' and the 'test' target:

To build the GAPI part of library (and the demo applications and documentation), you will need one of these back-end libraries:

To make pkg-config work with Gtk2 and its associated libraries, you need to tell it where it shall search. This is done with the environment variable PKG_CONFIG_PATH that needs to be set to the correct path. For instance, if you install the Gtk2 bundle to C:\libs\gtk2, then you need to declare ("system properties") PKG_CONFIG_PATH=C:\libs\lib\pkgconfig.
That way, it will find all those .pc files. Don't forget to copy also all the .dll files that are in bin folder of Gtk2 to c:\windows\system32.

Final remarks:

(1) On Windows, to make a program available on the path, you need to go into "system properties", and add (for instance) "c:\program files\gnuplot\bin" to the PATH environment variable.