Skip to content

sycl/build/bin/opt: error: expected top-level entity #101

@j-stephan

Description

@j-stephan

I am currently trying to integrate the sycl/unified/next compiler into alpaka's (https://github.com/alpaka-group/alpaka) CMake infrastructure. Compiling a simple test case (axpy) works fine but once the link stage is reached it fails with the following error:

[100%] Linking CXX executable axpy
cd /home/jan/workspace/zoo/alpaka/build/test/integ/axpy && /snap/cmake/703/bin/cmake -E cmake_link_script CMakeFiles/axpy.dir/link.txt --verbose=1
/home/jan/sycl-workspace/sycl/build/bin/clang++ -O3 -DNDEBUG -fsycl -fsycl-targets=fpga64-xilinx-unknown-sycldevice CMakeFiles/axpy.dir/src/axpy.cpp.o -o axpy  ../../common/libcommon.a -lpthread /usr/lib/x86_64-linux-gnu/librt.so /usr/lib/x86_64-linux-gnu/libOpenCL.so -lsycl ../../catch_main/libCatchMain.a 
++ pwd
+ CWD=/home/jan/workspace/zoo/alpaka/build/test/integ/axpy
+ export VERBOSE=1
+ VERBOSE=1
+ [[ -z /home/jan/software/xilinx/Vitis/2020.1/bin ]]
+ [[ -z /home/jan/sycl-workspace/sycl/build/bin ]]
+ [[ -z axpy.cpp-37c5af ]]
+ [[ -z /tmp/axpy.cpp-37c5af.txt ]]
+ [[ -z /tmp ]]
+ [[ -z /tmp/axpy-e9e831.bc ]]
+ [[ -z /tmp/sycl-xocc-args2712-cbcee1 ]]
+ [[ -z /tmp/sycl-xocc-args2716-8d3ef5 ]]
+ [[ -z sw_emu ]]
+ SDX_BIN_PATH_DIR=/home/jan/software/xilinx/Vitis/2020.1/bin
+ [[ ! -d /home/jan/software/xilinx/Vitis/2020.1/bin ]]
+ SDX_LIB_SPIR=/home/jan/software/xilinx/Vitis/2020.1/bin/../lnx64/lib/libspir64-39-hls.bc
+ [[ ! -f /home/jan/software/xilinx/Vitis/2020.1/bin/../lnx64/lib/libspir64-39-hls.bc ]]
+ SDX_CLANG_LLVM_BIN=/home/jan/software/xilinx/Vitis/2020.1/bin/../lnx64/tools/clang-3.9-csynth/bin
+ [[ ! -f /home/jan/software/xilinx/Vitis/2020.1/bin/../lnx64/tools/clang-3.9-csynth/bin/llvm-as ]]
+ SDX=/home/jan/software/xilinx/Vitis/2020.1/bin/v++
+ [[ ! -f /home/jan/software/xilinx/Vitis/2020.1/bin/v++ ]]
+ DRIVER_PATH_DIR=/home/jan/sycl-workspace/sycl/build/bin
+ [[ ! -d /home/jan/sycl-workspace/sycl/build/bin ]]
+ OPT=/home/jan/sycl-workspace/sycl/build/bin/opt
+ [[ ! -f /home/jan/sycl-workspace/sycl/build/bin/opt ]]
+ LLVM_LINK=/home/jan/sycl-workspace/sycl/build/bin/llvm-link
+ [[ ! -f /home/jan/sycl-workspace/sycl/build/bin/llvm-link ]]
+ [[ ! -d /tmp ]]
+ SOURCE_FILE_NAME=axpy.cpp-37c5af
+ INPUT_FILE_NAME=/tmp/axpy.cpp-37c5af.txt
++ mktemp /tmp/sycl-xocc.XXXXXX
+ TMP_PATH=/tmp/sycl-xocc.s4Ko3U
+ OUTPUT_FILE_NAME=/tmp/axpy-e9e831.bc
++ cat /tmp/sycl-xocc-args2712-cbcee1
+ ADDITIONAL_COMPILE_ARGS=
++ cat /tmp/sycl-xocc-args2716-8d3ef5
+ ADDITIONAL_LINK_ARGS=
+ XCL_EMULATION_MODE=sw_emu
+ KERNELPROP=/tmp/sycl-xocc.s4Ko3U_KernelProperties_axpy.cpp-37c5af.bash
+ cp /tmp/axpy.cpp-37c5af.txt /tmp/sycl-xocc.s4Ko3U_axpy.cpp-37c5af_kernels.bc
+ /home/jan/sycl-workspace/sycl/build/bin/opt -asfix -globaldce -O3 -globaldce --infer-address-spaces -flat-address-space=4 -globaldce -inSPIRation -globaldce -kernelPropGen --sycl-kernel-propgen-output /tmp/sycl-xocc.s4Ko3U_KernelProperties_axpy.cpp-37c5af.bash /tmp/axpy.cpp-37c5af.txt -o /tmp/sycl-xocc.s4Ko3U_axpy.cpp-37c5af_kernels-optimized.bc
/home/jan/sycl-workspace/sycl/build/bin/opt: /tmp/axpy.cpp-37c5af.txt:1:1: error: expected top-level entity
/tmp/axpy-4e596d-e13720.devo
^
clang-12: error: sycl-link-xocc command failed with exit code 1 (use -v to see invocation)
make[3]: *** [test/integ/axpy/CMakeFiles/axpy.dir/build.make:107: test/integ/axpy/axpy] Error 1
make[3]: Leaving directory '/home/jan/workspace/zoo/alpaka/build'
make[2]: *** [CMakeFiles/Makefile2:1710: test/integ/axpy/CMakeFiles/axpy.dir/all] Error 2
make[2]: Leaving directory '/home/jan/workspace/zoo/alpaka/build'
make[1]: *** [CMakeFiles/Makefile2:1717: test/integ/axpy/CMakeFiles/axpy.dir/rule] Error 2
make[1]: Leaving directory '/home/jan/workspace/zoo/alpaka/build'
make: *** [Makefile:610: axpy] Error 2

Is there anything I can do to prevent or further investigate this error?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions