I have a linux ubuntu 10.04 LTS freshly installed on my x64 PC, and I just followed this step-by-step installation guide to install NVidia CUDA on my PC. But when I cd into ~/NVIDIA_GPU_Computing_SDK/C/src/nbody and try to make the nbody simulation, it just prints out:
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/nbody] Error 1
Is this a solvable problem?
I'm a newbie in Linux (and in Cuda programming) so please help me understanding.
cd /usr/lib/
ls -la | grep libGL.so
if libGL.so exists
sudo rm libGL.so
then run
sudo ln -s libGL.so.270.41.19 libGL.so
or whatever version of libGL.so you have
Use the Synaptic Package Manager and install the packages with libgl, libglu, libglut, etc. For example, libgl1-mesa and all its dev variants, freeglut, etc.
sudo apt-get install build-essential x-window-system-dev
will also get you the vast majority of those.
Related
System info
kernel:Linux ubuntu 5.4.0-121-generic #137~18.04.1-Ubuntu SMP Mon Jun 20 07:25:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
Default version of qemu installed by apt will cause system error when using gdb-multiarch to debug mips executable files. So i'm trying to compile the source codes.
I've installed re2c, ninja and some packages, which are the dependency of qemu.
wget https://github.com/skvadrik/re2c/releases/download/3.0/re2c-3.0.tar.xz
tar -xvzf re2c-1.0.1.tar.gz
cd re2c-1.0.1/
./configure
make -j4
sudo make install
cd ..
git clone https://github.com/ninja-build/ninja.git
cd ninja
./configure.py --bootstrap
sudo cp ninja /usr/bin/
ninja --version
cd ..
sudo apt install build-essential zlib1g-dev pkg-config
sudo apt install libglib2.0-dev binutils-dev libboost-all-dev libssl-dev
sudo apt install libpixman-1-dev libfdt-dev libsdl2-dev
Then i'd like to build qemu statically and get executable like qemu-mipsel(which are static linked so i rename the files with -static suffix). But when i was trying to run any mips executable file, i got error below.
$ ./qemu-mipsel-static (mips_file_name)
qemu-mipsel-static: Could not open '/lib/ld.so.1': No such file or directory
I'm sure that the arch and endian is right. And i copied related lib files in /usr/mipsel-linux-gnu/lib to current directory and using option -L to specify the lib file path. I got the same result.
And i tried the version installed by apt, It can run smoothly.
Commands for installing qemu via apt are as followed.
sudo apt-get install qemu
sudo apt-get install qemu-user-static
sudo apt-get install qemu-system
sudo apt-get install uml-utilities
sudo apt-get install bridge-utils
However, as for the higher version of qemu compiled by source code, when i was tring commands below, it can run smoothly.
chroot . ./qemu-mipsel-static (mips file)
I wonder the reason and how to correctly run the file using ./ and chroot two ways. Thanks for your help!
The error is
my_compress.c:542: undefined reference to `LZ4F_resetDecompressionContext'
My os is centos 7.7.1908 and I have installed lz4 by yum install -y lz4-devel. The install directory is as follows:
work#ost:~/workspace/mysql-5.6/bld $ ls /usr/lib64/liblz*
/usr/lib64/liblz4.so /usr/lib64/liblz4.so.1 /usr/lib64/liblz4.so.1.7.5 /usr/lib64/liblzma.so.5 /usr/lib64/liblzma.so.5.2.2
work#ost:~/workspace/mysql-5.6/bld $ ls /usr/include/lz4*
/usr/include/lz4frame.h /usr/include/lz4.h /usr/include/lz4hc.h
I find the answer. The version of lz4 is too old. Please see it here(https://github.com/facebook/mysql-5.6/issues/1114)
I installed CUDA 9 from the local deb but afterwards apt reports:
The following packages were automatically installed and are no longer required:
cuda-command-line-tools-9-0 cuda-core-9-0 cuda-cublas-9-0 cuda-cublas-dev-9-0 cuda-cudart-9-0 cuda-cudart-dev-9-0
cuda-cufft-9-0 cuda-cufft-dev-9-0 cuda-curand-9-0 cuda-curand-dev-9-0 cuda-cusolver-9-0 cuda-cusolver-dev-9-0
cuda-cusparse-9-0 cuda-cusparse-dev-9-0 cuda-documentation-9-0 cuda-driver-dev-9-0 cuda-libraries-9-0
cuda-libraries-dev-9-0 cuda-license-9-0 cuda-misc-headers-9-0 cuda-npp-9-0 cuda-npp-dev-9-0 cuda-nvgraph-9-0
cuda-nvgraph-dev-9-0 cuda-nvml-dev-9-0 cuda-nvrtc-9-0 cuda-nvrtc-dev-9-0 cuda-samples-9-0 cuda-toolkit-9-0
cuda-visual-tools-9-0 freeglut3 freeglut3-dev libdrm-dev libgl1-mesa-dev libglu1-mesa-dev libx11-xcb-dev
libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-shape0-dev
libxcb-sync-dev libxcb-xfixes0-dev libxmu-dev libxmu-headers libxshmfence-dev libxxf86vm-dev linux-headers-4.10.0-38
linux-headers-4.10.0-38-generic linux-image-4.10.0-38-generic linux-image-extra-4.10.0-38-generic mesa-common-dev
nvidia-modprobe x11proto-dri2-dev x11proto-gl-dev x11proto-xf86vidmode-dev
Use 'sudo apt autoremove' to remove them.
nvcc --version reports V9.0.176 and I have the following in /usr/local:
$ ls /usr/local/cuda-*
/usr/local/cuda-8.0:
bin samples
/usr/local/cuda-9.0:
bin extras lib64 libnvvp nsightee_plugins nvvm samples src tools
doc include libnsight LICENSE nvml README share targets version.txt
What did I do wrong?
I could not determine why the CUDA 9.0 packages were "no longer required", but I went ahead and removed all old packages and then installed CUDA 9.1 from the local deb linked in my question.
sudo apt autoremove
sudo apt --purge remove cuda-repo-ubuntu1704-9-0-local
sudo dpkg -i cuda-repo-ubuntu1704-9-1-local_9.1.85-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub
sudo apt update
sudo apt install cuda
And then I verified /usr/local/cuda-9.1/bin was in my $PATH, and I added export PATH=$PATH:/usr/local/cuda-9.1/bin to my ~/.bashrc.
I successfully installed the nvidia driver and toolkit for cuda 5 (but not the samples) on a 64 bit Ubuntu 12.04 box. The samples failed to install even though I previously ran
$ sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
I can't seem to find nvcc. I ran
$ export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:$LD_LIBRARY_PATH
nvcc -v reports that the compiler is not found:
nvcc -V No command 'nvcc' found, did you mean: Command 'nvlc' from
package 'vlc-nox' (universe) nvcc: command not found
The getting started guide hasn't been of much help here:
http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html
What's going on here? Do I need to install the gpu computing sdk samples to get nvcc? :/
Consider installing CUDA 5.5 in Ubuntu 12.04. The 5.5 release has special leverages to install it as a debian package. See the following links,
https://developer.nvidia.com/content/cudacasts-episode-5-install-cuda-55-linux-package-manager
https://developer.nvidia.com/cuda-downloads
It is truly much easier than all that you have tried till now ! personal experience ! :-)
Failing to install samples is a common problem as outlines in https://sn0v.wordpress.com/2012/12/07/installing-cuda-5-on-ubuntu-12-04/#comment-869
The solution is to find "libglut.so" and create a soft-link to it under /usr/lib. Then re-run the cuda*.run and choose to install only the samples.
sudo find /usr -name libglut\*
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
sudo ./cuda*.run #when prompted only install samples. ie do not install drivers and toolkit.
works for me on ubuntu 12.04 hope it works for you too
I met the problem during the installation, but I found the sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so is useless. My solution is to install freeglut3 first:
`sudo apt-get install freeglut3`
then use:
sudo ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so
After this, CUDA sample is successfully installed.
I'm trying to compile a C++ program and one of the classes uses . g++ is not able to find the libraries would be my guess. The command i use to compile is -
g++ c1.cpp c2.cpp c3.cpp c4.cpp -o c4 -lm -lmysqlclient
c3.cpp is the file that needs mysql.h. This works perfectly on my local machine, but refuses to run on the server with the error
cannot find -lmysqlclient
I tried finding the libmysqlclient.so files on the server using the find command, I don't think they are present there
uname -a
reveals
SunOS opteron 5.10 Generic_139556-08 i86pc i386 i86pc
user#opteron 12:26:02 ~/c++/projname/
I realize that i need to link some libraries, but where and how?
Any help would be appreciated.
Thanks.
Whatever library packages u think is not installed can be installed using sudo apt-get install. But the problem is to find the right name of the package apt-get can understand. So how to do that ?! simple
use command : sudo apt-cache search <filename>
For eg.: in this case lmysqlclient
sudo apt-cache search mysqlclient
(remember to exclude 'l' from the actual name ,ie, mysqlclient and not lmysqlclient).
This outputs:
libmysqlclient-dev - MySQL database development files
In the above -libmysqlclient-dev is the name that apt-get can recognize and solve our cannot find lmysqlclient problem
so now type: sudo apt-get install libmysqlclient-dev from interface.
After its done, try making your required file.
Simplifying #SriHariY.S's answer-
Try installing it with sudo apt-get install libmysqlclient-dev.
Do you have the MySQL client libraries? Can you look for it as
find / -name "libmysqlclient.so" -type f -print 2>/dev/null
Also, you can use the -R flag on linker to hardlink the libmysqlclient as
g++ -R/usr/local/mysql/lib ....
Or, you can export the LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH_64 as
export LD_LIBRARY_PATH_32=$MYSQL_HOME/lib
Urko,
On Ubuntu 18 I used this command to find a name of required package for fixing this error:
apt search lmysqlclient
After this I installed missing package:
sudo apt install libmariadbclient-dev-compat