Skip to content

Build errors #340

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

Open
miniskar opened this issue Feb 28, 2025 · 3 comments
Open

Build errors #340

miniskar opened this issue Feb 28, 2025 · 3 comments

Comments

@miniskar
Copy link

I am getting several compilation errors during the build. I have followed the steps exactly as mentioned in the README.

/home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/Error.h:1249: error: undefined reference to 'llvm::Twine::str() const' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/targets/systems/mock/MockTarget.cpp:282: error: undefined reference to 'llvm::sys::getDefaultTargetTriple()' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/targets/systems/mock/MockTarget.cpp:285: error: undefined reference to 'llvm::TargetRegistry::lookupTarget(llvm::StringRef, std::string&)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/targets/systems/mock/MockTarget.cpp:294: error: undefined reference to 'llvm::SubtargetFeatures::getString() const' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/include/Conversion/QUIRToLLVM/QUIRToLLVM.h:85: error: undefined reference to 'mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(mlir::RewritePatternSet&&, llvm::ArrayRef<std::string>, llvm::ArrayRef<std::string>)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/targets/systems/mock/Conversion/QUIRToStandard/QUIRToStandard.cpp:293: error: undefined reference to 'mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(mlir::RewritePatternSet&&, llvm::ArrayRef<std::string>, llvm::ArrayRef<std::string>)' /home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/CommandLine.h:652: error: undefined reference to 'vtable for llvm::cl::OptionValue<std::string>' /usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function /home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/CommandLine.h:1488: error: undefined reference to 'vtable for llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >' /usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function /home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/CommandLine.h:1158: error: undefined reference to 'vtable for llvm::cl::parser<std::string>' /usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function /home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/CommandLine.h:1158: error: undefined reference to 'vtable for llvm::cl::parser<std::string>' /usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Frontend/OpenQASM3/OpenQASM3Frontend.cpp:105: error: undefined reference to 'llvm::StringRef::lower() const' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Config/QSSConfig.cpp:326: error: undefined reference to 'mlir::DialectPlugin::load(std::string const&)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Config/QSSConfig.cpp:336: error: undefined reference to 'mlir::PassPlugin::load(std::string const&)' /home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/CommandLine.h:652: error: undefined reference to 'vtable for llvm::cl::OptionValue<std::string>' /usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function /home/nqx/.conan/data/llvm/17.0.5-0/_/_/package/fa4e83519b8c7ca96c21cb33c75ecc7a417721c3/include/llvm/Support/CommandLine.h:1226: error: undefined reference to 'llvm::cl::parser<std::string>::printOptionDiff(llvm::cl::Option const&, llvm::StringRef, llvm::cl::OptionValue<std::string> const&, unsigned long) const' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Dialect/QUIR/Transforms/BreakReset.cpp:159: error: undefined reference to 'mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(mlir::RewritePatternSet&&, llvm::ArrayRef<std::string>, llvm::ArrayRef<std::string>)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Dialect/QUIR/Transforms/ReorderMeasurements.cpp:236: error: undefined reference to 'mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(mlir::RewritePatternSet&&, llvm::ArrayRef<std::string>, llvm::ArrayRef<std::string>)' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef)' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::getValueExpectedFlagDefault() const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::getOptionWidth() const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::printOptionInfo(unsigned long) const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::printOptionValue(unsigned long, bool) const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::setDefault()' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::Pass::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::getExtraOptionNames(llvm::SmallVectorImpl<llvm::StringRef>&)' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:typeinfo for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'typeinfo for llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef)' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::getValueExpectedFlagDefault() const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::getOptionWidth() const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::printOptionInfo(unsigned long) const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::printOptionValue(unsigned long, bool) const' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::setDefault()' lib/libMLIRPulseTransforms.a(Passes.cpp.o):Passes.cpp:vtable for mlir::detail::PassOptions::Option<std::string, llvm::cl::parser<std::string> >: error: undefined reference to 'llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::getExtraOptionNames(llvm::SmallVectorImpl<llvm::StringRef>&)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Dialect/Pulse/Transforms/SchedulePort.cpp:252: error: undefined reference to 'llvm::toString(llvm::Error)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Dialect/Pulse/Transforms/SchedulePort.cpp:260: error: undefined reference to 'llvm::toString(llvm::Error)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Dialect/Pulse/Transforms/Scheduling.cpp:135: error: undefined reference to 'llvm::toString(llvm::Error)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Conversion/QUIRToPulse/LoadPulseCals.cpp:388: error: undefined reference to 'mlir::openInputFile(llvm::StringRef, std::string*)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Conversion/QUIRToPulse/QUIRToPulse.cpp:655: error: undefined reference to 'mlir::openInputFile(llvm::StringRef, std::string*)' /home/nqx/Quantum/quantum-resources/tmp/qe-compiler/lib/Dialect/Pulse/IR/PulseOps.cpp:183: error: undefined reference to 'llvm::toString(llvm::Error)'

Any suggestions to resolve these errors?

@taalexander
Copy link
Collaborator

HI @miniskar, this seems to be a linking error. Could you please post your Conan profile configuration and the system configuration you are using (os, compiler toolchain, etc.) as well as the exact commands you entered to build?

@miniskar
Copy link
Author

miniskar commented Feb 28, 2025

I tried it using two different profiles.

  1. using gcc
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
  1. using clang
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=17
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

Both are reporting same link time errors.

@taalexander
Copy link
Collaborator

Hmm, do you think you could post the full Cmakelogs so that I could look in more detail?

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