Skip to content

Issues building with python packages #4331

@zjgarvey

Description

@zjgarvey

I had to re-build from scratch recently and noticed a few issues.

  1. If I only specify -DPython3_EXECUTABLE="$(which python3)" and not also -DPython_EXECUTABLE="$(which python)", then my machine actually ends up building _mlir_libs._torchMlir.cpython-313-x86_64-linux-gnu.so, despite other shared object files being built for python3.12, which is my python3 version (and also my python version, oddly enough). I must have a python3.13 somewhere that cmake is finding, but it might be a good idea to throw an error during the build process for this kind of thing, since doing something like from torch_mlir.dialects import torch as torch_d, python throws an opaque error: ModuleNotFoundError: No module named 'torch_mlir._mlir_libs._torchMlir'.
  2. Despite indications otherwise (e.g. bc13dae), my python_packages directory is still located in build/tools/torch-mlir/python_packages and not build/python_packages. I think it's largely irrelevant where these packages are located, but if there is some inconsistency in where these end up based on other cmake configuration options, we should just have cmake generate a .env file with the correct PYTHONPATH based on wherever it places python packages rather than having a bash script hopefully get this correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions