I am trying to compile an opencl sample code but I am getting the following error
/usr/bin/ld: cannot find -lOpenCL
/usr/bin/ld: cannot find -loclUtil_x86_64
/usr/bin/ld: cannot find -lshrutil_x86_64
collect2: error: ld returned 1 exit status
make: *** [../../..//OpenCL//bin//linux/release/DeviceQuery] Error 1
I am using intel based machine ...
My make file is
EXECUTABLE := DeviceQuery
CCFILES := devQury.cpp
include ../common/common_opencl.mk
Any help would be of great help
Thanks ,
Piyush
Make sure that the OpenCL library (libOpenCL.so) is present in /usr/lib. This should have been put in place by the driver, so you shouldn't have to do anything.
If not then copy libOpenCL.so present in your cuda toolkit (lib64) to the above location.
sudo cp /usr/local/cuda-7.0/lib64/libOpenCL.so /usr/lib
This fixes the error
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status
Have you installed the OpenCL SDK from either Intel or AMD? If not then perhaps you should follow these instructions. If you have an SDK installed then your makefile is probably missing -L... in the compiler command line, where ... is the path to the lib folder in the OpenCL SDK that should contain a file libOpenCL.a or something similar.
Related
Could anyone please let me know how to downgrade GNU package. I tried to download make-3.82.tar.gz file and extracted it and ran .configure. Then tried to run make got below error,
/glob/glob.c:577 undefined reference to '__alloca'
glob/libglob.a(glob.o):/path/glob/glob.c:728 more undefined reference to '__alloca' follow
collect2: error: ld returned 1 exit status.
Makefile: 359: recipe for target 'make' failed.
Thanks
I'm trying to compile Qscintilla 2.9.2 on Ubuntu 16.04 64bit using Qt 5.7 got the following error message:
-L/home/mwambi/Qt5.7.0/5.7/gcc_64/lib -lQt5PrintSupport -L/usr/lib64 -lQt5Widgets -lQt5Gui -lQt5Core -lpthread -lGL
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
Makefile:979: recipe for target 'libqscintilla2.so.12.0.1' failed
make: *** [libqscintilla2.so.12.0.1] Error 1
I do not know what the library GL is and where to find it. How can I solve this?
In my experience, this troubleshooting procedure is enough to solve about 90% of missing library issues during compilation:
"-l[name]" implies there's a "lib[name].so"
Search your system for "lib[name]" (use locate or find).
If you find it on your system, check paths ($LB_LIBRARY_PATH and the build system's -L flags) and verify that the architecture matches (x86+64 vs. i686).
Do a repository search for "lib[name]" (use apt, yum, synaptic, &c.).
Install it if it's missing.
Type "lib[name].so" into google or a dedicated package-search site (like RPMFind or packages.ubuntu.com) and see what package names come up, then search for as in #2-3.
In this case, libGL is an implementation of OpenGL. You can install Mesa or find an alternative implementation (I've only ever used Qt with Mesa). Here's a list of packages that provide libGL; if you already have one of these installed on your system, try fetching the dev versions of whichever ones you already have.
I'm using CentOS 6.4 and I'm trying to install the R package 'rPython'. It failed with following messages. Anybody knows how to fix this? Thanks!
/usr/bin/ld: /usr/local/lib/python2.7/config/libpython2.7.a(dictobject.o): relocation R_X86_64_32S against `PyDict_Type' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python2.7/config/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [rPython.so] Error 1
ERROR: compilation failed for package ‘rPython’
* removing ‘/usr/lib64/R/library/rPython’
It seems that the default installation of Python on RHEL / CentOS,
etc. is not "shared enabled", i.e., it does not include libpython*.so. Just the libpython*.a static library. This prevents some Python
applications to run properly. There are instructions in different
places, (e.g., here or here) indicating how to install Python as a shared library on CentOS and related Linux flavours.
How to resolve this error.
/usr/bin/ld: cannot find -lsybct
Collect2: ld returned 1 exit status
I can understand that it says library is missing.
When i searched for that library. It is already installed in my system.
locate libsybct.so
shows me path in which libsybct is installed
echo $LD_LIBRARY_PATH also shows correct path. I dont know where it went wrong.
There is no symbolic link created for it..
whether creating symbolic link for a library is important... If so where should I create and with what version.
just show the whole command?
maybe you forgot the "-L/your/path" options when you complied.
$LD_LIBRARY_PATH is for running time.
see reference here: /usr/bin/ld: cannot find -lemu
I just installed QtSDK 1.2 on my redhat enterprise linux 5.6. While compiling a QT program, I got the following errors:
[root#stack example1]# make
g++ -m64 -Wl,-O1 -Wl,-rpath,/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o example1 fac1.o -L/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib -lQtGui -lQtCore -lpthread
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `g_main_context_push_thread_default'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `inotify_init1#GLIBC_2.9'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `pipe2#GLIBC_2.9'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `g_main_context_pop_thread_default'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `FT_Library_SetLcdFilter'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `__longjmp_chk#GLIBC_2.11'
collect2: ld returned 1 exit status
make: *** [example1] Error 1
[root#stack example1]#
It seems g++ compiler uses all correct options. Befor I installed QtSDK 1.2 on rhel 5.6, I had copied libstdc++.so.6.0.10 to /usr/lib64 and relinked libstdc++.so.6 to libstdc++.so.6.0.10, since QtSDK requires GLIBCXX_3.4.9 symbols in the libstdc++ library. I think this may be the source of the problem. But I'm not sure about that. So any advice? Thanks in advance.
My answer is multiple questions:
Are you in a 64 architecture? If not why using 64 libraries?
Did the libraries copied are 64 versions ?
If it is the case, why do you need to copy them, there should already be standard libraries in /usr/lib64
If it is not the case the errors are legit.
How did you compiled Qt in the first place? if your Qt libraries are really 64 bits, then it means the environment setup was already correct.