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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Problems building flang 16.0.0.rc2 following standalone build instructions
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          h-vetinari
      </td>
    </tr>
</table>

<pre>
    I'm trying to [build](https://github.com/conda-forge/flang-feedstock/pull/27) flang for conda-forge, but running into several issues of differing severity:

0. https://flang.llvm.org/docs/ has no build instructions, this should be added; for now I'm following the standalone build [instructions](https://github.com/llvm/llvm-project/tree/main/flang/#building-flang-standalone) from the README.
1. Using those instructions, I run into the following errors (condensed):
  ```
  CMake Error at [...]/lib/cmake/llvm/AddLLVM.cmake:1915 (add_dependencies):
  The dependency target "Bye" of target "check-flang" does not exist.
  The dependency target "Bye" of target "check-flang-cmakefiles" does not exist.
  The dependency target "Bye" of target "check-flang-nongtestunit" does not exist.
  The dependency target "Bye" of target "check-flang-unit" does not exist.
  The dependency target "Bye" of target "check-flang-lib" does not exist.
  The dependency target "Bye" of target "check-flang-lib-analysis" does not exist.
  The dependency target "Bye" of target "check-flang-lib-analysis-aliasanalysis" does not exist.
  The dependency target "Bye" of target "check-flang-lib-analysis-aliasanalysis-cmakefiles" does not exist.
 The dependency target "Bye" of target "check-flang-lib-analysis-cmakefiles" does not exist.
  The dependency target "Bye" of target "check-flang-lib-cmakefiles" does not exist.
 ```
2. Setting `-DFLANG_INCLUDE_TESTS=OFF` avoids this problem, but then the compilation hangs on linux (for reasons I don't yet understand; it does get past this point on OSX):
  ```
  [...]
  [33/323] Building CXX object lib/Evaluate/CMakeFiles/obj.FortranEvaluate.dir/characteristics.cpp.o
 [34/323] Building CXX object lib/Evaluate/CMakeFiles/obj.FortranEvaluate.dir/constant.cpp.o
  [hangs until killed]
  ```
3. On windows, the equivalent standalone build instructions yield:
  ```
  CMake Error at CMakeLists.txt:51 (find_compiler_rt_library):
  Unknown CMake command "find_compiler_rt_library".
  ```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVt2O4jgTfRpzUyIKDuHnggtoyKeWemY-bU-v-g45cYV4MDZrV6B5-5Udumm2tTsz2kErIRB2XKfquHLqCO_VxiDOWL5g-bInWmqsmzX9A5IywqleaeVpds_4eAfkTspsgCywfFG2SkuWLxmfNER7z7I54wXjxUZR05ZJZXeMF5U1UvRr6zbIeFFrYTb9GlF6stWW8WLfas14wceMTyFuQ20dXB27g7IlcK0xAV0ZsuDxgE5oUN636MHWIFVdowsPxD1Fp5BQumTp-TtN4DrPiJZofdgl1m0YL6StPOMFNMKDsRALBGU8ubYiZY0PqVCjPPjGtlpCiSCkRMmyRcza2CN0TNVWa3uMZDUInoSRQluD56AsX1zF_R6LIcnzT3_v7DesiPGCHAZSd0KZ13Li2SyCqMB05PsCH0l2dhez-m01X35aJR07gwSefJev9fih6vtAf0d9OHopD52zzgPjk3BlaDxKxqdv1AOwUXr-nBfuPoktwiqcA0GBiiRJIgOFVmVomZ3Y4qXouZQPD79_SrrlbD6YDvKAJ6RcS9xjQK0U-mvYrw3C2-4JSLgNEjDOFydknIeOuaxVDVbb_plADtJiaAACfFGekn8bsh8zr5UOOf766MaaDaGn1ii6RfxbxY2XfZOwfWGEPnl1E7rfx-8LrYT_b9B-qKt-De5t-zdA_QjCX4SEJ_CIREGD2CjtL4uH-ef_re8_3z08LVfrr6vHr48sW34pCjZKQRyskr7T7r2zpcbd61ihBk3UtMru9kqLIHnQCLPxYA1oZdqXoDZB3h0Kb42He5DWMD4mOCFBayS6KLFhDCjq0g-F7oWnM6ZVhkK8L4_P35HHix5eFrKM8SLjGcuXsDhrO9w9P4MtwyiATjdXB6FbQUE6o8YWHZ-FLb8lhXXkhHl9JJHKBaVthBMVoVOeVOWTar9P7Cvd-SIb3gjWm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