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

undefined references for common_clang.o with opencl-clang 10.0.0-2 #156

Open
boegel opened this issue Jun 30, 2020 · 0 comments
Open

undefined references for common_clang.o with opencl-clang 10.0.0-2 #156

boegel opened this issue Jun 30, 2020 · 0 comments

Comments

@boegel
Copy link

boegel commented Jun 30, 2020

I'm trying to build opencl-clang 10.0.0-2 on top of Clang 10.0.0 (in the context of getting https://github.com/intel/compute-runtime/releases/tag/20.25.17111 built from source), and I'm running into this problem:

[ 97%] Linking CXX shared library libopencl-clang.so
/software/CMake/3.16.4-GCCcore-9.3.0/bin/cmake -E cmake_link_script CMakeFiles/opencl-clang.dir/link.txt --verbose=1
/software/GCCcore/9.3.0/bin/g++ -fPIC -O2 -ftree-vectorize -march=native -fno-math-errno -O3 -DNDEBUG  -Wl,-O3 -Wl,--gc-sections -Wl,--no-undefined -Wl,-Bsymbolic -Wl,--version-script=/tmp/openclclang/10.0.0-2/GCCcore-9.3.0/opencl-clang-10.0.0-2/common_clang.map -L/software/libxml2/2.9.10-GCCcore-9.3.0/lib -L/software/Clang/10.0.0-GCCcore-9.3.0/lib -L/software/SPIRV-LLVM-Translator/10.0.0-GCCcore-9.3.0-20200527/lib -L/software/binutils/2.34-GCCcore-9.3.0/lib -L/software/GCCcore/9.3.0/lib64 -L/software/GCCcore/9.3.0/lib -shared -Wl,-soname,libopencl-clang.so.10 -o libopencl-clang.so.10 CMakeFiles/opencl-clang.dir/common_clang.cpp.o CMakeFiles/opencl-clang.dir/options.cpp.o 
CMakeFiles/opencl-clang.dir/pch_mgr.cpp.o CMakeFiles/opencl-clang.dir/options_compile.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c.h.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-base.h.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-12-spir.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-20-spir.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-12-spir64.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-20-spir64.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-12-spir-fp64.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-20-spir-fp64.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-12-spir64-fp64.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-20-spir64-fp64.mod.cpp.o cl_headers/CMakeFiles/cl_headers.dir/module.modulemap.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/software/Clang/10.0.0-GCCcore-9.3.0/lib" -ldl -lLLVMSPIRVLib -lclang-cpp
CMakeFiles/opencl-clang.dir/common_clang.cpp.o:common_clang.cpp:function CommonClangInitialize(): error: undefined reference to 'LLVMInitializeX86TargetInfo'
CMakeFiles/opencl-clang.dir/common_clang.cpp.o:common_clang.cpp:function CommonClangInitialize(): error: undefined reference to 'LLVMInitializeX86Target'
CMakeFiles/opencl-clang.dir/common_clang.cpp.o:common_clang.cpp:function CommonClangInitialize(): error: undefined reference to 'LLVMInitializeX86AsmPrinter'
CMakeFiles/opencl-clang.dir/common_clang.cpp.o:common_clang.cpp:function CommonClangInitialize(): error: undefined reference to 'LLVMInitializeX86AsmParser'
CMakeFiles/opencl-clang.dir/common_clang.cpp.o:common_clang.cpp:function CommonClangInitialize(): error: undefined reference to 'LLVMInitializeX86TargetMC'
collect2: error: ld returned 1 exit status
make[2]: *** [libopencl-clang.so.10] Error 1

I'm also building Clang 10.0.0 from source myself, so it's possible the -lclang-cpp being linked with isn't what opencl-clang expects it to be...

I have specified the location to the Clang/LLVM installation via -DLLVM_DIR as is explained in the README, so I'm fairly sure that's not the problem here...

Any suggestions on what may be wrong here?

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

1 participant