src/README.md

igraph/src

Updating the C sources

  1. Clean the src/ directory:

    sh make -f Makefile-cigraph clean

  2. Update the src/ directory:

    sh make -f Makefile-cigraph

    Note that this may change files generated by flex and bison, and configure scripts, depending on the version of those tools. For stability, the Makefile uses Docker with pinned versions of those tools.

  3. Review the changes, especially in src/ and configure:

    sh git diff src/ configure

  4. Commit and push

Dependency Tracking System

The build system uses an automated dependency tracking mechanism to enable efficient incremental compilation.

How It Works

  1. Dependency Generation: When compiling C/C++ files, the compiler generates .d files containing all dependencies (headers) for each source file.

  2. Filtering: The deps.mk makefile processes these .d files to create .dd files that:

  3. Include only local project headers (not system headers)
  4. Format dependencies in a Makefile-compatible format with proper line continuations
  5. Add a header comment indicating they are auto-generated

  6. Integration: The generated .dd files are included by the main Makefile, allowing Make to automatically recompile sources when their dependencies change.

File Types

Important Notes

Implementation Details

See src/deps.mk for the implementation. The key steps are:

  1. The compiler's -MMD -MP flags generate .d files during compilation
  2. A sed-based pipeline filters and formats the dependencies
  3. System headers and vendored dependencies are excluded to reduce file size
  4. Dependencies are sorted for consistency


Try the igraph package in your browser

Any scripts or data that you put into this service are public.

igraph documentation built on May 4, 2026, 9:07 a.m.