Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build doesn't work with make #4005

Open
dbabokin opened this issue Feb 7, 2025 · 1 comment
Open

Build doesn't work with make #4005

dbabokin opened this issue Feb 7, 2025 · 1 comment

Comments

@dbabokin
Copy link
Contributor

dbabokin commented Feb 7, 2025

I'm trying to build with make on macOS and it fails, while exactly the same cmake recipe with Ninja works just fine. Building with make in single thread also works. This is reproducible for me with command from build instruction or by running python setup.py bdist_wheel.

My cmake config command:

cmake -Bbuild \
  -DCMAKE_BUILD_TYPE=Release \
  -DPython3_FIND_VIRTUALENV=ONLY \
  -DPython_FIND_VIRTUALENV=ONLY \
  -DLLVM_ENABLE_PROJECTS=mlir \
  -DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
  -DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD" \
  -DMLIR_ENABLE_BINDINGS_PYTHON=ON \
  -DLLVM_TARGETS_TO_BUILD=host \
  externals/llvm-project/llvm
> make -j8
...
make[2]: *** No rule to make target `tools/mlir/python/dialects/_affine_ops_gen.py', needed by `tools/torch-mlir/python_packages/torch_mlir/torch_mlir/dialects/_affine_ops_gen.py'.  Stop.
make[1]: *** [tools/torch-mlir/python/CMakeFiles/TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.affine.ops_gen.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target `tools/mlir/python/dialects/_bufferization_ops_gen.py', needed by `tools/torch-mlir/python_packages/torch_mlir/torch_mlir/dialects/_bufferization_ops_gen.py'.  Stop.
make[1]: *** [tools/torch-mlir/python/CMakeFiles/TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.bufferization.ops_gen.dir/all] Error 2
make[2]: *** No rule to make target `tools/mlir/python/dialects/_builtin_ops_gen.py', needed by `tools/torch-mlir/python_packages/torch_mlir/torch_mlir/dialects/_builtin_ops_gen.py'.  Stop.
make[1]: *** [tools/torch-mlir/python/CMakeFiles/TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.builtin.ops_gen.dir/all] Error 2
make: *** [all] Error 2

I'm not sure why Ninja handle dependencies correctly, while make doesn't. I'm not sure how to debug this. Any ideas?

If it's not fixed, we should probably use Ninja in setup.py as well.

@ScottTodd
Copy link
Member

I'm not sure why Ninja handle dependencies correctly, while make doesn't.

In some cases Ninja just gets lucky. The missingdeps feature in Ninja can help spot some dependency graph issues: https://ninja-build.org/manual.html#:~:text=since%20Ninja%201.4.-,missingdeps,-given%20a%20list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants