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

hcc build failed @ [ 97%] Built target ocml_lib #450

Closed
gonuco opened this issue Sep 1, 2017 · 2 comments
Closed

hcc build failed @ [ 97%] Built target ocml_lib #450

gonuco opened this issue Sep 1, 2017 · 2 comments

Comments

@gonuco
Copy link

gonuco commented Sep 1, 2017

make[2]: Leaving directory '/home/xxxx/hcc/build'
make[2]: Entering directory '/home/xxxx/hcc/build'
make[2]: Nothing to be done for 'compiler/tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/build'.
make[2]: Leaving directory '/home/xxxx/hcc/build'
[ 89%] Built target clang_links
[ 89%] Building OCL object rocdl/opencl/CMakeFiles/opencl_lib.dir/src/misc/atom.cl
cd /home/xxx/hcc/build/rocdl/opencl && /home/xxx/hcc/build/compiler/./bin/clang -I/home/xxx/hcc/build/include -I/home/xxx/hcc/include -I/home/xxx/hcc/compiler/include -I/home/xxx/hcc/rocdl/opencl/src/integer -I/home/xxx/hcc/rocdl/opencl/src/workgroup -I/home/xxx/hcc/rocdl/opencl/../irif/inc -I/home/xxx/hcc/rocdl/opencl/../ocml/inc -I/home/xxx/hcc/rocdl/opencl/../ockl/inc -I/home/xxx/hcc/rocdl/opencl/../oclc/inc -o CMakeFiles/opencl_lib.dir/src/misc/atom.cl -Werror -x cl -Xclang -cl-std=CL2.0 -fblocks -target amdgcn--amdhsa-amdgizcl -DCL_VERSION_2_0=200 -D__OPENCL_C_VERSION__=200 -Dcl_khr_fp64 -Dcl_khr_fp16 -Dcl_khr_subgroups -Dcl_khr_int64_base_atomics -Dcl_khr_int64_extended_atomics -Xclang -finclude-default-header -emit-llvm -c /home/xxx/hcc/rocdl/opencl/src/misc/atom.cl
[ 89%] Built target c-arcmt-test
make[2]: Leaving directory '/home/xxxx/hcc/build'
make -f lib/hsa/CMakeFiles/mcwamp_hsa.dir/build.make lib/hsa/CMakeFiles/mcwamp_hsa.dir/build
[ 89%] Built target c-index-test
make[2]: Entering directory '/home/xxxx/hcc/build'
make[2]: Nothing to be done for 'lib/hsa/CMakeFiles/mcwamp_hsa.dir/build'.
make[2]: Leaving directory '/home/xxxx/hcc/build'
make[2]: Entering directory '/home/xxxx/hcc/build'
make[2]: Nothing to be done for 'rocdl/ocml/CMakeFiles/ocml_lib.dir/build'.
make[2]: Leaving directory '/home/xxxx/hcc/build'
[ 89%] Built target mcwamp_hsa
[ 97%] Built target ocml_lib
clang-6.0: /home/xxx/hcc/compiler/lib/IR/Instructions.cpp:2579: static llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
#0 0x00000000031b840f llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/xxx/hcc/compiler/lib/Support/Unix/Signals.inc:398:0
#1 0x00000000031b84a2 PrintStackTraceSignalHandler(void*) /home/xxx/hcc/compiler/lib/Support/Unix/Signals.inc:462:0
#2 0x00000000031b66e9 llvm::sys::RunSignalHandlers() /home/xxx/hcc/compiler/lib/Support/Signals.cpp:49:0
#3 0x00000000031b7c84 SignalHandler(int) /home/xxx/hcc/compiler/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f3d3afb7390 _restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#5 0x00007f3d3a16c428 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35428)
#6 0x00007f3d3a16e02a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3702a)
#7 0x00007f3d3a164bd7 (/lib/x86_64-linux-gnu/libc.so.6+0x2dbd7)
#8 0x00007f3d3a164c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#9 0x0000000002a6397d llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*) /home/xxx/hcc/compiler/lib/IR/Instructions.cpp:2581:0
#10 0x00000000034ed79c llvm::IRBuilder<llvm::ConstantFolder, clang::CodeGen::CGBuilderInserter>::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&) /home/xxx/hcc/compiler/include/llvm/IR/IRBuilder.h:1482:0
#11 0x00000000034ed1a4 llvm::IRBuilder<llvm::ConstantFolder, clang::CodeGen::CGBuilderInserter>::CreateBitCast(llvm::Value*, llvm::Type*, llvm::Twine const&) /home/xxx/hcc/compiler/include/llvm/IR/IRBuilder.h:1447:0
#12 0x000000000374dd88 AddDirectArgument(clang::CodeGen::CodeGenFunction&, clang::CodeGen::CallArgList&, bool, llvm::Value*, clang::QualType, clang::SourceLocation, clang::CharUnits) /home/xxx/hcc/clang/lib/CodeGen/CGAtomic.cpp:730:0
#13 0x000000000374f17b clang::CodeGen::CodeGenFunction::EmitAtomicExpr(clang::AtomicExpr*) /home/xxx/hcc/clang/lib/CodeGen/CGAtomic.cpp:1045:0
#14 0x000000000383e813 (anonymous namespace)::ScalarExprEmitter::VisitAtomicExpr(clang::AtomicExpr*) /home/xxx/hcc/clang/lib/CodeGen/CGExprScalar.cpp:3750:0
#15 0x00000000038405b3 clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) /home/xxx/hcc/build/compiler/tools/clang/include/clang/AST/StmtNodes.inc:175:0
#16 0x000000000382c869 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) /home/xxx/hcc/clang/lib/CodeGen/CGExprScalar.cpp:361:0
#17 0x000000000383e8cd clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) /home/xxx/hcc/clang/lib/CodeGen/CGExprScalar.cpp:3765:0
#18 0x00000000034ff958 clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) /home/xxx/hcc/clang/lib/CodeGen/CGStmt.cpp:1086:0
#19 0x00000000034fb8ba clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) /home/xxx/hcc/clang/lib/CodeGen/CGStmt.cpp:139:0
#20 0x00000000034fc53b clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) /home/xxx/hcc/clang/lib/CodeGen/CGStmt.cpp:379:0
#21 0x0000000003570b31 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&, clang::Stmt const*) /home/xxx/hcc/clang/lib/CodeGen/CodeGenFunction.cpp:1094:0
#22 0x0000000003571b0f clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) /home/xxx/hcc/clang/lib/CodeGen/CodeGenFunction.cpp:1269:0
#23 0x00000000035926db clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/xxx/hcc/clang/lib/CodeGen/CodeGenModule.cpp:3364:0
#24 0x000000000358dbb9 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/xxx/hcc/clang/lib/CodeGen/CodeGenModule.cpp:2176:0
#25 0x000000000358bf41 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) /home/xxx/hcc/clang/lib/CodeGen/CodeGenModule.cpp:1860:0
#26 0x00000000035967ae clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /home/xxx/hcc/clang/lib/CodeGen/CodeGenModule.cpp:4109:0
#27 0x0000000004014d7b (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) /home/xxx/hcc/clang/lib/CodeGen/ModuleBuilder.cpp:151:0
#28 0x000000000400e749 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /home/xxx/hcc/clang/lib/CodeGen/CodeGenAction.cpp:138:0
#29 0x0000000004d5e1c0 clang::ParseAST(clang::Sema&, bool, bool) /home/xxx/hcc/clang/lib/Parse/ParseAST.cpp:151:0
#30 0x0000000003af75fd clang::ASTFrontendAction::ExecuteAction() /home/xxx/hcc/clang/lib/Frontend/FrontendAction.cpp:1004:0
#31 0x000000000400cfe2 clang::CodeGenAction::ExecuteAction() /home/xxx/hcc/clang/lib/CodeGen/CodeGenAction.cpp:998:0
#32 0x0000000003af7012 clang::FrontendAction::Execute() /home/xxx/hcc/clang/lib/Frontend/FrontendAction.cpp:906:0
#33 0x0000000003a94140 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/xxx/hcc/clang/lib/Frontend/CompilerInstance.cpp:986:0
#34 0x0000000003c435a5 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/xxx/hcc/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#35 0x0000000001c28686 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/xxx/hcc/clang/tools/driver/cc1_main.cpp:221:0
#36 0x0000000001c1d905 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/xxx/hcc/clang/tools/driver/driver.cpp:306:0
#37 0x0000000001c1e523 main /home/xxx/hcc/clang/tools/driver/driver.cpp:387:0
#38 0x00007f3d3a157830 libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#39 0x0000000001c1af19 start (/home/xxxx/hcc/build/compiler/bin/clang-6.0+0x1c1af19)
Stack dump:
0. Program arguments: /home/xxxx/hcc/build/compiler/bin/clang-6.0 -cc1 -D__KALMAR_CPU
=1 -D__HCC_CPU
=1 -triple amdgcn--amdhsa-amdgizcl -emit-llvm-bc -emit-llvm-uselists -disable-free -main-file-name atom.cl -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/xxx/hcc/build/rocdl/opencl/CMakeFiles/opencl_lib.dir/src/misc/atom.gcno -resource-dir /home/xxxx/hcc/build/compiler/lib/clang/6.0.0 -I /home/xxx/hcc/build/include -I /home/xxx/hcc/include -I /home/xxx/hcc/compiler/include -I /home/xxx/hcc/rocdl/opencl/src/integer -I /home/xxx/hcc/rocdl/opencl/src/workgroup -I /home/xxx/hcc/rocdl/opencl/../irif/inc -I /home/xxx/hcc/rocdl/opencl/../ocml/inc -I /home/xxx/hcc/rocdl/opencl/../ockl/inc -I /home/xxx/hcc/rocdl/opencl/../oclc/inc -D CL_VERSION_2_0=200 -D OPENCL_C_VERSION=200 -D cl_khr_fp64 -D cl_khr_fp16 -D cl_khr_subgroups -D cl_khr_int64_base_atomics -D cl_khr_int64_extended_atomics -Werror -fdebug-compilation-dir /home/xxx/hcc/build/rocdl/opencl -ferror-limit 19 -fmessage-length 204 -fblocks -fobjc-runtime=gcc -fdiagnostics-show-option -cl-std=CL2.0 -finclude-default-header -o CMakeFiles/opencl_lib.dir/src/misc/atom.cl -x cl /home/xxx/hcc/rocdl/opencl/src/misc/atom.cl

  1. /home/xxx/hcc/rocdl/opencl/src/misc/atom.cl:98:1 <Spelling=/home/xxx/hcc/rocdl/opencl/src/misc/atom.cl:11:14>: current parser token 'attribute'
  2. /home/xxx/hcc/rocdl/opencl/src/misc/atom.cl:98:1 <Spelling=:2:1>: LLVM IR generation of declaration 'atom_add'
  3. /home/xxx/hcc/rocdl/opencl/src/misc/atom.cl:98:1 <Spelling=:2:1>: Generating code for declaration 'atom_add'
    clang-6.0: error: unable to execute command: Aborted (core dumped)
    clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
    HCC clang version 6.0.0 (based on HCC 1.0.17355-45a4017-d2d12cb-8c4ad1f )
    Target: amdgcn--amdhsa-amdgizcl
    Thread model: posix
    InstalledDir: /home/xxx/hcc/build/compiler/./bin
    clang-6.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
    clang-6.0: note: diagnostic msg:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/atom-790727.cl
clang-6.0: note: diagnostic msg: /tmp/atom-790727.sh
clang-6.0: note: diagnostic msg:


rocdl/opencl/CMakeFiles/opencl_lib.dir/build.make:1358: recipe for target 'rocdl/opencl/CMakeFiles/opencl_lib.dir/src/misc/atom.cl' failed
make[2]: *** [rocdl/opencl/CMakeFiles/opencl_lib.dir/src/misc/atom.cl] Error 254
make[2]: Leaving directory '/home/xxxx/hcc/build'
CMakeFiles/Makefile2:106609: recipe for target 'rocdl/opencl/CMakeFiles/opencl_lib.dir/all' failed
make[1]: *** [rocdl/opencl/CMakeFiles/opencl_lib.dir/all] Error 2
make[1]: Leaving directory '/home/xxxx/hcc/build'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

@aaronenyeshi
Copy link
Contributor

Hi, I ran into this same issue with atom.cl on latest hcc before too. The fix was to delete the build directory, and rebuild HCC again. Could you give it a try?

@gonuco
Copy link
Author

gonuco commented Sep 5, 2017

yes, I tried few times, and it works now.

@gonuco gonuco closed this as completed Sep 5, 2017
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