Build and install¶
This section contains detailed instructions on how to build and install the provided KSC applications.
Requirements¶
Building the KSC applications requires:
a \(\texttt{c/c++}\) compiler, with \(\texttt{c++11}\) support, to be installed on the system
\(\texttt{CMake}\) is used for managing (option configuration, locate dependencies etc.) the build process, so it needs to be installed on the system (see at http://www.cmake.org/)
the KSC applications are developed based on the functionalities provided by the \(\texttt{leuven}\) library and framework [3] as example applications. Therefore, the \(\texttt{leuven}\) library needs to be installed on the system before building the KSC applications. The source code of the \(\texttt{leuven}\) library can be obtained from its git repository and detailed instructions on its requirements and installation are provided in the Build and Install Section of its Documentation.
Quick start¶
The source codes of the KSC applications are located under the \(\texttt{leuven/apps/examples/KSC}\) directory of the \(\texttt{leuven}\) library [3]. It can be built and installed as
bash-3.2$ cd leuven/apps/examples/KSC
bash-3.2$ mkdir build
bash-3.2$ cd build
bash-3.2$ cmake ../ -DCMAKE_INSTALL_PREFIX=/where/to/install -Dleuven_DIR=/where/leuven/is/installed/lib/cmake/leuven/
bash-3.2$ make install
...
Then the KSC application for training, hyper parameter tuning and out-of-sample extension, located under the \(\texttt{/where/to/install/bin}\) are ready to be used to solve clustering problems. See for example Test1 for a simple clustering application.
More details¶
The source codes of the KSC applications are located under the \(\texttt{leuven/apps/examples/KSC}\) directory of the \(\texttt{leuven}\) library [3]. This \(\texttt{KSC}\) sub-directory (as all the others under \(\texttt{leuven/apps/examples/}\)) can be freely copied to any other location and the corresponding applications can be built and used independently from the others.
After making sure that all the above requirements are installed on the system, the KSC applications can be built and installed as (assuming that the current directory is the \(\texttt{leuven/apps/examples/KSC}\) or wherever it has been copied)
bash-3.2$ mkdir build
bash-3.2$ cd build
bash-3.2$ cmake ../ -DCMAKE_INSTALL_PREFIX=/where/to/install/ -Dleuven_DIR=/where/leuven/is/installed/lib/cmake/leuven/
bash-3.2$ make install
...
Note, that the following \(\texttt{CMake}\) configuration variables are used above
-DCMAKE_INSTALL_PREFIX: the location, where the KSC applications are supposed to be installed after a successful build
-Dleuven_DIR: the location, where the \(\texttt{leuven}\) library has been installed. Actually, the-Dleuven_DIRvariable should point to the directory where the \(\texttt{leuvenConfig.cmake}\) configuration file is located.
Further \(\texttt{CMake}\) options might also be used at this stage. For example, on my \(MacOS\), I have the \(\texttt{gcc/g++ gnu C/C++}\) compilers installed (beyond \(\texttt{Clang}\))under the \(\texttt{/usr/local/bin/}\) directory (version \(\texttt{9.2.0}\)) that were used in all cases of the examples shown in this document. These can be specified as preferred C and C++ compilers by using the \(\texttt{-DCMAKE}\_\texttt{C}\_\texttt{COMPILER=/usr/local/bin/gcc-9}\) and \(\texttt{-DCMAKE}\_\texttt{CXX}\_\texttt{COMPILER=/usr/local/bin/g++-9}\) \(\texttt{CMake}\) options (also the Fortran compiler as \(\texttt{-DCMAKE}\_\texttt{FC}\_\texttt{COMPILER=/usr/local/bin/gfortran}\) if needed).
Usage¶
After successful build and install, the KSC applications are available under the \(\texttt{bin}\) sub-directory of the install location (i.e. \(/where/to/install/bin\)). These can be used immediately to solve clustering problems. The detailed description of the applications can be found in the Example Applications Section while several examples are provided in the Tests for the ICD-KSC applications Section. See for example Test1 for a simple clustering application (or follow the instructions given in \(\texttt{/where/to/install/tests/test1/Readme.md}\)).