Skip to content

Conversation

@tarunprabhu
Copy link
Contributor

libflangPasses.so was not linked against the correct libraries which caused a build failure with -DBUILD_SHARED_LIBS=On. Fixes #110425

@tarunprabhu tarunprabhu marked this pull request as draft October 2, 2024 13:31
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir labels Oct 2, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 2, 2024

@llvm/pr-subscribers-flang-fir-hlfir

Author: Tarun Prabhu (tarunprabhu)

Changes

libflangPasses.so was not linked against the correct libraries which caused a build failure with -DBUILD_SHARED_LIBS=On. Fixes #110425


Full diff: https://github.com/llvm/llvm-project/pull/110840.diff

1 Files Affected:

  • (modified) flang/lib/Optimizer/Passes/CMakeLists.txt (+5)
diff --git a/flang/lib/Optimizer/Passes/CMakeLists.txt b/flang/lib/Optimizer/Passes/CMakeLists.txt
index 3df988940e005f..40abbdfbdd6511 100644
--- a/flang/lib/Optimizer/Passes/CMakeLists.txt
+++ b/flang/lib/Optimizer/Passes/CMakeLists.txt
@@ -1,3 +1,6 @@
+get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
+get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
+
 add_flang_library(flangPasses
   CommandLineOpts.cpp
   Pipelines.cpp
@@ -9,6 +12,8 @@ add_flang_library(flangPasses
   FIRCodeGen
   FIRTransforms
   FlangOpenMPTransforms
+  ${dialect_libs}
+  ${extension_libs}
   FortranCommon
   HLFIRTransforms
   MLIRPass

@tarunprabhu tarunprabhu requested a review from pawosm-arm October 2, 2024 13:32
@tarunprabhu
Copy link
Contributor Author

@pawosm-arm

Could you double check that this fix works for you. I am still in the process of building it myself, but a second check might be helpful. Thanks!

@tarunprabhu tarunprabhu marked this pull request as ready for review October 2, 2024 15:06
@tarunprabhu
Copy link
Contributor Author

It seems to have worked for me with your configuration line, @pawosm-arm

@tarunprabhu
Copy link
Contributor Author

@pawosm-arm, does this fix your issue?

@pawosm-arm
Copy link
Contributor

I'll look into it today, though it may take some time before I complete this.

@pawosm-arm
Copy link
Contributor

The good news is that it builds with -j9 now, so your patch has definitely helped. Yet still I can't build with -j1, but this is caused by some other issue (of similar nature):

llvm-project/mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.h:84:10: fatal error: mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc: No such file or directory
   84 | #include "mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgDialect.dir/build.make:104: tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgDialect.dir/LinalgDialect.cpp.o] Error 1

I assume it is not in scope of this patch.

@tarunprabhu
Copy link
Contributor Author

llvm-project/mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.h:84:10: fatal error: mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc: No such file or directory
   84 | #include "mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgDialect.dir/build.make:104: tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgDialect.dir/LinalgDialect.cpp.o] Error 1

I assume it is not in scope of this patch.

Thanks for taking a look, Paul. I don't see this error in the original issue that you filed, so I think it is best to merge this in now. I will work on trying to reproduce and resolve the missing .inc file problem . You could open a separate issue for that if you wish.

libflangPasses.so was not linked against the correct libraries which caused a
build failure with -DBUILD_SHARED_LIBS=On. Fixes llvm#110425
@tarunprabhu tarunprabhu merged commit 4605ba0 into llvm:main Oct 9, 2024
9 checks passed
@tarunprabhu tarunprabhu deleted the 110425 branch October 9, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:fir-hlfir flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flang][regression] cannot build flang utilizing low number of cores after #109874

3 participants