xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

tests/projects/package/llvm_dev/xmake.lua 示例无法正常构建,报错LINK : fatal error LNK1181: 无法打开输入文件“MLIRAMX.lib” #5475

Closed Arteiimis closed 3 months ago

Arteiimis commented 3 months ago

Xmake 版本

2.9.4

操作系统版本和架构

win10

描述问题

llvm_dev/xmake.lua 下的示例无法正常构建,报错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 3 months ago

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


Title: tests/projects/package/llvm_dev/xmake.lua example cannot be built normally, error LINK: fatal error LNK1181: Unable to open input file "MLIRAMX.lib"