Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build link time error #170

Open
hamidelmaazouz opened this issue Jan 29, 2025 · 1 comment
Open

CMake build link time error #170

hamidelmaazouz opened this issue Jan 29, 2025 · 1 comment

Comments

@hamidelmaazouz
Copy link

hamidelmaazouz commented Jan 29, 2025

Hello @troelsfr and @swernli,

I tried to build QAT with CMake and got the following link errors:

[0/2] Re-checking globbed directories...
[119/143] Linking CXX executable qir/qat/TestToolsUnitTests
FAILED: qir/qat/TestToolsUnitTests 
: && /opt/llvm/llvm-14/bin/clang++ -fvisibility-inlines-hidden -Wall -Wextra -Weverything -Wconversion -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-padded -Wno-exit-time-destructors -Wno-global-constructors -Werror -Wno-documentation-unknown-command -O3 -DNDEBUG -O3  qir/qat/CMakeFiles/TestToolsUnitTests.dir/TestTools/Tests/Unit/main.cpp.o qir/qat/CMakeFiles/TestToolsUnitTests.dir/TestTools/Tests/Unit/vm.cpp.o -o qir/qat/TestToolsUnitTests -L/home/hamidelmaazouz/repositories/qir-alliance/qat/build/release/llvm/lib   -L/opt/llvm/llvm-14/lib -Wl,-rpath,/home/hamidelmaazouz/repositories/qir-alliance/qat/build/release/llvm/lib:/opt/llvm/llvm-14/lib:/home/hamidelmaazouz/repositories/qir-alliance/qat/build/release/lib:/home/hamidelmaazouz/repositories/qir-alliance/qat/build/release/vendors/yaml-cpp  /opt/llvm/llvm-14/lib/libLLVMOrcJIT.so.14  /opt/llvm/llvm-14/lib/libLLVMMCJIT.so.14  /opt/llvm/llvm-14/lib/libLLVMX86AsmParser.so.14  /opt/llvm/llvm-14/lib/libLLVMX86CodeGen.so.14  /opt/llvm/llvm-14/lib/libLLVMX86Desc.so.14  /opt/llvm/llvm-14/lib/libLLVMX86Disassembler.so.14  /opt/llvm/llvm-14/lib/libLLVMX86Info.so.14  /opt/llvm/llvm-14/lib/libLLVMInterpreter.so.14  /opt/llvm/llvm-14/lib/libLLVMAArch64AsmParser.so.14  /opt/llvm/llvm-14/lib/libLLVMAArch64CodeGen.so.14  /opt/llvm/llvm-14/lib/libLLVMAArch64Disassembler.so.14  qir/qat/libTestTools.a  lib/libgmock_main.so.1.11.0  qir/qat/libTestTools.a  qir/qat/libAdaptorFactory.a  qir/qat/libLogging.a  qir/qat/Passes/libGroupingPass.a  qir/qat/Passes/libFunctionReplacementPass.a  /opt/llvm/llvm-14/lib/libLLVMPasses.so.14  /opt/llvm/llvm-14/lib/libLLVMObjCARCOpts.so.14  /opt/llvm/llvm-14/lib/libLLVMIRReader.so.14  /opt/llvm/llvm-14/lib/libLLVMCore.so.14  /opt/llvm/llvm-14/lib/libLLVMAArch64Desc.so.14  /opt/llvm/llvm-14/lib/libLLVMAArch64Info.so.14  /opt/llvm/llvm-14/lib/libLLVMSupport.so.14  lib/libgmock.so.1.11.0  lib/libgtest.so.1.11.0  qir/qat/Passes/libTargetQisMappingPass.a  qir/qat/libRules.a  qir/qat/libCommandline.a  qir/qat/libAllocationManager.a  qir/qat/libQirAdaptor.a  qir/qat/libValidator.a  qir/qat/libLogging.a  qir/qat/Passes/libStaticResourceComponent.a  qir/qat/Passes/libValidationPass.a  qir/qat/Passes/libPostTransformValidation.a  qir/qat/Passes/libRemoveNonEntrypointFunctions.a  qir/qat/Passes/libZExtTransformPass.a  qir/qat/Passes/libDeferMeasurementPass.a  vendors/yaml-cpp/libyaml-cpp.so.0.7.0  -Wl,-rpath-link,/opt/llvm/llvm-14/lib && :
/usr/bin/ld: /opt/llvm/llvm-14/lib/libLLVMOrcJIT.so.14: undefined reference to symbol '_ZN4llvm17CloneFunctionIntoEPNS_8FunctionEPKS0_RNS_8ValueMapIPKNS_5ValueENS_14WeakTrackingVHENS_14ValueMapConfigIS7_NS_3sys10SmartMutexILb0EEEEEEENS_23CloneFunctionChangeTypeERNS_15SmallVectorImplIPNS_10ReturnInstEEEPKcPNS_14ClonedCodeInfoEPNS_20ValueMapTypeRemapperEPNS_17ValueMaterializerE'
/usr/bin/ld: /opt/llvm/llvm-14/lib/libLLVMTransformUtils.so.14: error adding symbols: DSO missing from command line
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
[126/143] Building CXX object AdaptorExamples/CMakeFiles/CArrayMap.dir/CArrayMap/main.cpp.o
ninja: build stopped: subcommand failed.```

Could you help me where I went wrong in the setup ?
@swernli
Copy link
Collaborator

swernli commented Feb 6, 2025

Hi @hamidelmaazouz, what kind of build environment are you using? It may affect what binaries are available on the system to link against.

As an example of a build environment, check out the development container configured in the repository, where the Dockerfile specifies what dependencies get installed on Ubuntu 22.04: https://github.com/qir-alliance/qat/blob/main/.devcontainer/Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants