Building tf-opt steps with prerequisites 
Hi @AviadCo 

Can you try with latest stable version `r2.13` and let us know if you still face the error?

Also, try `bazel clean --expunge` before executing `bazel build -c opt tensorflow/compiler/mlir:tf-opt`

There is no such docker build as of now for the `tf-opt` binary.

Thanks. Hi @pjpratik , thanks for the response!
After moving to branch `r2.13` I manage to build tf-opt with the following change:
in `tensorflow/tensorflow.bzl`:
```
@@ -939,7 +939,8 @@ def _create_symlink(src, dest, visibility = None):
         outs = [src],
         srcs = [dest],
         output_to_bindir = 1,
-        cmd = "ln -sf $$(realpath --relative-to=$(RULEDIR) $<) $@",
+        cmd = "ln -sf $$(basename $<) $@",
```

At least for me the symbolic link is refering to not existing path when running with `ln -sf $$(realpath --relative-to=$(RULEDIR) $<) $@` Moreover, when I ran the lit tests using:
`bazel test --override_repository="llvm-raw=${LLVM_SRC}" -c opt -t //tensorflow/compiler/mlir/... --spawn_strategy=sandboxed -j 60`
Where `${LLVM_SRC}` was defined to my llvm-project clone, I had to remove some references to `"@llvm-project//mlir:run_lit.sh"` in filegroups in the following files:
```
/tensorflow/compiler/mlir/lite/stablehlo/tests/BUILD
/tensorflow/compiler/mlir/quantization/stablehlo/tests/BUILD
/tensorflow/compiler/mlir/quantization/tensorflow/tests/BUILD
/tensorflow/compiler/mlir/tfr/BUILD
/tensorflow/compiler/mlir/tools/kernel_gen/tests/BUILD
/tensorflow/compiler/mlir/tools/kernel_gen/tests/tf_to_kernel/BUILD
``` Hi @AviadCo 

Thanks for the fix. Please feel free to create a PR for the same. 

 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. > tensorflow/tensorflow.bzl



> Hi @pjpratik , thanks for the response! After moving to branch `r2.13` I manage to build tf-opt with the following change: in `tensorflow/tensorflow.bzl`:
> 
> ```
> @@ -939,7 +939,8 @@ def _create_symlink(src, dest, visibility = None):
>          outs = [src],
>          srcs = [dest],
>          output_to_bindir = 1,
> -        cmd = "ln -sf $$(realpath --relative-to=$(RULEDIR) $<) $@",
> +        cmd = "ln -sf $$(basename $<) $@",
> ```
> 
> At least for me the symbolic link is refering to not existing path when running with `ln -sf $$(realpath --relative-to=$(RULEDIR) $<) $@`

Worked for me with the latest `nightly` branch, thanks! Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60915">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60915">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Documentation Feature Request

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

2.12

### Custom Code

Yes

### OS Platform and Distribution

Linux Ubunto 18.04

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

6.1.2

### GCC/Compiler version

9.2.0

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

I am trying to build tf-opt binary on branch v2.12 without any changes and gets different compilation errors. The command for compilation I use:
`bazel build -c opt tensorflow/compiler/mlir:tf-opt`

Can you share some prerequites for building and debugging `tf-opt` binary (for debug/release mode). I would appriciate if there is docker builder I can use to it instead of changing my envrioment.

Thanks,
Aviad

### Standalone code to reproduce the issue

```shell
ERROR: /localdrive/users/aviadco/community/tensorflow/tensorflow/lite/experimental/acceleration/configuration/BUILD:36:8: Executing genrule //tensorflow/lite/experimental/acceleration/configuration:configuration_schema failed: (Exit 1): bash failed: error executing command (from target //tensorflow/lite/experimental/acceleration/configuration:configuration_schema) /bin/bash -c ... (remaining 1 argument skipped)
bazel-out/k8-opt-exec-50AE0418/bin/external/flatbuffers/flatc: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by bazel-out/k8-opt-exec-50AE0418/bin/external/flatbuffers/flatc)
ERROR: /localdrive/users/aviadco/community/tensorflow/tensorflow/lite/schema/BUILD:184:22: Generating flatbuffer files for conversion_metadata_fbs_srcs: //tensorflow/lite/schema:conversion_metadata_fbs_srcs failed: (Exit 1): bash failed: error executing command (from target //tensorflow/lite/schema:conversion_metadata_fbs_srcs) /bin/bash -c ... (remaining 1 argument skipped)
bazel-out/k8-opt-exec-50AE0418/bin/external/flatbuffers/flatc: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by bazel-out/k8-opt-exec-50AE0418/bin/external/flatbuffers/flatc)
Target //tensorflow/compiler/mlir:tf-opt failed to build
```


### Relevant log output

_No response_</details>