Skip to content

[SYCL] Compilation Error when building the compiler for x86 target #646

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

Closed
crtrott opened this issue Sep 17, 2019 · 16 comments
Closed

[SYCL] Compilation Error when building the compiler for x86 target #646

crtrott opened this issue Sep 17, 2019 · 16 comments

Comments

@crtrott
Copy link
Contributor

crtrott commented Sep 17, 2019

Following the instruction to build the compiler for x86 I am running into this compilation error:

/home/crtrott/Software/llvm-intel/sycl/source/detail/os_util.cpp: In static member function ‘static void* cl::sycl::detail::OSUtil::alignedAlloc(size_t, size_t)’:
/home/crtrott/Software/llvm-intel/sycl/source/detail/os_util.cpp:101:43: error: ‘aligned_alloc’ was not declared in this scope
   return aligned_alloc(Alignment, NumBytes);

Configure:

cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;sycl" \
-DLLVM_ENABLE_PROJECTS="clang;llvm-spirv;sycl" \
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=/home/crtrott/Software/llvm-intel/sycl \
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=/home/crtrott/Software/llvm-intel/llvm-spirv \
-DCMAKE_INSTALL_PREFIX=/home/projects/x86-64/clang/intel/2019-09-17 \
/home/crtrott/Software/llvm-intel/llvm
@crtrott
Copy link
Contributor Author

crtrott commented Sep 17, 2019

Oh I should have said this is if you just type make -j.
The building with make -j sycl-toolchain I run into a different issue:

/home/crtrott/Software/llvm-intel/llvm/include/llvm/Support/Error.h:331:39:   required from ‘llvm::Error llvm::make_error(ArgTs&& ...) [with ErrT = llvm::RemarkSetupPatternError; ArgTs = {llvm::Error}]’
/home/crtrott/Software/llvm-intel/llvm/lib/IR/RemarkStreamer.cpp:151:62:   required from here
/home/crtrott/Software/llvm-intel/llvm/include/llvm/IR/RemarkStreamer.h:79:56: error: use of deleted function ‘llvm::Error::Error(const llvm::Error&)’
   using RemarkSetupErrorInfo<RemarkSetupPatternError>::RemarkSetupErrorInfo

@crtrott
Copy link
Contributor Author

crtrott commented Sep 17, 2019

Actually both errors seem to appear. The first one regarding aligned_alloc goes away if you just keep repeating the make command? It did after a clean appear even when you just build the sycl-toolchain.

@bader
Copy link
Contributor

bader commented Sep 17, 2019

@crtrott, could check that your environment satisfies these pre-requisites - https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedWithSYCLCompiler.md#prerequisites, please?

If so, could you provide the logs from "configure" and "make" steps?

@crtrott
Copy link
Contributor Author

crtrott commented Sep 17, 2019

Environment:

[crtrott@apollo build]$ uname -a
Linux apollo.sandia.gov 2.6.32-754.14.2.el6.x86_64 #1 SMP Wed Apr 24 16:18:30 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
[crtrott@apollo build]$ cmake --version
cmake version 3.12.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[crtrott@apollo build]$ g++ --version
g++ (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[crtrott@apollo build]$ python
python            python2.6         python2.7-config  python-config     
python2           python2.7         python2-config    pythontex         
[crtrott@apollo build]$ python --version
Python 2.7.9
[crtrott@apollo build]$ git --version
git version 2.10.1

Configure:

-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/7.3.0/base/bin/gcc
-- Check for working C compiler: /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/7.3.0/base/bin/gcc
-- Check for working C compiler: /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/7.3.0/base/bin/gcc -- 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: /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/7.3.0/base/bin/g++
-- Check for working CXX compiler: /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/7.3.0/base/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- debuginfo-tests project is disabled
-- libclc project is disabled
-- libcxx project is disabled
-- libcxxabi project is disabled
-- libunwind project is disabled
-- lld project is disabled
-- lldb project is disabled
-- llgo project is disabled
-- openmp project is disabled
-- parallel-libs project is disabled
-- polly project is disabled
-- pstl project is disabled
-- llvm-spirv project is enabled
-- sycl project is enabled
-- Could NOT find Z3: Found unsuitable version "0.0.0", but required is at least "4.7.1" (found Z3_LIBRARIES-NOTFOUND)
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for zlib.h
-- Looking for zlib.h - found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - not found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for linux/magic.h
-- Looking for linux/magic.h - found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_getspecific in pthread
-- Looking for pthread_getspecific in pthread - found
-- Looking for pthread_rwlock_init in pthread
-- Looking for pthread_rwlock_init in pthread - found
-- Looking for pthread_mutex_lock in pthread
-- Looking for pthread_mutex_lock in pthread - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- 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  
-- Looking for compress2 in z
-- Looking for compress2 in z - found
-- Looking for setupterm in terminfo
-- Looking for setupterm in terminfo - not found
-- Looking for setupterm in tinfo
-- Looking for setupterm in tinfo - not found
-- Looking for setupterm in curses
-- Looking for setupterm in curses - not found
-- Looking for setupterm in ncurses
-- Looking for setupterm in ncurses - not found
-- Looking for setupterm in ncursesw
-- Looking for setupterm in ncursesw - not found
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.7.6") 
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for futimes
-- Looking for futimes - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Looking for sigaltstack
-- Looking for sigaltstack - found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for posix_spawn
-- Looking for posix_spawn - found
-- Looking for pread
-- Looking for pread - found
-- Looking for sbrk
-- Looking for sbrk - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strerror_s
-- Looking for strerror_s - not found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dladdr
-- Looking for dladdr - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Looking for sched_getaffinity
-- Looking for sched_getaffinity - found
-- Looking for CPU_COUNT
-- Looking for CPU_COUNT - found
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE - Success
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Success
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
-- Building with -fPIC
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_CXX_STD
-- Performing Test CXX_SUPPORTS_CXX_STD - Success
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Failed
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FDATA_SECTIONS
-- Performing Test C_SUPPORTS_FDATA_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Success
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Found PythonInterp: /projects/sems/install/rhel6-x86_64/sems/compiler/python/2.7.9/bin/python2.7 (found version "2.7.9") 
-- Constructing LLVMBuild project information
-- Found Git: /projects/sems/install/rhel6-x86_64/sems/utility/git/2.10.1/bin/git (found version "2.10.1") 
-- Linker detection: GNU ld
-- Targeting X86
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Clang version: 9.0.0
-- Performing Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG
-- Performing Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG - Failed
-- Looking for include file sys/inotify.h
-- Looking for include file sys/inotify.h - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23") 
-- Checking for one of the modules 'SPIRV-Tools'
CMake Warning at /home/crtrott/Software/llvm-intel/llvm-spirv/test/CMakeLists.txt:27 (message):
  spirv-as not found! SPIR-V assembly tests will not be run.


CMake Warning at /home/crtrott/Software/llvm-intel/llvm-spirv/test/CMakeLists.txt:32 (message):
  spirv-val not found! SPIR-V generated for test suite will not be validated.


OpenCL_INCLUDE_DIRS is missed. Will try to download OpenCL headers from github.com
OpenCL_LIBRARIES is missed. Will try to download OpenCL ICD Loader from github.com
CMake Warning (dev) at /home/crtrott/Software/llvm-intel/llvm/cmake/modules/AddLLVM.cmake:15 (message):
  Exception handling requires RTTI.  Enabling RTTI for PiTests
Call Stack (most recent call first):
  /home/crtrott/Software/llvm-intel/llvm/cmake/modules/AddLLVM.cmake:769 (llvm_update_compile_flags)
  /home/crtrott/Software/llvm-intel/llvm/cmake/modules/AddLLVM.cmake:1145 (add_llvm_executable)
  /home/crtrott/Software/llvm-intel/sycl/unittests/CMakeLists.txt:5 (add_unittest)
  /home/crtrott/Software/llvm-intel/sycl/unittests/pi/CMakeLists.txt:7 (add_llvm_unittest)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Adding component clang to deploy
-- Adding component clang-offload-wrapper to deploy
-- Adding component clang-offload-bundler to deploy
-- Adding component llc to deploy
-- Adding component llvm-as to deploy
-- Adding component llvm-ar to deploy
-- Adding component llvm-dis to deploy
-- Adding component llvm-no-spir-kernel to deploy
-- Adding component llvm-spirv to deploy
-- Adding component llvm-link to deploy
-- Adding component llvm-objcopy to deploy
-- Adding component opt to deploy
-- Adding component clang-resource-headers to deploy
-- Adding component opencl-headers to deploy
-- Adding component sycl-headers to deploy
-- Failed to find LLVM FileCheck
-- Version: 0.0.0
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS
-- Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/crtrott/Software/llvm-intel/build

Build make -j 40 -k

[  0%] Creating export file for LTO
[  0%] Generating VCSRevision.h
[  0%] Creating export file for LLVMHello
[  0%] Generating ../../../../bin/hmaptool
[  0%] Generating ../../../../bin/scan-view
[  0%] Creating directories for 'ocl-headers'
[  0%] Creating export file for BugpointPasses
...
[ 98%] Built target clang-refactor
[ 98%] Built target clang-check
[100%] Linking CXX executable ../../bin/llvm-exegesis
[100%] Built target clang-import-test
[100%] Built target llvm-exegesis
[100%] Built target clang
[100%] Linking CXX shared library ../../../../lib/libclang.so
[100%] Built target libclang
Scanning dependencies of target c-arcmt-test
Scanning dependencies of target c-index-test
[100%] Building C object tools/clang/tools/c-arcmt-test/CMakeFiles/c-arcmt-test.dir/c-arcmt-test.c.o
[100%] Linking CXX executable ../../../../bin/c-arcmt-test
[100%] Building C object tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.o
[100%] Building CXX object tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/core_main.cpp.o
[100%] Built target c-arcmt-test
[100%] Linking CXX executable ../../../../bin/c-index-test
[100%] Built target c-index-test

build again to see errors:

[  0%] Built target LLVMDemangle
[  4%] Built target LLVMSupport
[  4%] Built target LLVMTableGen
[  6%] Built target obj.llvm-tblgen
[  6%] Built target llvm-tblgen
[  6%] Built target AttributeCompatFuncTableGen
[  6%] Built target intrinsics_gen
[  8%] Built target LLVMCore
[  8%] Built target LLVMFuzzMutate
[  8%] Built target LLVMIRReader
[ 12%] Built target LLVMCodeGen
[ 14%] Built target LLVMSelectionDAG
[ 14%] Built target LLVMAsmPrinter
[ 14%] Built target LLVMMIRParser
[ 16%] Built target LLVMGlobalISel
[ 16%] Built target LLVMBinaryFormat
[ 16%] Built target LLVMBitReader
[ 17%] Built target LLVMBitWriter
[ 17%] Built target LLVMBitstreamReader
[ 20%] Built target LLVMTransformUtils
[ 22%] Built target LLVMInstrumentation
[ 22%] Built target LLVMAggressiveInstCombine
[ 22%] Built target InstCombineTableGen
[ 22%] Built target LLVMInstCombine
[ 24%] Built target LLVMScalarOpts
[ 25%] Built target LLVMipo
[ 25%] Built target LLVMVectorize
[ 25%] Built target LLVMHello_exports
[ 25%] Built target LLVMHello
[ 27%] Built target LLVMObjCARCOpts
[ 29%] Built target LLVMCoroutines
[ 29%] Built target LLVMLinker
[ 32%] Built target LLVMAnalysis
[ 32%] Built target llvm_vcsrevision_h
[ 32%] Built target LLVMLTO
[ 35%] Built target LLVMMC
[ 35%] Built target LLVMMCParser
[ 35%] Built target LLVMMCDisassembler
[ 35%] Built target LLVMMCA
[ 35%] Built target LLVMObject
[ 37%] Built target LLVMObjectYAML
[ 37%] Built target LLVMOption
[ 38%] Built target LLVMRemarks
[ 38%] Built target LLVMDebugInfoDWARF
[ 38%] Built target LLVMDebugInfoGSYM
[ 38%] Built target LLVMDebugInfoMSF
[ 40%] Built target LLVMDebugInfoCodeView
[ 43%] Built target LLVMDebugInfoPDB
[ 43%] Built target LLVMSymbolize
[ 43%] Built target LLVMExecutionEngine
[ 43%] Built target LLVMInterpreter
[ 43%] Built target LLVMJITLink
[ 43%] Built target LLVMMCJIT
[ 43%] Built target LLVMProfileData
[ 43%] Built target LLVMOrcJIT
[ 43%] Built target LLVMRuntimeDyld
[ 43%] Built target LLVMTarget
[ 43%] Built target X86CommonTableGen
[ 45%] Built target LLVMX86CodeGen
[ 45%] Built target LLVMX86AsmParser
[ 45%] Built target LLVMX86Disassembler
[ 45%] Built target LLVMX86Desc
[ 45%] Built target LLVMX86Info
[ 45%] Built target LLVMX86Utils
[ 46%] Built target LLVMAsmParser
[ 46%] Built target LLVMLineEditor
[ 46%] Built target LLVMCoverage
[ 46%] Built target LLVMPasses
[ 46%] Built target LLVMTextAPI
[ 46%] Built target DllOptionsTableGen
[ 46%] Built target LLVMDlltoolDriver
[ 46%] Built target LibOptionsTableGen
[ 46%] Built target LLVMLibDriver
[ 48%] Built target LLVMXRay
[ 48%] Built target gtest
[ 48%] Built target LLVMTestingSupport
[ 48%] Built target LLVMWindowsManifest
[ 48%] Built target LLVMASFixer
[ 48%] Built target FileCheck
[ 48%] Built target llvm-PerfectShuffle
[ 48%] Built target count
[ 48%] Built target not
[ 48%] Built target yaml-bench
[ 48%] Built target LTO_exports
[ 48%] Built target LTO
[ 48%] Built target llvm-ar
[ 48%] Built target llvm-dlltool
[ 48%] Built target llvm-ranlib
[ 48%] Built target llvm-lib
[ 48%] Built target llvm-config
[ 48%] Built target llvm-lto
[ 48%] Built target llvm-profdata
[ 48%] Built target obj.clang-tblgen
[ 48%] Built target clang-tblgen
[ 53%] Built target clang-resource-headers
[ 53%] Built target ClangSACheckers
[ 53%] Built target ClangCommentCommandList
[ 53%] Built target ClangCommentCommandInfo
[ 53%] Built target ClangCommentHTMLNamedCharacterReferences
[ 53%] Built target ClangAttrTextDump
[ 53%] Built target StmtDataCollectors
[ 53%] Built target ClangAttrImpl
[ 53%] Built target ClangAttrTraverse
[ 54%] Built target ClangAttrClasses
[ 54%] Built target ClangAttrVisitor
[ 54%] Built target ClangStmtNodes
[ 54%] Built target ClangDeclNodes
[ 54%] Built target ClangCommentNodes
[ 54%] Built target ClangCommentHTMLTagsProperties
[ 54%] Built target ClangCommentHTMLTags
[ 54%] Built target ClangDiagnosticRefactoring
[ 54%] Built target ClangDiagnosticIndexName
[ 54%] Built target ClangAttrList
[ 54%] Built target ClangDiagnosticFrontend
[ 54%] Built target ClangAttrHasAttributeImpl
[ 54%] Built target ClangARMFP16
[ 54%] Built target ClangDiagnosticAnalysis
[ 54%] Built target ClangDiagnosticAST
[ 54%] Built target ClangDiagnosticParse
[ 54%] Built target ClangDiagnosticComment
[ 54%] Built target ClangDiagnosticGroups
[ 54%] Built target ClangDiagnosticDriver
[ 54%] Built target ClangDiagnosticCommon
[ 54%] Built target ClangDiagnosticLex
[ 54%] Built target ClangDiagnosticSema
[ 54%] Built target ClangDiagnosticSerialization
[ 54%] Built target ClangAttrSubjectMatchRuleList
[ 54%] Built target ClangARMNeon
[ 54%] Built target ClangDiagnosticCrossTU
[ 54%] Built target ClangAttrParserStringSwitches
[ 54%] Built target ClangAttrSubMatchRulesParserStringSwitches
[ 54%] Built target ClangAttrParsedAttrKinds
[ 54%] Built target ClangAttrSpellingListIndex
[ 54%] Built target ClangAttrParsedAttrList
[ 54%] Built target ClangAttrParsedAttrImpl
[ 54%] Built target ClangAttrTemplateInstantiate
[ 54%] Built target ClangAttrPCHRead
[ 54%] Built target ClangAttrPCHWrite
[ 54%] Built target clang-tablegen-targets
[ 56%] Built target obj.clangBasic
[ 56%] Built target clangBasic
[ 58%] Built target obj.clangLex
[ 58%] Built target clangLex
[ 58%] Built target obj.clangParse
[ 58%] Built target clangParse
[ 59%] Built target obj.clangAST
[ 59%] Built target clangAST
[ 59%] Built target obj.clangASTMatchers
[ 59%] Built target clangASTMatchers
[ 59%] Built target obj.clangDynamicASTMatchers
[ 59%] Built target clangDynamicASTMatchers
[ 59%] Built target obj.clangCrossTU
[ 59%] Built target clangCrossTU
[ 59%] Built target ClangOpenCLBuiltinsImpl
[ 61%] Built target obj.clangSema
[ 61%] Built target clangSema
[ 62%] Built target obj.clangCodeGen
[ 62%] Built target clangCodeGen
[ 62%] Built target obj.clangSYCLLowerIR
[ 62%] Built target clangSYCLLowerIR
[ 64%] Built target obj.clangAnalysis
[ 64%] Built target clangAnalysis
[ 64%] Built target obj.clangFormat
[ 64%] Built target clangFormat
[ 66%] Built target SampleAnalyzerPlugin_exports
[ 66%] Built target obj.clangEdit
[ 66%] Built target clangEdit
[ 66%] Built target obj.clangRewrite
[ 66%] Built target clangRewrite
[ 66%] Built target ClangDriverOptions
[ 69%] Built target obj.clangDriver
[ 69%] Built target clangDriver
[ 70%] Built target obj.clangSerialization
[ 70%] Built target clangSerialization
[ 72%] Built target obj.clangFrontend
[ 72%] Built target clangFrontend
[ 72%] Built target obj.clangToolingCore
[ 72%] Built target clangToolingCore
[ 72%] Built target obj.clangToolingInclusions
[ 72%] Built target clangToolingInclusions
[ 72%] Built target obj.clangIndex
[ 72%] Built target clangIndex
[ 74%] Built target obj.clangStaticAnalyzerCore
[ 74%] Built target clangStaticAnalyzerCore
[ 77%] Built target obj.clangStaticAnalyzerCheckers
[ 77%] Built target clangStaticAnalyzerCheckers
[ 77%] Built target obj.clangStaticAnalyzerFrontend
[ 77%] Built target clangStaticAnalyzerFrontend
[ 77%] Built target SampleAnalyzerPlugin
[ 77%] Built target CheckerDependencyHandlingAnalyzerPlugin_exports
[ 77%] Built target CheckerDependencyHandlingAnalyzerPlugin
[ 77%] Built target CheckerOptionHandlingAnalyzerPlugin_exports
[ 77%] Built target CheckerOptionHandlingAnalyzerPlugin
[ 79%] Built target obj.clangARCMigrate
[ 80%] Built target clangARCMigrate
[ 80%] Built target obj.clangRewriteFrontend
[ 80%] Built target clangRewriteFrontend
[ 80%] Built target obj.clangFrontendTool
[ 80%] Built target clangFrontendTool
[ 80%] Built target obj.clangTooling
[ 80%] Built target clangTooling
[ 82%] Built target obj.clangToolingRefactoring
[ 82%] Built target clangToolingRefactoring
[ 82%] Built target obj.clangToolingASTDiff
[ 82%] Built target clangToolingASTDiff
[ 82%] Built target obj.clangToolingSyntax
[ 82%] Built target clangToolingSyntax
[ 82%] Built target obj.clangDependencyScanning
[ 82%] Built target clangDependencyScanning
[ 82%] Built target obj.clangDirectoryWatcher
[ 82%] Built target clangDirectoryWatcher
[ 82%] Built target diagtool
[ 82%] Built target clang-offload-wrapper
[ 82%] Built target clang-offload-bundler
[ 82%] Built target clang
[ 82%] Built target clang-diff
[ 82%] Built target clang-format
[ 82%] Built target obj.clangHandleCXX
[ 82%] Built target clangHandleCXX
[ 82%] Built target obj.clangHandleLLVM
[ 82%] Built target clangHandleLLVM
[ 82%] Built target clang-import-test
[ 82%] Built target clang-scan-deps
[ 82%] Built target libclang_exports
[ 83%] Built target libclang
[ 83%] Built target c-index-test
[ 83%] Built target clang-rename
[ 83%] Built target clang-refactor
[ 83%] Built target clang-cpp
[ 83%] Built target arcmt-test
[ 83%] Built target c-arcmt-test
[ 83%] Built target clang-check
[ 83%] Built target clang-extdef-mapping
[ 83%] Built target scan-build
[ 83%] Built target scan-view
[ 83%] Built target hmaptool
[ 83%] Built target bugpoint
[ 83%] Built target BugpointPasses_exports
[ 83%] Built target BugpointPasses
[ 83%] Built target dsymutil
[ 83%] Built target llc
[ 83%] Built target lli
[ 83%] Built target lli-child-target
[ 83%] Built target llvm-as
[ 83%] Built target llvm-bcanalyzer
[ 83%] Built target llvm-c-test
[ 85%] Built target llvm-cat
[ 85%] Built target LLVMCFIVerify
[ 85%] Built target llvm-cfi-verify
[ 85%] Built target llvm-cov
[ 85%] Built target CvtResTableGen
[ 85%] Built target llvm-cvtres
[ 85%] Built target llvm-cxxdump
[ 85%] Built target llvm-cxxfilt
[ 85%] Built target llvm-cxxmap
[ 85%] Built target llvm-diff
[ 85%] Built target llvm-dis
[ 85%] Built target llvm-dwarfdump
[ 85%] Built target llvm-dwp
[ 85%] Built target llvm-elfabi
[ 87%] Built target LLVMExegesis
[ 87%] Built target LLVMExegesisX86
[ 88%] Built target llvm-exegesis
[ 88%] Built target llvm-extract
[ 88%] Built target llvm-isel-fuzzer
[ 88%] Built target llvm-itanium-demangle-fuzzer
[ 88%] Built target llvm-jitlink
[ 88%] Built target llvm-link
[ 88%] Built target LipoOptsTableGen
[ 88%] Built target llvm-lipo
[ 88%] Built target llvm-lto2
[ 88%] Built target llvm-mc
[ 88%] Built target llvm-mca
[ 88%] Built target llvm-microsoft-demangle-fuzzer
[ 88%] Built target llvm-modextract
[ 88%] Built target MtTableGen
[ 88%] Built target llvm-mt
[ 90%] Built target llvm-nm
[ 90%] Built target llvm-no-spir-kernel
[ 90%] Built target ObjcopyOptsTableGen
[ 90%] Built target StripOptsTableGen
[ 90%] Built target llvm-objcopy
[ 91%] Built target llvm-strip
[ 91%] Built target llvm-objdump
[ 91%] Built target llvm-opt-fuzzer
[ 91%] Built target llvm-opt-report
[ 93%] Built target llvm-pdbutil
[ 93%] Built target RcTableGen
[ 93%] Built target llvm-rc
[ 93%] Built target llvm-readobj
[ 93%] Built target llvm-readelf
[ 93%] Built target llvm-rtdyld
[ 93%] Built target llvm-size
[ 93%] Built target llvm-special-case-list-fuzzer
[ 93%] Built target llvm-split
[ 93%] Built target llvm-stress
[ 93%] Built target llvm-strings
[ 93%] Built target llvm-symbolizer
[ 93%] Built target llvm-addr2line
[ 93%] Built target llvm-undname
[ 93%] Built target llvm-xray
[ 93%] Built target llvm-yaml-numeric-parser-fuzzer
[ 93%] Built target obj2yaml
[ 95%] Built target opt
[ 95%] Built target Remarks_exports
[ 95%] Built target Remarks
[ 95%] Built target sancov
[ 95%] Built target sanstats
[ 95%] Built target verify-uselistorder
[ 96%] Built target yaml2obj
[ 98%] Built target LLVMSPIRVLib
[ 98%] Built target llvm-spirv
[ 98%] Performing update step for 'ocl-headers'
Current branch HEAD is up to date.
[ 98%] No configure step for 'ocl-headers'
[ 98%] Performing build step for 'ocl-headers'
[ 98%] No install step for 'ocl-headers'
[ 98%] Completed 'ocl-headers'
[ 98%] Built target ocl-headers
[ 98%] Performing update step for 'ocl-icd'
Current branch HEAD is up to date.
[ 98%] Performing configure step for 'ocl-icd'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/crtrott/Software/llvm-intel/build/tools/sycl/icd_build
[ 98%] Performing build step for 'ocl-icd'
[ 20%] Built target OpenCL
[ 28%] Built target IcdLog
[ 48%] Built target OpenCLDriverStub
[100%] Built target icd_loader_test
[ 98%] Performing install step for 'ocl-icd'
[ 20%] Built target OpenCL
[ 28%] Built target IcdLog
[ 48%] Built target OpenCLDriverStub
[100%] Built target icd_loader_test
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/crtrott/Software/llvm-intel/build/lib/libOpenCL.so.1.2
-- Up-to-date: /home/crtrott/Software/llvm-intel/build/lib/libOpenCL.so.1
-- Up-to-date: /home/crtrott/Software/llvm-intel/build/lib/libOpenCL.so
[ 98%] Completed 'ocl-icd'
[ 98%] Built target ocl-icd
[ 98%] Copying SYCL headers ...
[ 98%] Built target sycl-headers
[ 98%] Building CXX object tools/sycl/source/CMakeFiles/sycl.dir/detail/os_util.cpp.o
/home/crtrott/Software/llvm-intel/sycl/source/detail/os_util.cpp: In static member function ‘static void* cl::sycl::detail::OSUtil::alignedAlloc(size_t, size_t)’:
/home/crtrott/Software/llvm-intel/sycl/source/detail/os_util.cpp:101:10: error: ‘aligned_alloc’ was not declared in this scope
   return aligned_alloc(Alignment, NumBytes);
          ^~~~~~~~~~~~~
/home/crtrott/Software/llvm-intel/sycl/source/detail/os_util.cpp:101:10: note: suggested alternative: ‘alignedAlloc’
   return aligned_alloc(Alignment, NumBytes);
          ^~~~~~~~~~~~~
          alignedAlloc
make[2]: *** [tools/sycl/source/CMakeFiles/sycl.dir/detail/os_util.cpp.o] Error 1
make[2]: Target `tools/sycl/source/CMakeFiles/sycl.dir/build' not remade because of errors.
make[1]: *** [tools/sycl/source/CMakeFiles/sycl.dir/all] Error 2
[ 98%] Built target get_device_count_by_type
[ 98%] Built target TestPlugin
[ 98%] Built target SecondLib
[ 98%] Built target PipSqueak
[ 98%] Built target DynamicLibraryLib
[ 98%] Built target gtest_main
[ 98%] Built target benchmark
[ 98%] Built target benchmark_main

@alexbatashev
Copy link
Contributor

@crtrott can you please try this small hack?

diff --git a/sycl/source/detail/os_util.cpp b/sycl/source/detail/os_util.cpp
index e6081c9104e..6619096213f 100644
--- a/sycl/source/detail/os_util.cpp
+++ b/sycl/source/detail/os_util.cpp
@@ -98,7 +98,9 @@ size_t OSUtil::getOSMemSize() {

 void *OSUtil::alignedAlloc(size_t Alignment, size_t NumBytes) {
 #if defined(SYCL_RT_OS_LINUX)
-  return aligned_alloc(Alignment, NumBytes);
+  void *Addr;
+  posix_memalign(&Addr, Alignment, NumBytes);
+  return Addr;
 #elif defined(SYCL_RT_OS_WINDOWS)
   return _aligned_malloc(NumBytes, Alignment);
 #endif

@crtrott
Copy link
Contributor Author

crtrott commented Sep 18, 2019

It build!

@alexbatashev
Copy link
Contributor

It build!

@crtrott good to hear! Can you please tell me more about your Linux distro? What it's called and can I get it somewhere? I used this hack to build runtime on macOS, so I'm wondering why you need it on Linux too.

@crtrott
Copy link
Contributor Author

crtrott commented Sep 18, 2019

This is more or less vanilla RedHat 6. But we install additional modules (using the 'module' package management system) which adds newer compilers and everything else.

@alexbatashev
Copy link
Contributor

This is more or less vanilla RedHat 6. But we install additional modules (using the 'module' package management system) which adds newer compilers and everything else.

Strange... aligned_alloc should have worked. Anyway, I'm happy it is finally built.

@jbrodman
Copy link
Contributor

jbrodman commented Sep 18, 2019 via email

@bader
Copy link
Contributor

bader commented Sep 18, 2019

It looks like aligned_alloc in C++ is C++17 feature.
https://en.cppreference.com/w/cpp/memory/c/aligned_alloc.

@crtrott
Copy link
Contributor Author

crtrott commented Sep 18, 2019

Yes aligned_alloc is part of C++17 (which sucks in C11). I didn't try to compile the compiler with GCC 9 though, so I didn't use a compiler which would enable C++17. I mean you could change your requirements to ask for C++17 compiler - it is not completely unreasonable to do so. But then you should also enforce C++17 in your CMakeList.

@alexbatashev
Copy link
Contributor

Yes aligned_alloc is part of C++17 (which sucks in C11). I didn't try to compile the compiler with GCC 9 though, so I didn't use a compiler which would enable C++17. I mean you could change your requirements to ask for C++17 compiler - it is not completely unreasonable to do so. But then you should also enforce C++17 in your CMakeList.

I use exactly the same GCC version as you on daily basis and I see no problems. But my machine runs Ubuntu 18.04. Buildbot machines use GCC 7.4.0. Which is also far away from 9. I've also had positive experience with GCC 5.5.0. This is why that fail looks strange to me.

@jbrodman
Copy link
Contributor

jbrodman commented Sep 18, 2019 via email

@AlexeySachkov
Copy link
Contributor

@alexbatashev, @crtrott, what is the status of this issue?

Was the problem finally resolved? Do we need to submit any additional patches? Can we close this issue?

@alexbatashev
Copy link
Contributor

@AlexeySachkov I believe this PR has fixed the issue: #763

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

5 participants