Skip to content

Python pixi build fails with INTERFACE_INCLUDE_DIRECTORIES error #5756

Closed

Description

@thewtex

Description

-- Configuring done (15.2s)
CMake Error in Modules/Bridge/NumPy/CMakeLists.txt:
  Target "ITKBridgeNumPyModule" INTERFACE_INCLUDE_DIRECTORIES property
  contains path:

    "/home/matt/src/ITK/.pixi/envs/python/include/python3.13"

  which is prefixed in the source directory.

Steps to Reproduce

On main:

pixi run test-python

Expected behavior

Should be allowed.

Versions

On main following #5721 .

Additional Information

@blowekamp how do you think this should be addressed?

Activity

  1. blowekamp commented on Feb 3, 2026

    @blowekamp
    Member

    how do you think this should be addressed?

    Looking at the CMake code, I think this python path was hard coded into the installed ITK. So maybe it's only valid for the build?

    Ideally the ITK::ITKNumpyModule would have an INTERFACE dependency on the imported target Python::Module or Python::SABIModule. This should produce a portable configuration. However, would likely need to be part of a larger refactor to use the import Python interface.

    Given that this path previously generated in the install was invalid here are a couple options:

    • Use the $<BUILD_INTERFACE: > generator expression in the Numpy module.
    • Ensure the pixi environment is not created in the source directory. This just side steps the underlying issue.
  2. thewtex commented on Feb 3, 2026

    @thewtex
    MemberAuthor

    So maybe it's only valid for the build?

    Yes

    Ideally the ITK::ITKNumpyModule would have an INTERFACE dependency on the imported target Python::Module or Python::SABIModule. This should produce a portable configuration. However, would likely need to be part of a larger refactor to use the import Python interface.

    And we do have an exceptional case with libpython where we are weakly linking.

    Ensure the pixi environment is not created in the source directory. This just side steps the underlying issue.

    Yes; the pixi environment in the source directory is intentional.

    Use the $<BUILD_INTERFACE: > generator expression in the Numpy module.

    👍 did you want to have copilot give this a try?

  3. blowekamp commented on Feb 4, 2026

    @blowekamp
    Member

    @thewtex the merge of #5665 should have resolve this issue. Please test and close if resolved.

  4. thewtex commented on Feb 5, 2026

    @thewtex
    MemberAuthor

    @blowekamp verified! Thank you!! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type:CompilerCompiler support or related warnings

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions