Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/usnistgov/NFIQ2/llms.txt

Use this file to discover all available pages before exploring further.

Building only the NFIQ 2 library is useful when you want to integrate NFIQ 2 into your own application without the command-line interface dependencies.

Quick Build

1

Clone the repository

Clone recursively to include all git submodules:
git clone --recursive https://github.com/usnistgov/NFIQ2.git
cd NFIQ2
2

Create build directory

mkdir build
cd build
3

Configure with CMake

Disable the CLI build with the BUILD_NFIQ2_CLI option:
cmake .. -DBUILD_NFIQ2_CLI=OFF
4

Build the library

cmake --build .
Building with BUILD_NFIQ2_CLI=OFF skips the libbiomeval and NFIR dependencies, significantly reducing build complexity and dependency requirements.

CMake Configuration Options

Build Type

Set the build configuration type:
cmake .. -DBUILD_NFIQ2_CLI=OFF -DCMAKE_BUILD_TYPE=Release

Architecture

Specify architecture with the -A flag:
cmake .. -DBUILD_NFIQ2_CLI=OFF -A x64      # 64-bit
cmake .. -DBUILD_NFIQ2_CLI=OFF -A Win32    # 32-bit

Generator

Change the build system generator:
cmake .. -DBUILD_NFIQ2_CLI=OFF -G "Ninja"
cmake .. -DBUILD_NFIQ2_CLI=OFF -G "Unix Makefiles"
cmake .. -DBUILD_NFIQ2_CLI=OFF -G "Visual Studio 17 2022"
cmake .. -DBUILD_NFIQ2_CLI=OFF -G "Xcode"

Advanced Options

Embedding Random Forest Parameters

By default, NFIQ 2 loads random forest model parameters from external files. You can embed them directly into the library:
cmake .. \
  -DBUILD_NFIQ2_CLI=OFF \
  -DEMBED_RANDOM_FOREST_PARAMETERS=ON \
  -DEMBEDDED_RANDOM_FOREST_PARAMETER_FCT=0
Options:
  • EMBED_RANDOM_FOREST_PARAMETERS (default: OFF)
    • Whether to embed random forest parameters into the library binary
  • EMBEDDED_RANDOM_FOREST_PARAMETER_FCT (default: 0)
    • Friction ridge capture technology (FCT) code per ANSI/NIST-ITL 1-2011: Update 2015
    • Only used when EMBED_RANDOM_FOREST_PARAMETERS is ON
Embedding parameters increases the library binary size but eliminates the need to distribute model files separately.

Installation Prefix

Specify where the library should be installed:
cmake .. -DBUILD_NFIQ2_CLI=OFF -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build .
cmake --install .
On Windows:
cmake .. -DBUILD_NFIQ2_CLI=OFF -DCMAKE_INSTALL_PREFIX="C:\Program Files\NFIQ2"
cmake --build . --config Release
cmake --install . --config Release

Build Output

After a successful build, you’ll find:
  • Library: libNfiq2Api.a (static) or libNfiq2Api.so/.dylib/.dll (shared)
  • Headers: Located in NFIQ2/NFIQ2Api/include/
  • Dependencies: OpenCV and FingerJetFX libraries in the build directory

Verification

Verify the library was built successfully:
ls -lh build/NFIQ2/NFIQ2Api/libNfiq2Api.*

Platform-Specific Notes

For detailed platform-specific build instructions and troubleshooting, see:

Next Steps

Build with CLI

Add the command-line interface to your build

API Integration

Learn how to integrate the library into your application

Build docs developers (and LLMs) love