[llvm-branch-commits] [clang] [flang] [lld] [llvm] [Flang] LLVM_ENABLE_RUNTIMES=FortranRuntime (PR #110217)

Michael Kruse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 9 02:23:42 PDT 2024


================
@@ -171,145 +76,88 @@ set(sources
   unit-map.cpp
   unit.cpp
   utf.cpp
-  ${FORTRAN_MODULE_OBJECTS}
 )
 
-include(AddFlangOffloadRuntime)
-
-# List of files that are buildable for all devices.
-set(supported_files
-  ISO_Fortran_binding.cpp
-  allocatable.cpp
-  allocator-registry.cpp
-  array-constructor.cpp
-  assign.cpp
-  buffer.cpp
-  character.cpp
-  connection.cpp
-  copy.cpp
-  derived-api.cpp
-  derived.cpp
-  descriptor.cpp
-  descriptor-io.cpp
-  dot-product.cpp
-  edit-input.cpp
-  edit-output.cpp
-  environment.cpp
-  extrema.cpp
-  external-unit.cpp
-  file.cpp
-  findloc.cpp
-  format.cpp
-  inquiry.cpp
-  internal-unit.cpp
-  io-api.cpp
-  io-api-minimal.cpp
-  io-error.cpp
-  io-stmt.cpp
-  iostat.cpp
-  matmul-transpose.cpp
-  matmul.cpp
-  memory.cpp
-  misc-intrinsic.cpp
-  namelist.cpp
-  non-tbp-dio.cpp
-  numeric.cpp
-  pointer.cpp
-  product.cpp
-  pseudo-unit.cpp
-  ragged.cpp
-  stat.cpp
-  sum.cpp
-  support.cpp
-  terminator.cpp
-  tools.cpp
-  transformational.cpp
-  type-code.cpp
-  type-info.cpp
-  unit.cpp
-  utf.cpp
+set(public_headers "")
+file(GLOB_RECURSE public_headers
+  "${FLANGRUNTIME_SOURCE_DIR}/include/flang/Runtime/*.h"
+  "${FLANGRUNTIME_SOURCE_DIR}/include/flang/Common/*.h"
   )
 
-enable_cuda_compilation(FortranRuntime "${supported_files}")
-enable_omp_offload_compilation("${supported_files}")
----------------
Meinersbur wrote:

I had expected that I moved those to `add_fortranruntime_library` but apparently I didn't. I re-added it with the latest push, including some build fixes since it doesn't even work with the trunk version. Even `flang-new` doesn't compile with the error:
```
ld.lld: error: undefined symbol: __cudaRegisterLinkedBinary_9067bd07_21_binary_to_decimal_cpp_c17d0b68
>>> referenced by tmpxft_00002a72_00000000-6_binary-to-decimal.cudafe1.cpp
>>>               binary-to-decimal.cpp.o:(__sti____cudaRegisterAll()) in archive lib/libFortranDecimal.a
```
This is because libFortranDecimal is [compiled as CUDA source](https://github.com/llvm/llvm-project/blob/cc99bddb71738761bfe21490f3b6853da036cf97/flang/lib/Decimal/CMakeLists.txt#L58) (but not libFortranCommon) and needed for `flang-new`. libFortranDecimal for FortranRuntime and Flang should really be compiled independently of each other, as this PR does.

https://github.com/llvm/llvm-project/pull/110217


More information about the llvm-branch-commits mailing list