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] Include more link libraries #88

Merged
merged 1 commit into from
Sep 19, 2019
Merged

Conversation

FireBurn
Copy link
Contributor

This is required to get dev-libs/rocm-opencl-driver-2.7.0 compiling for me on Gentoo

I think it might be related to using -Wl,--as-needed in my link flags globally

This is required to get dev-libs/rocm-opencl-driver-2.7.0 compiling for me on Gentoo

I think it might be related to using -Wl,--as-needed in my link flags globally
@FireBurn
Copy link
Contributor Author

FireBurn commented Aug 27, 2019

Without this patch I see the following errors during compilation:

FAILED: src/roc-cl/roc-cl 
: && /usr/bin/x86_64-pc-linux-gnu-g++  -O3 -march=native -pipe -std=c++11 -fno-rtti -Wall  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -I/usr/lib/llvm/roc/include/    -rdynamic src/roc-cl/CMakeFiles/roc-cl.dir/roc-cl.cpp.o  -o src/roc-cl/roc-cl -L/usr/lib/llvm/roc/lib -Wl,-rpath,/usr/lib/llvm/roc/lib:/var/tmp/portage/dev-libs/rocm-opencl-driver-2.7.0/work/rocm-opencl-driver-2.7.0_build/src/driver: src/driver/libopencl_driver.so -lclangDriver -lclangFrontend -lclangEdit -lclangLex -lclangBasic -lclangCodeGen -llldELF -llldCore /usr/lib/llvm/roc/lib/libLLVMDebugInfoDWARF.so.9roc /usr/lib/llvm/roc/lib/libLLVMAMDGPUDesc.so.9roc /usr/lib/llvm/roc/lib/libLLVMX86Desc.so.9roc /usr/lib/llvm/roc/lib/libLLVMAMDGPUDisassembler.so.9roc /usr/lib/llvm/roc/lib/libLLVMX86Disassembler.so.9roc /usr/lib/llvm/roc/lib/libLLVMAMDGPUInfo.so.9roc /usr/lib/llvm/roc/lib/libLLVMX86Info.so.9roc /usr/lib/llvm/roc/lib/libLLVMCodeGen.so.9roc /usr/lib/llvm/roc/lib/libLLVMMC.so.9roc /usr/lib/llvm/roc/lib/libLLVMMCDisassembler.so.9roc /usr/lib/llvm/roc/lib/libLLVMObject.so.9roc /usr/lib/llvm/roc/lib/libLLVMSymbolize.so.9roc /usr/lib/llvm/roc/lib/libLLVMCore.so.9roc /usr/lib/llvm/roc/lib/libLLVMOption.so.9roc /usr/lib/llvm/roc/lib/libLLVMSupport.so.9roc /usr/lib/llvm/roc/lib/libLLVMAMDGPUCodeGen.so.9roc /usr/lib/llvm/roc/lib/libLLVMAMDGPUAsmParser.so.9roc && :
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::WriteBitcodeToFile(llvm::Module const&, llvm::raw_ostream&, bool, llvm::ModuleSummaryIndex const*, bool, std::array<unsigned int, 5ul>*)'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::Linker::linkInModule(std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, unsigned int, std::function<void (llvm::Module&, llvm::StringSet<llvm::MallocAllocator> const&)>)'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::getLazyIRFileModule(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool)'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::Linker::Linker(llvm::Module&)'
src/driver/libopencl_driver.so: error: undefined reference to 'clang::PCHContainerOperations::PCHContainerOperations()'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::MCAsmParser::setTargetParser(llvm::MCTargetAsmParser&)'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::createMCAsmParser(llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo const&, unsigned int)'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::IRMover::StructTypeKeyInfo::isEqual(llvm::StructType const*, llvm::StructType const*)'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::IRMover::StructTypeKeyInfo::getTombstoneKey()'
src/driver/libopencl_driver.so: error: undefined reference to 'llvm::IRMover::StructTypeKeyInfo::getEmptyKey()'
collect2: error: ld returned 1 exit status

@emankov emankov added the fix label Aug 27, 2019
@emankov emankov changed the title Include more link libraries [cmake] Include more link libraries Aug 27, 2019
Copy link
Contributor

@emankov emankov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Btw, LLVM became c++14 a few weks ago, so use -std=c++14 now.

@candrews
Copy link
Contributor

FWIW, LGTM as well. Thank you @FireBurn!

@ghost
Copy link

ghost commented Sep 19, 2019

Some time has passed (23 days) and this simple patch has not been merged yet. Please consider closing (merge into master or reject) this pull request today. Thanks.

@emankov
Copy link
Contributor

emankov commented Sep 19, 2019

@kzhuravl, could you please merge it. Thanks!

@kzhuravl kzhuravl merged commit 48f0a53 into ROCm:master Sep 19, 2019
@kzhuravl
Copy link
Contributor

Done, thanks.

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

Successfully merging this pull request may close these issues.

None yet

4 participants