I installed LLVM 9.0.0 from the official LLVM Apt packages on Ubuntu 18.04 and it choked as follows. Have you seen this before? I can file an upstream bug report but I would like to know it's something worth addressing and not a known problem related to hipSYCL. Thanks.
~/Work/OpenCL/hipSYCL/build$ rm -rf * ; cmake -DCMAKE_INSTALL_PREFIX=/opt/sycl/hipsycl -DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9 ..
-- The C compiler identification is Clang 9.0.0
-- The CXX compiler identification is Clang 9.0.0
-- Check for working C compiler: /usr/bin/clang-9
-- Check for working C compiler: /usr/bin/clang-9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-9
-- Check for working CXX compiler: /usr/bin/clang++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr (found version "9.1")
-- Boost version: 1.66.0
-- Found the following Boost libraries:
-- filesystem
-- system
-- Boost version: 1.66.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jrhammon/Work/OpenCL/hipSYCL/build
jrhammon@klondike:~/Work/OpenCL/hipSYCL/build$ make
Scanning dependencies of target hipSYCL_cpu
[ 2%] Building CXX object src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/application.cpp.o
[ 5%] Building CXX object src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/device.cpp.o
[ 8%] Building CXX object src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/device_selector.cpp.o
[ 11%] Building CXX object src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/exception.cpp.o
[ 14%] Building CXX object src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/queue.cpp.o
Stack dump:
0. Program arguments: /usr/lib/llvm-9/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name queue.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/jrhammon/Work/OpenCL/hipSYCL/build/src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/queue.cpp.gcno -resource-dir /usr/lib/llvm-9/lib/clang/9.0.0 -D HIPSYCL_DEBUG_LEVEL=1 -D hipSYCL_cpu_EXPORTS -I /home/jrhammon/Work/OpenCL/hipSYCL/include -I /home/jrhammon/Work/OpenCL/hipSYCL/contrib/hipCPU/include -D NDEBUG -I/opt/intel/compilers_and_libraries_2019.3.199/linux/ipp/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/mkl/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/pstl/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/tbb/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/tbb/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/daal/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include/clang/9.0.0/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-9/lib/clang/9.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /home/jrhammon/Work/OpenCL/hipSYCL/build/src/libhipSYCL -ferror-limit 19 -fmessage-length 0 -fopenmp -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o CMakeFiles/hipSYCL_cpu.dir/queue.cpp.o -x c++ /home/jrhammon/Work/OpenCL/hipSYCL/src/libhipSYCL/queue.cpp
1. /home/jrhammon/Work/OpenCL/hipSYCL/include/CL/sycl/group.hpp:211:5: current parser token 'mem_fence'
2. /home/jrhammon/Work/OpenCL/hipSYCL/include/CL/sycl/group.hpp:40:1: parsing namespace 'cl'
3. /home/jrhammon/Work/OpenCL/hipSYCL/include/CL/sycl/group.hpp:41:1: parsing namespace 'cl::sycl'
4. /home/jrhammon/Work/OpenCL/hipSYCL/include/CL/sycl/group.hpp:44:1: parsing struct/union/class body 'cl::sycl::group'
5. /home/jrhammon/Work/OpenCL/hipSYCL/include/CL/sycl/group.hpp:199:3: parsing function body 'cl::sycl::group::async_work_group_copy'
6. /home/jrhammon/Work/OpenCL/hipSYCL/include/CL/sycl/group.hpp:199:3: in compound statement ('{}')
#0 0x00007fd8a6cf0d7f llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xa2ed7f)
#1 0x00007fd8a6cef1a0 llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xa2d1a0)
#2 0x00007fd8a6cf1181 (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xa2f181)
#3 0x00007fd8ac8d9890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x00007fd8ab495a68 isFromASTFile /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/AST/DeclBase.h:702:39
#5 0x00007fd8ab495a68 getFirstDecl /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/AST/Redeclarable.h:329:13
#6 0x00007fd8ab495a68 getCanonicalDecl /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/AST/Decl.h:2808:54
#7 0x00007fd8ab495a68 getCanonicalDecl /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:875:14
#8 0x00007fd8ab495a68 checkDecl /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:4944:9
#9 0x00007fd8ab49596d VisitStmt /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:5002:35
#10 0x00007fd8ab4957c0 doesDependOnLoopCounter /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:5027:7
#11 0x00007fd8ab4957c0 setLCDeclAndLB /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:4846:22
#12 0x00007fd8ab496d68 checkOpenMPIterationSpace /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:5672:11
#13 0x00007fd8ab476298 checkOpenMPLoop /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:6036:9
#14 0x00007fd8ab467f6e clang::Sema::ActOnOpenMPSimdDirective(llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation, llvm::SmallDenseMap<clang::ValueDecl const*, clang::Expr const*, 4u, llvm::DenseMapInfo<clang::ValueDecl const*>, llvm::detail::DenseMapPair<clang::ValueDecl const*, clang::Expr const*> >&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:6721:30
#15 0x00007fd8ab4614ad clang::Sema::ActOnOpenMPExecutableDirective(clang::OpenMPDirectiveKind, clang::DeclarationNameInfo const&, clang::OpenMPDirectiveKind, llvm::ArrayRef<clang::OMPClause*>, clang::Stmt*, clang::SourceLocation, clang::SourceLocation) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Sema/SemaOpenMP.cpp:4066:11
#16 0x00007fd8aac36a61 clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective(clang::Parser::ParsedStmtContext) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseOpenMP.cpp:1464:25
#17 0x00007fd8aac4a9d2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseStmt.cpp:366:12
#18 0x00007fd8aac494ea clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#19 0x00007fd8aac50ae0 clang::Parser::ParseCompoundStatementBody(bool) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseStmt.cpp:1063:11
#20 0x00007fd8aac517ed clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseStmt.cpp:2076:21
#21 0x00007fd8aabcc72e isNot /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Lex/Token.h:98:52
#22 0x00007fd8aabcc72e clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:556:14
#23 0x00007fd8aabcb83e clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:479:63
#24 0x00007fd8aabf7239 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int, clang::Decl*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDeclCXX.cpp:3353:21
#25 0x00007fd8aabf4c0d clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDeclCXX.cpp:0:7
#26 0x00007fd8aabd7d3f getPointer /build/llvm-toolchain-snapshot-9~svn366056/include/llvm/ADT/PointerIntPair.h:58:58
#27 0x00007fd8aabd7d3f isNull /build/llvm-toolchain-snapshot-9~svn366056/include/llvm/ADT/PointerUnion.h:189:19
#28 0x00007fd8aabd7d3f empty /build/llvm-toolchain-snapshot-9~svn366056/include/llvm/ADT/TinyPtrVector.h:162:13
#29 0x00007fd8aabd7d3f empty /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Sema/ParsedAttr.h:816:40
#30 0x00007fd8aabd7d3f clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDecl.cpp:3820:23
#31 0x00007fd8aac57d80 is /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Lex/Token.h:97:49
#32 0x00007fd8aac57d80 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseTemplate.cpp:216:11
#33 0x00007fd8aac572c6 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseTemplate.cpp:0:0
#34 0x00007fd8aac56cd4 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseTemplate.cpp:0:0
#35 0x00007fd8aabd7337 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDecl.cpp:1740:18
#36 0x00007fd8aac6685d clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/Parser.cpp:0:3
#37 0x00007fd8aabee7ca ~AttributePool /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Sema/ParsedAttr.h:712:22
#38 0x00007fd8aabee7ca ~ParsedAttributes /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Sema/ParsedAttr.h:906:7
#39 0x00007fd8aabee7ca clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDeclCXX.cpp:247:5
#40 0x00007fd8aabee3ad Exit /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Parse/Parser.h:1020:11
#41 0x00007fd8aabee3ad clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDeclCXX.cpp:227:18
#42 0x00007fd8aabd7431 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDecl.cpp:0:0
#43 0x00007fd8aac6685d clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/Parser.cpp:0:3
#44 0x00007fd8aabee7ca ~AttributePool /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Sema/ParsedAttr.h:712:22
#45 0x00007fd8aabee7ca ~ParsedAttributes /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Sema/ParsedAttr.h:906:7
#46 0x00007fd8aabee7ca clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDeclCXX.cpp:247:5
#47 0x00007fd8aabee3ad Exit /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/include/clang/Parse/Parser.h:1020:11
#48 0x00007fd8aabee3ad clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDeclCXX.cpp:227:18
#49 0x00007fd8aabd7431 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseDecl.cpp:0:0
#50 0x00007fd8aac6685d clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/Parser.cpp:0:3
#51 0x00007fd8aac65450 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/Parser.cpp:682:10
#52 0x00007fd8aabc877d clang::ParseAST(clang::Sema&, bool, bool) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Parse/ParseAST.cpp:157:5
#53 0x00007fd8abe64e68 clang::FrontendAction::Execute() /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Frontend/FrontendAction.cpp:938:10
#54 0x00007fd8abe25830 getPtr /build/llvm-toolchain-snapshot-9~svn366056/include/llvm/Support/Error.h:273:42
#55 0x00007fd8abe25830 operator bool /build/llvm-toolchain-snapshot-9~svn366056/include/llvm/Support/Error.h:236:16
#56 0x00007fd8abe25830 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/Frontend/CompilerInstance.cpp:944:23
#57 0x00007fd8abec77b0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /build/llvm-toolchain-snapshot-9~svn366056/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:291:25
#58 0x0000000000498646 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-9/bin/clang+0x498646)
#59 0x00000000004969c1 main (/usr/lib/llvm-9/bin/clang+0x4969c1)
#60 0x00007fd8a55b3b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#61 0x0000000000493e6a _start (/usr/lib/llvm-9/bin/clang+0x493e6a)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 9.0.0-svn366056-1~exp1+0~20190715114903.1088~1.gbp7d3830 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/queue-d95b49.cpp
clang: note: diagnostic msg: /tmp/queue-d95b49.sh
clang: note: diagnostic msg:
********************
src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/build.make:114: recipe for target 'src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/queue.cpp.o' failed
make[2]: *** [src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/queue.cpp.o] Error 254
CMakeFiles/Makefile2:146: recipe for target 'src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/all' failed
make[1]: *** [src/libhipSYCL/CMakeFiles/hipSYCL_cpu.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2