<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54583>54583</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            “Option already exists!” when running OpenCL applications (Clover/libCLC)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          illwieckz
      </td>
    </tr>
</table>

<pre>
    I run [this script](https://gitlab.com/illwieckz/i-love-compute/-/blob/master/scripts/user-mesa) to build latest LLVM and latest Mesa to run latest Clover with latest libCLC (latest `main` branches).

Note: I'm the author of the script.

Tools making use of OpenCL don't work anymore. Here is a simple example with `clinfo`:

```
clinfo: …/llvm-project/llvm/include/llvm/Support/CommandLine.h:846: void llvm::cl::parser<DataType>::addLiteralOption(llvm::StringRef, const DT&, llvm::StringRef) [with DT = llvm::FunctionPass* (*)(); DataType = llvm::FunctionPass* (*)()]: Assertion `findOption(Name) == Values.size() && "Option already exists!"' failed.
```

To reproduce it the way I do it, the script can be used this way:

```sh
./user-mesa build
./user-mesa run clinfo
```

I'm building on Ubuntu 22.10, but most of the deps (LLVM, Clang…) are rebuilt by the script as latest `main` branches usually require other projects to also run latest `main` branches.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVcly2zgQ_Rro0iUWBYpaDjwoUlzjKiWZmji5gwQkIgYBDhZrlK-fbpK2lRn7kCpJWHrB6-W1aiev1T34ZIGVH2KrA4TG6z6y8sD4po2xD6zYMX6Hn7OORtRZ4zo8aGMuWjWPP2k_N-5JzVHQp6jwYo7f2rgal06EqDxuRr8BdykoP-9UEIxvITqokzYSjIgqRDgev38CYV_On1CPlAjidLWn1zxcdGyfr4yu98c9IOTpgq3yTmiLC9Re2KZV-PI2Y_mB5bvx97NDrMUO7hlfdxBbBSLF1nlwp-E0Av7F5ME5E6ATj9qeAcMg1S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