Sample Compilation (C++) and Execution

FeatureClustering relies on FeatureRetrieval. Before using FeatureClustering, generate and deploy operators for different dimensions based on the FeatureClustering documents. For the small library, generate the Flat/SQ operator. For the large library, generate the IVFSQ operator, the PCAR dimension reduction operator, and the small library's Flat/SQ operator.

After FeatureClustering is deployed, you can use related APIs and parameter configurations provided in Sample (C++) and compile the CMakeLists.txt file. The config parameter file released with the version supports clustering using the sample source code. The sample compilation procedure is as follows:

  1. Create a sample directory in the mxIndex-{version} directory generated after the FeatureClustering is installed and go to this directory.
  2. Compile your sample source code by referring to Sample (C++) and create the std::map<std::string, std::string> object for configuration. For details, see Clustering Parameter Configuration.
  3. Write the compilation dependencies by referring to Sample CMakeLists Dependencies (C++).
  4. Perform the compilation.
  5. After the compilation completes, create a config folder in the same directory as the executable file, and configure logging.conf in config. Refer to Log Configuration File to set the log printing information.

    FeatureClustering searches for and parses logging.conf in config of the same level as the executable file directory. If the file does not exist, FeatureClustering searches for and parses logging.conf in config of the MX_INDEX_HOME environment variable. If the corresponding configuration file does not exist, the default log configuration items are used.

  6. Run the executable file generated by the sample source code.