xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
687 stars 396 forks source link

[llvm] llvm library模式无法正常构建,报错LINK : fatal error LNK1181: 无法打开输入文件“MLIRAMX.lib #4978

Open Arteiimis opened 2 months ago

Arteiimis commented 2 months ago

Xmake 版本

2.9.4

操作系统版本和架构

win10

描述问题

llvm library模式无法正常构建,报错LINK : fatal error LNK1181: 无法打开输入文件“MLIRAMX.lib

期待的结果

正常构建,并包含用于llvm ir生成的对应头文件

工程配置

add_rules("mode.debug", "mode.release")

add_requires("llvm", {kind = "library", configs = {mlir = true}})

target("testllvm")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("llvm", {components = "mlir"})

附加信息和错误日志

[ 50%]: compiling.release src\main.cpp
"D:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\cl.exe" -c -nologo -O2 /EHsc -external:W0 -external:IC:\Users\LEGION\AppData\Local\.xmake\packages\l\llvm\18.1.1\837ff3459a2342f692b7b6753ec85be6\include -DNDEBUG -Fobuild\.objs\testllvm\windows\x64\release\src\main.cpp.obj src\main.cpp
[ 75%]: linking.release testllvm.exe
"D:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf MLIRAMX.lib MLIRAMXToLLVMIRTranslation.lib MLIRAMXTransforms.lib MLIRAffine.lib MLIRAffineAnalysis.lib MLIRAffineBufferizableOpInterfaceImpl.lib MLIRAffineToStandard.lib MLIRAffineTransforms.lib MLIRAffineTransformsTestPasses.lib MLIRAffineUtils.lib MLIRAnalysis.lib MLIRArithmetic.lib MLIRArithmeticToLLVM.lib MLIRArithmeticToSPIRV.lib MLIRArithmeticTransforms.lib MLIRAsync.lib MLIRAsyncToLLVM.lib MLIRAsyncTransforms.lib MLIRBufferization.lib MLIRBufferizationToMemRef.lib MLIRBufferizationTransforms.lib MLIRCAPIAsync.lib MLIRCAPIConversion.lib MLIRCAPIDebug.lib MLIRCAPIExecutionEngine.lib MLIRCAPIGPU.lib MLIRCAPIIR.lib MLIRCAPIInterfaces.lib MLIRCAPILLVM.lib MLIRCAPILinalg.lib MLIRCAPIPDL.lib MLIRCAPIQuant.lib MLIRCAPIRegistration.lib MLIRCAPISCF.lib MLIRCAPIShape.lib MLIRCAPISparseTensor.lib MLIRCAPIStandard.lib MLIRCAPITensor.lib MLIRCAPITransforms.lib MLIRCallInterfaces.lib MLIRCastInterfaces.lib MLIRComplex.lib MLIRComplexToLLVM.lib MLIRComplexToStandard.lib MLIRControlFlowInterfaces.lib MLIRCopyOpInterface.lib MLIRDLTI.lib MLIRDLTITestPasses.lib MLIRDataLayoutInterfaces.lib MLIRDerivedAttributeOpInterface.lib MLIRDialect.lib MLIRDialectUtils.lib MLIREmitC.lib MLIRExecutionEngine.lib MLIRGPUOps.lib MLIRGPUTestPasses.lib MLIRGPUToGPURuntimeTransforms.lib MLIRGPUToNVVMTransforms.lib MLIRGPUToROCDLTransforms.lib MLIRGPUToSPIRV.lib MLIRGPUToVulkanTransforms.lib MLIRGPUTransforms.lib MLIRIR.lib MLIRInferTypeOpInterface.lib MLIRJitRunner.lib MLIRLLVMCommonConversion.lib MLIRLLVMIR.lib MLIRLLVMIRTransforms.lib MLIRLLVMToLLVMIRTranslation.lib MLIRLinalg.lib MLIRLinalgAnalysis.lib MLIRLinalgBufferizableOpInterfaceImpl.lib MLIRLinalgTestPasses.lib MLIRLinalgToLLVM.lib MLIRLinalgToSPIRV.lib MLIRLinalgToStandard.lib MLIRLinalgTransforms.lib MLIRLinalgUtils.lib MLIRLoopLikeInterface.lib MLIRLspServerLib.lib MLIRMath.lib MLIRMathTestPasses.lib MLIRMathToLLVM.lib MLIRMathToLibm.lib MLIRMathToSPIRV.lib MLIRMathTransforms.lib MLIRMemRef.lib MLIRMemRefTestPasses.lib MLIRMemRefToLLVM.lib MLIRMemRefToSPIRV.lib MLIRMemRefTransforms.lib MLIRMemRefUtils.lib MLIRMlirOptMain.lib MLIRModuleBufferization.lib MLIRNVVMIR.lib MLIRNVVMToLLVMIRTranslation.lib MLIROpenACC.lib MLIROpenACCToLLVM.lib MLIROpenACCToLLVMIRTranslation.lib MLIROpenACCToSCF.lib MLIROpenMP.lib MLIROpenMPToLLVM.lib MLIROpenMPToLLVMIRTranslation.lib MLIROptLib.lib MLIRPDL.lib MLIRPDLInterp.lib MLIRPDLLAST.lib MLIRPDLLParser.lib MLIRPDLToPDLInterp.lib MLIRParser.lib MLIRPass.lib MLIRPresburger.lib MLIRQuant.lib MLIRROCDLIR.lib MLIRROCDLToLLVMIRTranslation.lib MLIRReconcileUnrealizedCasts.lib MLIRReduce.lib MLIRReduceLib.lib MLIRRewrite.lib MLIRSCF.lib MLIRSCFTestPasses.lib MLIRSCFToGPU.lib MLIRSCFToOpenMP.lib MLIRSCFToSPIRV.lib MLIRSCFToStandard.lib MLIRSCFTransforms.lib MLIRSCFUtils.lib MLIRSPIRV.lib MLIRSPIRVBinaryUtils.lib MLIRSPIRVConversion.lib MLIRSPIRVDeserialization.lib MLIRSPIRVModuleCombiner.lib MLIRSPIRVSerialization.lib MLIRSPIRVTestPasses.lib MLIRSPIRVToLLVM.lib MLIRSPIRVTransforms.lib MLIRSPIRVTranslateRegistration.lib MLIRSPIRVUtils.lib MLIRShape.lib MLIRShapeOpsTransforms.lib MLIRShapeTestPasses.lib MLIRShapeToStandard.lib MLIRSideEffectInterfaces.lib MLIRSparseTensor.lib MLIRSparseTensorPipelines.lib MLIRSparseTensorTransforms.lib MLIRSparseTensorUtils.lib MLIRStandard.lib MLIRStandardOpsTestPasses.lib MLIRStandardOpsTransforms.lib MLIRStandardToLLVM.lib MLIRStandardToSPIRV.lib MLIRSupport.lib MLIRSupportIndentedOstream.lib MLIRTableGen.lib MLIRTargetCpp.lib MLIRTargetLLVMIRExport.lib MLIRTargetLLVMIRImport.lib MLIRTensor.lib MLIRTensorInferTypeOpInterfaceImpl.lib MLIRTensorTilingInterfaceImpl.lib MLIRTensorTransforms.lib MLIRTensorUtils.lib MLIRTestAnalysis.lib MLIRTestDialect.lib MLIRTestIR.lib MLIRTestPass.lib MLIRTestReducer.lib MLIRTestRewrite.lib MLIRTestStandardToLLVM.lib MLIRTestTransforms.lib MLIRTilingInterface.lib MLIRToLLVMIRTranslationRegistration.lib MLIRTosa.lib MLIRTosaTestPasses.lib MLIRTosaToLinalg.lib MLIRTosaToSCF.lib MLIRTosaToStandard.lib MLIRTosaTransforms.lib MLIRTransformUtils.lib MLIRTransforms.lib MLIRTranslation.lib MLIRVector.lib MLIRVectorInterfaces.lib MLIRVectorTestPasses.lib MLIRVectorToGPU.lib MLIRVectorToLLVM.lib MLIRVectorToROCDL.lib MLIRVectorToSCF.lib MLIRVectorToSPIRV.lib MLIRVectorTransforms.lib MLIRVectorUtils.lib MLIRViewLikeInterface.lib MLIRX86Vector.lib MLIRX86VectorToLLVMIRTranslation.lib MLIRX86VectorTransforms.lib LLVMX86CodeGen.lib LLVMX86Desc.lib LLVMX86Info.lib LLVMX86AsmParser.lib LLVMX86Disassembler.lib LLVMX86TargetMCA.lib LLVMExegesisX86.lib LLVMIRReader.lib LLVMAsmParser.lib LLVMExecutionEngine.lib LLVMRuntimeDyld.lib LLVMAsmPrinter.lib LLVMDebugInfoDWARF.lib LLVMGlobalISel.lib LLVMSelectionDAG.lib LLVMMCDisassembler.lib LLVMPasses.lib LLVMCodeGen.lib LLVMipo.lib LLVMBitWriter.lib LLVMInstrumentation.lib LLVMScalarOpts.lib LLVMAggressiveInstCombine.lib LLVMInstCombine.lib LLVMVectorize.lib LLVMTransformUtils.lib LLVMTarget.lib LLVMAnalysis.lib LLVMProfileData.lib LLVMObject.lib LLVMBitReader.lib LLVMCore.lib LLVMRemarks.lib LLVMBitstreamReader.lib LLVMMCParser.lib LLVMMC.lib LLVMBinaryFormat.lib LLVMDebugInfoCodeView.lib LLVMSupport.lib LLVMDemangle.lib LLVMMIRParser.lib LLVMCFGuard.lib LLVMCFIVerify.lib LLVMCoroutines.lib LLVMCoverage.lib LLVMDWARFLinker.lib LLVMDWP.lib LLVMDebugInfoGSYM.lib LLVMDebugInfoMSF.lib LLVMDebugInfoPDB.lib LLVMDebuginfod.lib LLVMDiff.lib LLVMDlltoolDriver.lib LLVMExegesis.lib LLVMExtensions.lib LLVMFileCheck.lib LLVMFrontendOpenACC.lib LLVMFrontendOpenMP.lib 
LLVMFuzzMutate.lib LLVMInterfaceStub.lib LLVMInterpreter.lib LLVMJITLink.lib LLVMLTO.lib LLVMLibDriver.lib LLVMLineEditor.lib LLVMLinker.lib LLVMMCA.lib LLVMMCJIT.lib LLVMObjCARCOpts.lib LLVMObjectYAML.lib LLVMOption.lib LLVMOrcJIT.lib LLVMOrcShared.lib LLVMOrcTargetProcess.lib LLVMSymbolize.lib LLVMTableGen.lib LLVMTableGenGlobalISel.lib LLVMTextAPI.lib LLVMWindowsManifest.lib LLVMXRay.lib -out:build\windows\x64\release\testllvm.exe build\.objs\testllvm\windows\x64\release\src\main.cpp.obj
error: @programdir\core\main.lua:329: @programdir\actions\build\main.lua:148: @programdir\modules\async\runjobs.lua:325: @programdir\actions\build\kinds\binary.lua:53: @programdir\modules\core\tools\link.lua:175: LINK : fatal error LNK1181: 无法打开输入文件“MLIRAMX.lib”

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\modules\core\tools\link.lua:175]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\link.lua:150]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [@programdir\actions\build\kinds\binary.lua:53]: in function 'callback'
    [@programdir\modules\core\project\depend.lua:217]: in function 'on_changed'
    [@programdir\actions\build\kinds\binary.lua:41]: in function '_do_link_target'
    [@programdir\actions\build\kinds\binary.lua:83]:
    [@programdir\actions\build\kinds\binary.lua:110]: in function '_link_target'
    [@programdir\actions\build\kinds\binary.lua:138]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\async\runjobs.lua:223]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:973: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir\core\main.lua:329: in upvalue 'cotask'
        @programdir\core\base\scheduler.lua:406: in function <@programdir\core\base\scheduler.lua:399>
Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [llvm] llvm library mode cannot be built normally, error LINK: fatal error LNK1181: Unable to open input file "MLIRAMX.lib

star-hengxing commented 2 months ago

目前只有 windows 平台下载的预编译二进制,而 llvm 官方 Windows release 只有 binary 没有 lib。需要来个 pr 完善一下

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Currently, there are only precompiled binaries downloaded for the windows platform, and the official Windows release of llvm only has binary and no lib. Need a PR to improve it